Browse Source

Fix GDCLASS when inherited class is in another namespace

Marc Gilleron 3 years ago
parent
commit
6fdcb18f6a
1 changed files with 6 additions and 2 deletions
  1. 6 2
      include/godot_cpp/classes/wrapped.hpp

+ 6 - 2
include/godot_cpp/classes/wrapped.hpp

@@ -54,6 +54,10 @@ protected:
 	Wrapped(GodotObject *p_godot_object);
 	Wrapped(GodotObject *p_godot_object);
 
 
 public:
 public:
+	static const char *get_class_static() {
+		return "Wrapped";
+	}
+
 	// Must be public but you should not touch this.
 	// Must be public but you should not touch this.
 	GodotObject *_owner = nullptr;
 	GodotObject *_owner = nullptr;
 };
 };
@@ -102,7 +106,7 @@ public:
 	}                                                                                                              \
 	}                                                                                                              \
                                                                                                                    \
                                                                                                                    \
 	static const char *get_parent_class_static() {                                                                 \
 	static const char *get_parent_class_static() {                                                                 \
-		return #m_inherits;                                                                                        \
+		return m_inherits::get_class_static();                                                                     \
 	}                                                                                                              \
 	}                                                                                                              \
                                                                                                                    \
                                                                                                                    \
 	static GDNativeObjectPtr create(void *data) {                                                                  \
 	static GDNativeObjectPtr create(void *data) {                                                                  \
@@ -157,7 +161,7 @@ public:
 	}                                                                                                              \
 	}                                                                                                              \
                                                                                                                    \
                                                                                                                    \
 	static const char *get_parent_class_static() {                                                                 \
 	static const char *get_parent_class_static() {                                                                 \
-		return #m_inherits;                                                                                        \
+		return m_inherits::get_class_static();                                                                     \
 	}                                                                                                              \
 	}                                                                                                              \
                                                                                                                    \
                                                                                                                    \
 	static void *___binding_create_callback(void *p_token, void *p_instance) {                                     \
 	static void *___binding_create_callback(void *p_token, void *p_instance) {                                     \