diff options
author | Karroffel <therzog@mail.de> | 2017-04-04 19:38:46 +0200 |
---|---|---|
committer | Karroffel <therzog@mail.de> | 2017-04-04 23:02:46 +0200 |
commit | 6c49fe9c62b3401323a6497447679fdfded6f116 (patch) | |
tree | 8ba50859dedf9ef940d37ccd132234a20abb7818 /modules/dlscript/api_generator.cpp | |
parent | 46bc14e66fe90430f1d74cdab6cca6acb5b2a3f6 (diff) | |
download | redot-engine-6c49fe9c62b3401323a6497447679fdfded6f116.tar.gz |
[DLScript] added variant constructor and a function to get userdata of a script
The godot_dlinstance_get_userdata() function can be used to get the DLScript userdata pointer of any object that has a DLScript attached to it.
This is particularly useful and even required for language bindings to work properly.
This also fixes non-tool builds.
Diffstat (limited to 'modules/dlscript/api_generator.cpp')
-rw-r--r-- | modules/dlscript/api_generator.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/dlscript/api_generator.cpp b/modules/dlscript/api_generator.cpp index 2c2497b5b1..c5c5cb46e6 100644 --- a/modules/dlscript/api_generator.cpp +++ b/modules/dlscript/api_generator.cpp @@ -1,5 +1,7 @@ #include "api_generator.h" +#ifdef TOOLS_ENABLED + #include "class_db.h" #include "core/global_config.h" #include "os/file_access.h" @@ -368,15 +370,22 @@ static List<String> generate_c_api_json(const List<ClassAPI> &p_api) { // +#endif + /* * Saves the whole Godot API to a JSON file located at * p_path */ Error generate_c_api(const String &p_path) { +#ifndef TOOLS_ENABLED + return ERR_BUG; +#else + List<ClassAPI> api = generate_c_api_classes(); List<String> json_source = generate_c_api_json(api); return save_file(p_path, json_source); +#endif } |