diff options
Diffstat (limited to 'modules/dlscript')
-rw-r--r-- | modules/dlscript/godot.cpp | 9 | ||||
-rw-r--r-- | modules/dlscript/godot.h | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/modules/dlscript/godot.cpp b/modules/dlscript/godot.cpp index fccf3a29bd..484df553f3 100644 --- a/modules/dlscript/godot.cpp +++ b/modules/dlscript/godot.cpp @@ -181,14 +181,17 @@ void GDAPI *godot_dlinstance_get_userdata(godot_object *p_instance) { return NULL; } -void GDAPI godot_get_global_constants(godot_dictionary *p_constants) { - Dictionary *constants = (Dictionary *)p_constants; +godot_dictionary GDAPI godot_get_global_constants() { + godot_dictionary constants; + godot_dictionary_new(&constants); + Dictionary *p_constants = (Dictionary*)&constants; const int constants_count = GlobalConstants::get_global_constant_count(); for (int i = 0; i < constants_count; ++i) { const char *name = GlobalConstants::get_global_constant_name(i); int value = GlobalConstants::get_global_constant_value(i); - (*constants)[name] = value; + (*p_constants)[name] = value; } + return constants; } // System functions diff --git a/modules/dlscript/godot.h b/modules/dlscript/godot.h index 222cfdbee7..9bee0f127e 100644 --- a/modules/dlscript/godot.h +++ b/modules/dlscript/godot.h @@ -375,7 +375,7 @@ void GDAPI godot_script_register_signal(const char *p_name, const godot_signal * void GDAPI *godot_dlinstance_get_userdata(godot_object *p_instance); -void GDAPI godot_get_global_constants(godot_dictionary *constants); +godot_dictionary GDAPI godot_get_global_constants(); ////// System Functions |