diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-01-03 11:32:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-03 11:32:01 +0100 |
commit | 9d3424f61ddd1e6bec78381aa4a0c6acec53d290 (patch) | |
tree | e083361258651b2cef3d51129df131a19c11669c /core | |
parent | 529f710ec0540b9d3f61a6d75559f13af2f069d2 (diff) | |
parent | 3056c4bd5acc4b5eda71303bf349e0d4f94a89c8 (diff) |
Merge pull request #34688 from sheepandshepherd/gdnative_class_ptr
Expose is_class_ptr to GDNative for dynamic casts
Diffstat (limited to 'core')
-rw-r--r-- | core/class_db.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/class_db.h b/core/class_db.h index 490deb7873..01c4d341c6 100644 --- a/core/class_db.h +++ b/core/class_db.h @@ -114,6 +114,7 @@ public: APIType api; ClassInfo *inherits_ptr; + void *class_ptr; HashMap<StringName, MethodBind *> method_map; HashMap<StringName, int> constant_map; HashMap<StringName, List<StringName> > enum_map; @@ -177,6 +178,7 @@ public: ERR_FAIL_COND(!t); t->creation_func = &creator<T>; t->exposed = true; + t->class_ptr = T::get_class_ptr_static(); T::register_custom_data_to_otdb(); } @@ -188,6 +190,7 @@ public: ClassInfo *t = classes.getptr(T::get_class_static()); ERR_FAIL_COND(!t); t->exposed = true; + t->class_ptr = T::get_class_ptr_static(); //nothing } @@ -206,6 +209,7 @@ public: ERR_FAIL_COND(!t); t->creation_func = &_create_ptr_func<T>; t->exposed = true; + t->class_ptr = T::get_class_ptr_static(); T::register_custom_data_to_otdb(); } |