diff options
Diffstat (limited to 'include/godot_cpp/core')
| -rw-r--r-- | include/godot_cpp/core/class_db.hpp | 1 | ||||
| -rw-r--r-- | include/godot_cpp/core/property_info.hpp | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/include/godot_cpp/core/class_db.hpp b/include/godot_cpp/core/class_db.hpp index 6569445..1a17b57 100644 --- a/include/godot_cpp/core/class_db.hpp +++ b/include/godot_cpp/core/class_db.hpp @@ -186,6 +186,7 @@ void ClassDB::_register_class(bool p_virtual, bool p_exposed) { T::free_property_list_bind, // GDExtensionClassFreePropertyList free_property_list_func; T::property_can_revert_bind, // GDExtensionClassPropertyCanRevert property_can_revert_func; T::property_get_revert_bind, // GDExtensionClassPropertyGetRevert property_get_revert_func; + T::validate_property_bind, // GDExtensionClassValidateProperty validate_property_func; T::notification_bind, // GDExtensionClassNotification2 notification_func; T::to_string_bind, // GDExtensionClassToString to_string_func; nullptr, // GDExtensionClassReference reference_func; diff --git a/include/godot_cpp/core/property_info.hpp b/include/godot_cpp/core/property_info.hpp index 8146859..0ecfa32 100644 --- a/include/godot_cpp/core/property_info.hpp +++ b/include/godot_cpp/core/property_info.hpp @@ -68,6 +68,18 @@ struct PropertyInfo { PropertyInfo(GDExtensionVariantType p_type, const StringName &p_name, PropertyHint p_hint = PROPERTY_HINT_NONE, const String &p_hint_string = "", uint32_t p_usage = PROPERTY_USAGE_DEFAULT, const StringName &p_class_name = "") : PropertyInfo((Variant::Type)p_type, p_name, p_hint, p_hint_string, p_usage, p_class_name) {} + + PropertyInfo(const GDExtensionPropertyInfo *p_info) : + PropertyInfo(p_info->type, *reinterpret_cast<StringName *>(p_info->name), (PropertyHint)p_info->hint, *reinterpret_cast<String *>(p_info->hint_string), p_info->usage, *reinterpret_cast<StringName *>(p_info->class_name)) {} + + void _update(GDExtensionPropertyInfo *p_info) { + p_info->type = (GDExtensionVariantType)type; + *(reinterpret_cast<StringName *>(p_info->name)) = name; + p_info->hint = hint; + *(reinterpret_cast<String *>(p_info->hint_string)) = hint_string; + p_info->usage = usage; + *(reinterpret_cast<StringName *>(p_info->class_name)) = class_name; + } }; } // namespace godot |
