diff options
| author | David Snopek <dsnopek@gmail.com> | 2023-09-19 10:33:15 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-19 10:33:15 -0500 |
| commit | 0d6de7a80e328c1969c9feabaf268008764c6812 (patch) | |
| tree | 0ed4fc80f88118718326622540cf658906374ded /include/godot_cpp/classes | |
| parent | 73500966aef159076831efb6141a6b36e102d69e (diff) | |
| parent | 6f913563d88f6f3d51f50ed1f9432c909b621d5b (diff) | |
| download | redot-cpp-0d6de7a80e328c1969c9feabaf268008764c6812.tar.gz | |
Merge pull request #1164 from dsnopek/classdb-singleton-alternate
Add static methods to `ClassDB` for the methods bound to the `ClassDB` singleton
Diffstat (limited to 'include/godot_cpp/classes')
| -rw-r--r-- | include/godot_cpp/classes/wrapped.hpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/godot_cpp/classes/wrapped.hpp b/include/godot_cpp/classes/wrapped.hpp index c6e452c..91e29eb 100644 --- a/include/godot_cpp/classes/wrapped.hpp +++ b/include/godot_cpp/classes/wrapped.hpp @@ -326,7 +326,7 @@ public: }; // Don't use this for your classes, use GDCLASS() instead. -#define GDEXTENSION_CLASS(m_class, m_inherits) \ +#define GDEXTENSION_CLASS_ALIAS(m_class, m_alias_for, m_inherits) \ private: \ void operator=(const m_class &p_rval) {} \ \ @@ -378,7 +378,7 @@ public: static void initialize_class() {} \ \ static ::godot::StringName &get_class_static() { \ - static ::godot::StringName string_name = ::godot::StringName(#m_class); \ + static ::godot::StringName string_name = ::godot::StringName(#m_alias_for); \ return string_name; \ } \ \ @@ -403,6 +403,9 @@ public: _gde_binding_free_callback, \ _gde_binding_reference_callback, \ }; \ - m_class() : m_class(#m_class) {} + m_class() : m_class(#m_alias_for) {} + +// Don't use this for your classes, use GDCLASS() instead. +#define GDEXTENSION_CLASS(m_class, m_inherits) GDEXTENSION_CLASS_ALIAS(m_class, m_class, m_inherits) #endif // GODOT_WRAPPED_HPP |
