diff options
Diffstat (limited to 'include/godot_cpp')
-rw-r--r-- | include/godot_cpp/classes/wrapped.hpp | 6 | ||||
-rw-r--r-- | include/godot_cpp/core/class_db.hpp | 13 | ||||
-rw-r--r-- | include/godot_cpp/godot.hpp | 4 |
3 files changed, 10 insertions, 13 deletions
diff --git a/include/godot_cpp/classes/wrapped.hpp b/include/godot_cpp/classes/wrapped.hpp index 06b1b67..0c02d15 100644 --- a/include/godot_cpp/classes/wrapped.hpp +++ b/include/godot_cpp/classes/wrapped.hpp @@ -111,7 +111,6 @@ protected: ::godot::List<::godot::PropertyInfo> plist_owned; void _postinitialize(); - virtual void _notificationv(int32_t p_what, bool p_reversed = false) {} Wrapped(const StringName p_godot_class); Wrapped(GodotObject *p_godot_object); @@ -408,11 +407,6 @@ public: _gde_binding_reference_callback, \ }; \ \ -protected: \ - virtual void _notificationv(int32_t p_what, bool p_reversed = false) override { \ - m_class::notification_bind(this, p_what, p_reversed); \ - } \ - \ private: // Don't use this for your classes, use GDCLASS() instead. diff --git a/include/godot_cpp/core/class_db.hpp b/include/godot_cpp/core/class_db.hpp index d9dce79..6edb324 100644 --- a/include/godot_cpp/core/class_db.hpp +++ b/include/godot_cpp/core/class_db.hpp @@ -116,9 +116,13 @@ private: static void _register_class(bool p_virtual = false, bool p_exposed = true, bool p_runtime = false); template <typename T> - static GDExtensionObjectPtr _create_instance_func(void *data) { + static GDExtensionObjectPtr _create_instance_func(void *data, GDExtensionBool p_notify_postinitialize) { if constexpr (!std::is_abstract_v<T>) { - T *new_object = memnew(T); + Wrapped::_set_construct_info<T>(); + T *new_object = new ("", "") T; + if (p_notify_postinitialize) { + new_object->_postinitialize(); + } return new_object->_owner; } else { return nullptr; @@ -241,7 +245,7 @@ void ClassDB::_register_class(bool p_virtual, bool p_exposed, bool p_runtime) { class_register_order.push_back(cl.name); // Register this class with Godot - GDExtensionClassCreationInfo3 class_info = { + GDExtensionClassCreationInfo4 class_info = { p_virtual, // GDExtensionBool is_virtual; is_abstract, // GDExtensionBool is_abstract; p_exposed, // GDExtensionBool is_exposed; @@ -263,11 +267,10 @@ void ClassDB::_register_class(bool p_virtual, bool p_exposed, bool p_runtime) { &ClassDB::get_virtual_func, // GDExtensionClassGetVirtual get_virtual_func; nullptr, // GDExtensionClassGetVirtualCallData get_virtual_call_data_func; nullptr, // GDExtensionClassCallVirtualWithData call_virtual_func; - nullptr, // GDExtensionClassGetRID get_rid; (void *)&T::get_class_static(), // void *class_userdata; }; - internal::gdextension_interface_classdb_register_extension_class3(internal::library, cl.name._native_ptr(), cl.parent_name._native_ptr(), &class_info); + internal::gdextension_interface_classdb_register_extension_class4(internal::library, cl.name._native_ptr(), cl.parent_name._native_ptr(), &class_info); // call bind_methods etc. to register all members of the class T::initialize_class(); diff --git a/include/godot_cpp/godot.hpp b/include/godot_cpp/godot.hpp index 1d36acc..39a5f05 100644 --- a/include/godot_cpp/godot.hpp +++ b/include/godot_cpp/godot.hpp @@ -181,10 +181,10 @@ extern "C" GDExtensionInterfaceRefSetObject gdextension_interface_ref_set_object extern "C" GDExtensionInterfaceScriptInstanceCreate3 gdextension_interface_script_instance_create3; extern "C" GDExtensionInterfacePlaceHolderScriptInstanceCreate gdextension_interface_placeholder_script_instance_create; extern "C" GDExtensionInterfacePlaceHolderScriptInstanceUpdate gdextension_interface_placeholder_script_instance_update; -extern "C" GDExtensionInterfaceClassdbConstructObject gdextension_interface_classdb_construct_object; +extern "C" GDExtensionInterfaceClassdbConstructObject2 gdextension_interface_classdb_construct_object2; extern "C" GDExtensionInterfaceClassdbGetMethodBind gdextension_interface_classdb_get_method_bind; extern "C" GDExtensionInterfaceClassdbGetClassTag gdextension_interface_classdb_get_class_tag; -extern "C" GDExtensionInterfaceClassdbRegisterExtensionClass3 gdextension_interface_classdb_register_extension_class3; +extern "C" GDExtensionInterfaceClassdbRegisterExtensionClass4 gdextension_interface_classdb_register_extension_class4; extern "C" GDExtensionInterfaceClassdbRegisterExtensionClassMethod gdextension_interface_classdb_register_extension_class_method; extern "C" GDExtensionInterfaceClassdbRegisterExtensionClassVirtualMethod gdextension_interface_classdb_register_extension_class_virtual_method; extern "C" GDExtensionInterfaceClassdbRegisterExtensionClassIntegerConstant gdextension_interface_classdb_register_extension_class_integer_constant; |