From c11c951871b50edfef5ebd7d034e2ea0975b4b9a Mon Sep 17 00:00:00 2001 From: Emmanuel Leblond Date: Mon, 2 Oct 2017 13:25:53 +0200 Subject: [PATCH 1/2] [GDnative] Add binding to GDNativeLibrary::get_active_library_path --- modules/gdnative/gdnative.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp index 11856e4ffb..4882c1014b 100644 --- a/modules/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative.cpp @@ -110,6 +110,7 @@ GDNativeLibrary::~GDNativeLibrary() { void GDNativeLibrary::_bind_methods() { ClassDB::bind_method(D_METHOD("set_library_path", "platform", "path"), &GDNativeLibrary::set_library_path); ClassDB::bind_method(D_METHOD("get_library_path", "platform"), &GDNativeLibrary::get_library_path); + ClassDB::bind_method(D_METHOD("get_active_library_path"), &GDNativeLibrary::get_active_library_path); ClassDB::bind_method(D_METHOD("is_singleton_gdnative"), &GDNativeLibrary::is_singleton_gdnative); ClassDB::bind_method(D_METHOD("set_singleton_gdnative", "singleton"), &GDNativeLibrary::set_singleton_gdnative); From c55b8217ab9f4bce35a8053cf2e548469b821bca Mon Sep 17 00:00:00 2001 From: Emmanuel Leblond Date: Mon, 2 Oct 2017 13:45:47 +0200 Subject: [PATCH 2/2] [GDnative] Add active_library_path to init options struct --- modules/gdnative/gdnative.cpp | 1 + modules/gdnative/include/gdnative/gdnative.h | 1 + 2 files changed, 2 insertions(+) diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp index 4882c1014b..f0c09a3370 100644 --- a/modules/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative.cpp @@ -269,6 +269,7 @@ bool GDNative::initialize() { options.editor_api_hash = ClassDB::get_api_hash(ClassDB::API_EDITOR); options.no_api_hash = ClassDB::get_api_hash(ClassDB::API_NONE); options.gd_native_library = (godot_object *)(get_library().ptr()); + options.active_library_path = (godot_string *)&path; library_init_fpointer(&options); diff --git a/modules/gdnative/include/gdnative/gdnative.h b/modules/gdnative/include/gdnative/gdnative.h index 19dd030637..9134f1c581 100644 --- a/modules/gdnative/include/gdnative/gdnative.h +++ b/modules/gdnative/include/gdnative/gdnative.h @@ -243,6 +243,7 @@ typedef struct { uint64_t no_api_hash; godot_object *gd_native_library; // pointer to GDNativeLibrary that is being initialized const struct godot_gdnative_api_struct *api_struct; + const godot_string *active_library_path; } godot_gdnative_init_options; typedef struct {