diff options
Diffstat (limited to 'src/core/GodotGlobal.cpp')
-rw-r--r-- | src/core/GodotGlobal.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/core/GodotGlobal.cpp b/src/core/GodotGlobal.cpp index ba984a8..3e00f19 100644 --- a/src/core/GodotGlobal.cpp +++ b/src/core/GodotGlobal.cpp @@ -24,7 +24,10 @@ namespace godot { void *_RegisterState::nativescript_handle; int _RegisterState::language_index; + const godot_gdnative_core_api_struct *api = nullptr; +const godot_gdnative_core_1_1_api_struct *core_1_1_api = nullptr; + const godot_gdnative_ext_nativescript_api_struct *nativescript_api = nullptr; const godot_gdnative_ext_nativescript_1_1_api_struct *nativescript_1_1_api = nullptr; @@ -72,6 +75,15 @@ void Godot::gdnative_init(godot_gdnative_init_options *options) { godot::api = options->api_struct; godot::gdnlib = options->gd_native_library; + const godot_gdnative_api_struct *core_extension = godot::api->next; + + while (core_extension) { + if (core_extension->version.major == 1 && core_extension->version.minor == 1) { + godot::core_1_1_api = (const godot_gdnative_core_1_1_api_struct *)core_extension; + } + core_extension = core_extension->next; + } + // now find our extensions for (int i = 0; i < godot::api->num_extensions; i++) { switch (godot::api->extensions[i]->type) { |