summaryrefslogtreecommitdiffstats
path: root/include/godot_cpp
diff options
context:
space:
mode:
authorDavid Snopek <dsnopek@gmail.com>2023-07-06 21:16:27 -0500
committerDavid Snopek <dsnopek@gmail.com>2023-07-31 16:04:27 -0500
commit6f913563d88f6f3d51f50ed1f9432c909b621d5b (patch)
treeff2b6b18b4a83593ff838192dbaf6a492319441d /include/godot_cpp
parentc5d8447861fad7e5c812008420c3ec0ca7531590 (diff)
downloadredot-cpp-6f913563d88f6f3d51f50ed1f9432c909b621d5b.tar.gz
Add static methods to `ClassDB` for the methods bound to the `ClassDB` singleton
Diffstat (limited to 'include/godot_cpp')
-rw-r--r--include/godot_cpp/classes/wrapped.hpp9
-rw-r--r--include/godot_cpp/core/class_db.hpp4
2 files changed, 10 insertions, 3 deletions
diff --git a/include/godot_cpp/classes/wrapped.hpp b/include/godot_cpp/classes/wrapped.hpp
index f2efbd0..d297945 100644
--- a/include/godot_cpp/classes/wrapped.hpp
+++ b/include/godot_cpp/classes/wrapped.hpp
@@ -305,7 +305,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) {} \
\
@@ -353,7 +353,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; \
} \
\
@@ -378,6 +378,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
diff --git a/include/godot_cpp/core/class_db.hpp b/include/godot_cpp/core/class_db.hpp
index 0802a45..35fb053 100644
--- a/include/godot_cpp/core/class_db.hpp
+++ b/include/godot_cpp/core/class_db.hpp
@@ -38,6 +38,8 @@
#include <godot_cpp/core/method_bind.hpp>
#include <godot_cpp/core/object.hpp>
+#include <godot_cpp/classes/class_db_singleton.hpp>
+
#include <list>
#include <set>
#include <string>
@@ -137,6 +139,8 @@ public:
static void initialize(GDExtensionInitializationLevel p_level);
static void deinitialize(GDExtensionInitializationLevel p_level);
+
+ CLASSDB_SINGLETON_FORWARD_METHODS;
};
#define BIND_CONSTANT(m_constant) \