1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-13 13:31:48 +00:00

[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.
This commit is contained in:
Karroffel
2017-04-04 19:38:46 +02:00
parent 46bc14e66f
commit 6c49fe9c62
6 changed files with 43 additions and 10 deletions

View File

@@ -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
}