diff options
author | Bastiaan Olij <mux213@gmail.com> | 2019-09-14 11:08:11 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-14 11:08:11 +1000 |
commit | d0a4ddfd9fcae91b75f456e57a229e9f0bc372fc (patch) | |
tree | 1076f9cdda83adf1fa654d37a38eecfe053a2424 /src/core | |
parent | c2ec46f64a24de9a46b06c3e987c306f549ccadb (diff) | |
parent | fc1fe720c35d2669750079e7523b5436a01582a9 (diff) | |
download | redot-cpp-d0a4ddfd9fcae91b75f456e57a229e9f0bc372fc.tar.gz |
Merge pull request #321 from BastiaanOlij/add_new_structs
Store all main entry points to the currently available APIs
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/GodotGlobal.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/core/GodotGlobal.cpp b/src/core/GodotGlobal.cpp index e01b282..31be6c8 100644 --- a/src/core/GodotGlobal.cpp +++ b/src/core/GodotGlobal.cpp @@ -27,9 +27,16 @@ 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_core_1_2_api_struct *core_1_2_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; +const godot_gdnative_ext_pluginscript_api_struct *pluginscript_api = nullptr; +const godot_gdnative_ext_android_api_struct *android_api = nullptr; +const godot_gdnative_ext_arvr_api_struct *arvr_api = nullptr; +const godot_gdnative_ext_videodecoder_api_struct *videodecoder_api = nullptr; +const godot_gdnative_ext_net_api_struct *net_api = nullptr; +const godot_gdnative_ext_net_3_2_api_struct *net_3_2_api = nullptr; const void *gdnlib = NULL; @@ -81,6 +88,8 @@ void Godot::gdnative_init(godot_gdnative_init_options *options) { 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; + } else if (core_extension->version.major == 1 && core_extension->version.minor == 2) { + godot::core_1_2_api = (const godot_gdnative_core_1_2_api_struct *)core_extension; } core_extension = core_extension->next; } @@ -101,6 +110,32 @@ void Godot::gdnative_init(godot_gdnative_init_options *options) { extension = extension->next; } } break; + case GDNATIVE_EXT_PLUGINSCRIPT: { + godot::pluginscript_api = (const godot_gdnative_ext_pluginscript_api_struct *)godot::api->extensions[i]; + } break; + case GDNATIVE_EXT_ANDROID: { + godot::android_api = (const godot_gdnative_ext_android_api_struct *)godot::api->extensions[i]; + } break; + case GDNATIVE_EXT_ARVR: { + godot::arvr_api = (const godot_gdnative_ext_arvr_api_struct *)godot::api->extensions[i]; + } break; + case GDNATIVE_EXT_VIDEODECODER: { + godot::videodecoder_api = (const godot_gdnative_ext_videodecoder_api_struct *)godot::api->extensions[i]; + } break; + case GDNATIVE_EXT_NET: { + godot::net_api = (const godot_gdnative_ext_net_api_struct *)godot::api->extensions[i]; + + const godot_gdnative_api_struct *extension = godot::net_api->next; + + while (extension) { + if (extension->version.major == 3 && extension->version.minor == 2) { + godot::net_3_2_api = (const godot_gdnative_ext_net_3_2_api_struct *)extension; + } + + extension = extension->next; + } + } break; + default: break; } } |