summaryrefslogtreecommitdiffstats
path: root/include/godot_cpp
diff options
context:
space:
mode:
authorKarroffel <therzog@mail.de>2017-04-06 05:05:53 +0200
committerKarroffel <therzog@mail.de>2017-04-06 05:05:53 +0200
commit617057c7047a87565a1308baac7889754bd93708 (patch)
tree94fa57b2c7c3ed19cdebd932724e6afef96e4b2d /include/godot_cpp
parent5e3b01f0f136819b5628d4edec847eac2a4374a5 (diff)
downloadredot-cpp-617057c7047a87565a1308baac7889754bd93708.tar.gz
support for script inheritance
Diffstat (limited to 'include/godot_cpp')
-rw-r--r--include/godot_cpp/Godot.hpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/godot_cpp/Godot.hpp b/include/godot_cpp/Godot.hpp
index ad8fdfd..5ee42e6 100644
--- a/include/godot_cpp/Godot.hpp
+++ b/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: