diff options
| author | Emmanuel Leblond | 2017-04-08 17:16:58 +0200 |
|---|---|---|
| committer | Emmanuel Leblond | 2017-04-08 17:16:58 +0200 |
| commit | 68ae50ecc25c64c4834f2db062500ba5084763d9 (patch) | |
| tree | ce4e63d0665ecab67e0c23e7531f7fb028196cc7 /modules/dlscript/godot.cpp | |
| parent | efba539f93bc9800589c03d1538843afed56161e (diff) | |
| download | godot-68ae50ecc25c64c4834f2db062500ba5084763d9.tar.gz godot-68ae50ecc25c64c4834f2db062500ba5084763d9.tar.zst godot-68ae50ecc25c64c4834f2db062500ba5084763d9.zip | |
Diffstat (limited to 'modules/dlscript/godot.cpp')
| -rw-r--r-- | modules/dlscript/godot.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/dlscript/godot.cpp b/modules/dlscript/godot.cpp index 9a488ad61..0b7935a73 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); |
