diff options
author | Thomas Herzog <thomas.herzog@mail.com> | 2017-07-29 17:58:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-29 17:58:14 +0200 |
commit | fc611f4b4c8c8a5bd3ceab898863984ea24521d9 (patch) | |
tree | 5be86271b59586777818fd1456692f397cf3b1c5 /modules | |
parent | b276d92c8a63887df011032bc95d98bbb9c51c70 (diff) | |
parent | 3193460c4a76dcc51ef18231e7f778c3d122eaeb (diff) |
Merge pull request #9952 from endragor/pass-gdnative-library
Pass GDNativeLibrary pointer to library init
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdnative/gdnative.cpp | 3 | ||||
-rw-r--r-- | modules/gdnative/godot/gdnative.h | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp index e810c33f1c..158f7fd94d 100644 --- a/modules/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative.cpp @@ -185,6 +185,8 @@ void GDNative::_bind_methods() { } void GDNative::set_library(Ref<GDNativeLibrary> p_library) { + ERR_EXPLAIN("Tried to change library of GDNative when it is already set"); + ERR_FAIL_COND(library.is_valid()); library = p_library; } @@ -229,6 +231,7 @@ bool GDNative::initialize() { 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); + options.gd_native_library = (godot_object *)(get_library().ptr()); library_init_fpointer(&options); diff --git a/modules/gdnative/godot/gdnative.h b/modules/gdnative/godot/gdnative.h index 510bf36cd4..b0343272ef 100644 --- a/modules/gdnative/godot/gdnative.h +++ b/modules/gdnative/godot/gdnative.h @@ -265,6 +265,7 @@ typedef struct { uint64_t core_api_hash; uint64_t editor_api_hash; uint64_t no_api_hash; + godot_object *gd_native_library; // pointer to GDNativeLibrary that is being initialized } godot_gdnative_init_options; typedef struct { |