@@ -88,17 +88,12 @@ class ClassDB {
8888
8989public:
9090 struct ClassInfo {
91- struct VirtualMethod {
92- GDExtensionClassCallVirtual func;
93- uint32_t hash;
94- };
95-
9691 StringName name;
9792 StringName parent_name;
9893 GDExtensionInitializationLevel level = GDEXTENSION_INITIALIZATION_SCENE;
9994 std::unordered_map<StringName, MethodBind *> method_map;
10095 std::set<StringName> signal_names;
101- std::unordered_map<StringName, VirtualMethod > virtual_methods;
96+ std::unordered_map<StringName, GDExtensionClassCallVirtual > virtual_methods;
10297 std::set<StringName> property_names;
10398 std::set<StringName> constant_names;
10499 // Pointer to the parent custom class, if any. Will be null if the parent class is a Godot class.
@@ -122,13 +117,15 @@ class ClassDB {
122117 static void _register_class (bool p_virtual = false , bool p_exposed = true , bool p_runtime = false );
123118
124119 template <typename T>
125- static GDExtensionObjectPtr _create_instance_func (void *data, GDExtensionBool p_notify_postinitialize) {
120+ static GDExtensionObjectPtr _create_instance_func (void *data /* , bool p_notify_postinitialize*/ ) {
126121 if constexpr (!std::is_abstract_v<T>) {
127122 Wrapped::_set_construct_info<T>();
128123 T *new_object = new (" " , " " ) T;
124+ /*
129125 if (p_notify_postinitialize) {
130126 new_object->_postinitialize();
131127 }
128+ */
132129 return new_object->_owner ;
133130 } else {
134131 return nullptr ;
@@ -198,13 +195,13 @@ class ClassDB {
198195 static void add_signal (const StringName &p_class, const MethodInfo &p_signal);
199196 static void bind_integer_constant (const StringName &p_class_name, const StringName &p_enum_name, const StringName &p_constant_name, GDExtensionInt p_constant_value, bool p_is_bitfield = false );
200197 // Binds an implementation of a virtual method defined in Godot.
201- static void bind_virtual_method (const StringName &p_class, const StringName &p_method, GDExtensionClassCallVirtual p_call, uint32_t p_hash );
198+ static void bind_virtual_method (const StringName &p_class, const StringName &p_method, GDExtensionClassCallVirtual p_call);
202199 // Add a new virtual method that can be implemented by scripts.
203200 static void add_virtual_method (const StringName &p_class, const MethodInfo &p_method, const Vector<StringName> &p_arg_names = Vector<StringName>());
204201
205202 static MethodBind *get_method (const StringName &p_class, const StringName &p_method);
206203
207- static GDExtensionClassCallVirtual get_virtual_func (void *p_userdata, GDExtensionConstStringNamePtr p_name, uint32_t p_hash );
204+ static GDExtensionClassCallVirtual get_virtual_func (void *p_userdata, GDExtensionConstStringNamePtr p_name);
208205 static const GDExtensionInstanceBindingCallbacks *get_instance_binding_callbacks (const StringName &p_class);
209206
210207 static void initialize (GDExtensionInitializationLevel p_level);
@@ -222,12 +219,12 @@ class ClassDB {
222219#define BIND_BITFIELD_FLAG (m_constant ) \
223220 ::godot::ClassDB::bind_integer_constant (get_class_static(), ::godot::_gde_constant_get_bitfield_name(m_constant, #m_constant), #m_constant, m_constant, true );
224221
225- #define BIND_VIRTUAL_METHOD (m_class, m_method, m_hash ) \
222+ #define BIND_VIRTUAL_METHOD (m_class, m_method ) \
226223 { \
227224 auto _call##m_method = [](GDExtensionObjectPtr p_instance, const GDExtensionConstTypePtr *p_args, GDExtensionTypePtr p_ret) -> void { \
228225 call_with_ptr_args (reinterpret_cast <m_class *>(p_instance), &m_class::m_method, p_args, p_ret); \
229226 }; \
230- ::godot::ClassDB::bind_virtual_method (m_class::get_class_static(), #m_method, _call##m_method, m_hash); \
227+ ::godot::ClassDB::bind_virtual_method (m_class::get_class_static(), #m_method, _call##m_method); \
231228 }
232229
233230template <typename T, bool is_abstract>
@@ -251,12 +248,11 @@ void ClassDB::_register_class(bool p_virtual, bool p_exposed, bool p_runtime) {
251248 class_register_order.push_back (cl.name );
252249
253250 // Register this class with Godot
254- GDExtensionClassCreationInfo4 class_info = {
251+ GDExtensionClassCreationInfo3 class_info = {
255252 p_virtual, // GDExtensionBool is_virtual;
256253 is_abstract, // GDExtensionBool is_abstract;
257254 p_exposed, // GDExtensionBool is_exposed;
258255 p_runtime, // GDExtensionBool is_runtime;
259- nullptr , // GDExtensionConstStringPtr icon_path;
260256 T::set_bind, // GDExtensionClassSet set_func;
261257 T::get_bind, // GDExtensionClassGet get_func;
262258 T::has_get_property_list () ? T::get_property_list_bind : nullptr , // GDExtensionClassGetPropertyList get_property_list_func;
@@ -274,10 +270,11 @@ void ClassDB::_register_class(bool p_virtual, bool p_exposed, bool p_runtime) {
274270 &ClassDB::get_virtual_func, // GDExtensionClassGetVirtual get_virtual_func;
275271 nullptr , // GDExtensionClassGetVirtualCallData get_virtual_call_data_func;
276272 nullptr , // GDExtensionClassCallVirtualWithData call_virtual_func;
273+ nullptr ,
277274 (void *)&T::get_class_static (), // void *class_userdata;
278275 };
279276
280- internal::gdextension_interface_classdb_register_extension_class4 (internal::library, cl.name ._native_ptr (), cl.parent_name ._native_ptr (), &class_info);
277+ internal::gdextension_interface_classdb_register_extension_class3 (internal::library, cl.name ._native_ptr (), cl.parent_name ._native_ptr (), &class_info);
281278
282279 // call bind_methods etc. to register all members of the class
283280 T::initialize_class ();
0 commit comments