Browse Source

support for script inheritance

Karroffel 8 years ago
parent
commit
617057c704
1 changed files with 6 additions and 3 deletions
  1. 6 3
      include/godot_cpp/Godot.hpp

+ 6 - 3
include/godot_cpp/Godot.hpp

@@ -32,9 +32,12 @@ namespace godot {
 	Base *self; \
 	inline Name(godot_object *o) { self = (Base *) o; } \
 	private:
-        // inline Name(Object o) { this = (Name *) godot_dlinstance_get_userdata(o.__core_object);\
-        //         memcpy(this, p, sizeof(Name)); } \
-        // inline Name(const Variant& obj) { __core_object = ((Object) obj).__core_object; } \
+
+#define GODOT_SUBCLASS(Name, Base) \
+	public: inline static char *___get_type_name() { return (char *) #Name; } \
+	inline static char *___get_base_type_name() { return (char *) #Base; } \
+	inline Name(godot_object *o) : Base(o) {} \
+	private: