diff options
author | Karroffel <therzog@mail.de> | 2017-04-10 19:56:12 +0200 |
---|---|---|
committer | Karroffel <therzog@mail.de> | 2017-04-10 19:56:12 +0200 |
commit | cf45f3ab4bc7062702e3d94baf4e681861ab3e42 (patch) | |
tree | fcf04f99af9b3accf18190fddbf466e61fb14db6 /modules/gdnative/godot.cpp | |
parent | 61a27601f7e2b8136e5caa9666f4c8b16c4346f8 (diff) | |
download | redot-engine-cf45f3ab4bc7062702e3d94baf4e681861ab3e42.tar.gz |
[GDNative] function to get class constructor
Diffstat (limited to 'modules/gdnative/godot.cpp')
-rw-r--r-- | modules/gdnative/godot.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/gdnative/godot.cpp b/modules/gdnative/godot.cpp index 5ad716d0cd..7477a28db6 100644 --- a/modules/gdnative/godot.cpp +++ b/modules/gdnative/godot.cpp @@ -182,6 +182,13 @@ void GDAPI *godot_native_get_userdata(godot_object *p_instance) { return NULL; } +godot_class_constructor GDAPI godot_get_class_constructor(const char *p_classname) { + ClassDB::ClassInfo *class_info = ClassDB::classes.getptr(StringName(p_classname)); + if (class_info) + return (godot_class_constructor)class_info->creation_func; + return NULL; +} + godot_dictionary GDAPI godot_get_global_constants() { godot_dictionary constants; godot_dictionary_new(&constants); |