mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 07:17:42 -05:00
Use BitField<> in core type masks
* All core types masks are now correctly marked as bitfields. * The enum hacks in MouseButtonMask and many other types are gone. This ensures that binders to other languages non C++ can actually implement type safe bitmasks. * Most bitmask operations replaced by functions in BitField<> * Key is still a problem because its enum and mask at the same time. While it kind of works in C++, this most likely can't be implemented safely in other languages and will have to be changed at some point. Mostly left as-is. * Documentation and API dump updated to reflect bitfields in core types.
This commit is contained in:
@@ -463,12 +463,14 @@ Dictionary GDExtensionAPIDump::generate_extension_api() {
|
||||
int64_t value = CoreConstants::get_global_constant_value(i);
|
||||
String enum_name = CoreConstants::get_global_constant_enum(i);
|
||||
String name = CoreConstants::get_global_constant_name(i);
|
||||
bool bitfield = CoreConstants::is_global_constant_bitfield(i);
|
||||
if (!enum_name.is_empty()) {
|
||||
enum_list[enum_name].push_back(Pair<String, int64_t>(name, value));
|
||||
} else {
|
||||
Dictionary d;
|
||||
d["name"] = name;
|
||||
d["value"] = value;
|
||||
d["is_bitfield"] = bitfield;
|
||||
constants.push_back(d);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user