diff options
-rw-r--r-- | modules/dlscript/godot.cpp | 11 | ||||
-rw-r--r-- | modules/dlscript/godot.h | 2 |
2 files changed, 13 insertions, 0 deletions
diff --git a/modules/dlscript/godot.cpp b/modules/dlscript/godot.cpp index 9a488ad612..0b7935a735 100644 --- a/modules/dlscript/godot.cpp +++ b/modules/dlscript/godot.cpp @@ -31,6 +31,7 @@ #include "class_db.h" #include "dl_script.h" #include "global_config.h" +#include "global_constants.h" #include "variant.h" #ifdef __cplusplus @@ -180,6 +181,16 @@ 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; + const int constants_cont = GlobalConstants::get_global_constant_count(); + for (int i = 0; i < constants_cont; ++i) { + const char *name = GlobalConstants::get_global_constant_name(i); + int value = GlobalConstants::get_global_constant_value(i); + (*constants)[name] = value; + } +} + // System functions void GDAPI *godot_alloc(int p_bytes) { return memalloc(p_bytes); diff --git a/modules/dlscript/godot.h b/modules/dlscript/godot.h index 75f1f47ed1..222cfdbee7 100644 --- a/modules/dlscript/godot.h +++ b/modules/dlscript/godot.h @@ -375,6 +375,8 @@ 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); + ////// System Functions //using these will help Godot track how much memory is in use in debug mode |