From 7919ec6d8902bd4013d2aadf1f0a2b246c355445 Mon Sep 17 00:00:00 2001 From: Karroffel Date: Tue, 11 Apr 2017 01:29:33 +0200 Subject: [PATCH 1/2] [GDNative] re-enabled some init options --- modules/gdnative/gdnative.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp index f646060d49e..b543a486d32 100644 --- a/modules/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative.cpp @@ -77,11 +77,9 @@ Error NativeLibrary::initialize(NativeLibrary *&p_native_lib, const StringName p godot_native_init_options options; options.in_editor = SceneTree::get_singleton()->is_editor_hint(); - /* options.core_api_hash = ClassDB::get_api_hash(ClassDB::API_CORE); options.editor_api_hash = ClassDB::get_api_hash(ClassDB::API_EDITOR); options.no_api_hash = ClassDB::get_api_hash(ClassDB::API_NONE); - */ library_init_fpointer(&options); // Catch errors? From 544940c1752d3b3b567a21c8753a7089beea4156 Mon Sep 17 00:00:00 2001 From: Karroffel Date: Tue, 11 Apr 2017 01:45:50 +0200 Subject: [PATCH 2/2] [GDNative] C API and generator fixes --- modules/gdnative/api_generator.cpp | 1 + modules/gdnative/godot.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/gdnative/api_generator.cpp b/modules/gdnative/api_generator.cpp index 8569ae078e1..d5f22ee7a3a 100644 --- a/modules/gdnative/api_generator.cpp +++ b/modules/gdnative/api_generator.cpp @@ -402,6 +402,7 @@ static List generate_c_api_json(const List &p_api) { source.push_back("\t\t\t\t\t{\n"); source.push_back("\t\t\t\t\t\t\"name\": \"" + e->get().argument_names[i] + "\",\n"); source.push_back("\t\t\t\t\t\t\"type\": \"" + e->get().argument_types[i] + "\",\n"); + source.push_back(String("\t\t\t\t\t\t\"has_default_value\": ") + (e->get().default_arguments.has(i) ? "true" : "false") + ",\n"); source.push_back("\t\t\t\t\t\t\"default_value\": \"" + (e->get().default_arguments.has(i) ? (String)e->get().default_arguments[i] : "") + "\"\n"); source.push_back(String("\t\t\t\t\t}") + ((i < e->get().argument_names.size() - 1) ? "," : "") + "\n"); } diff --git a/modules/gdnative/godot.h b/modules/gdnative/godot.h index bba0a3f98d5..0d7aece23b4 100644 --- a/modules/gdnative/godot.h +++ b/modules/gdnative/godot.h @@ -317,7 +317,7 @@ typedef struct godot_instance_create_func { void *(*create_func)(godot_object *, void *); void *method_data; void (*free_func)(void *); -} godot_script_instance_func; +} godot_instance_create_func; typedef struct godot_instance_destroy_func { // instance pointer, method data, user data