diff options
| author | Rémi Verschelde <remi@verschelde.fr> | 2022-01-06 17:44:29 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-06 17:44:29 +0100 |
| commit | cfd3fa97d1178850e4ad7c2a49fea1b6594d964b (patch) | |
| tree | c7808ccb1958206fab47f8eeda415f85ab83c5e6 /include/godot_cpp | |
| parent | c5fd3d00d2c8cd56841a42597ccffbef281bd4d3 (diff) | |
| parent | adbbf1a3a1359f2617c06bfb5f757e163bc3b529 (diff) | |
| download | redot-cpp-cfd3fa97d1178850e4ad7c2a49fea1b6594d964b.tar.gz | |
Merge pull request #668 from groud/fix_extension_instance_set
Diffstat (limited to 'include/godot_cpp')
| -rw-r--r-- | include/godot_cpp/classes/wrapped.hpp | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/include/godot_cpp/classes/wrapped.hpp b/include/godot_cpp/classes/wrapped.hpp index 80a9ef1..5c9b74d 100644 --- a/include/godot_cpp/classes/wrapped.hpp +++ b/include/godot_cpp/classes/wrapped.hpp @@ -45,7 +45,7 @@ class Wrapped { friend void postinitialize_handler(Wrapped *); protected: - virtual const char *_get_class() const = 0; // This is needed to retrieve the class name before the godot object has its _extension and _extension_instance members assigned. + virtual const char *_get_extension_class() const; // This is needed to retrieve the class name before the godot object has its _extension and _extension_instance members assigned. virtual const GDNativeInstanceBindingCallbacks *_get_bindings_callbacks() const = 0; void _postinitialize(); @@ -60,26 +60,13 @@ public: } // namespace godot -#ifdef DEBUG_ENABLED -#define CHECK_CLASS_CONSTRUCTOR(m_constructor, m_class) \ - if (unlikely(!m_constructor)) { \ - ERR_PRINT_ONCE("Constructor for class " #m_class "not found. Likely wasn't registered in ClassDB."); \ - return nullptr; \ - } else \ - ((void)0) -#else -#define CHECK_CLASS_CONSTRUCTOR(m_constructor, m_class) -#endif - #define GDCLASS(m_class, m_inherits) \ private: \ void operator=(const m_class &p_rval) {} \ friend class ClassDB; \ \ - using SelfType = m_class; \ - \ protected: \ - virtual const char *_get_class() const override { \ + virtual const char *_get_extension_class() const override { \ return get_class_static(); \ } \ \ @@ -151,10 +138,6 @@ private: void operator=(const m_class &p_rval) {} \ \ protected: \ - virtual const char *_get_class() const override { \ - return get_class_static(); \ - } \ - \ virtual const GDNativeInstanceBindingCallbacks *_get_bindings_callbacks() const override { \ return &___binding_callbacks; \ } \ |
