diff options
author | Thomas Herzog <thomas.herzog@mail.com> | 2017-10-24 19:28:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-24 19:28:06 +0200 |
commit | e72f4beec1b091edf6f16a0fe27d5ed13ca450c2 (patch) | |
tree | b6fdcdb52158c0343f161f15887f6319a53a4c1c /src/core/GodotGlobal.cpp | |
parent | f24ecfc74d2f60c597cef6d98e23accfb358a90e (diff) | |
parent | 6452ba6e884885b98884aad3bc38ba2560cddb19 (diff) | |
download | redot-cpp-e72f4beec1b091edf6f16a0fe27d5ed13ca450c2.tar.gz |
Merge pull request #47 from BastiaanOlij/add_api_struct
Implemented using api struct
Diffstat (limited to 'src/core/GodotGlobal.cpp')
-rw-r--r-- | src/core/GodotGlobal.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/GodotGlobal.cpp b/src/core/GodotGlobal.cpp index 823c2c1..dc21389 100644 --- a/src/core/GodotGlobal.cpp +++ b/src/core/GodotGlobal.cpp @@ -2,25 +2,24 @@ #include "String.hpp" -#include <gdnative/gdnative.h> - namespace godot { void *_RegisterState::nativescript_handle; +const godot_gdnative_api_struct *api = NULL; void Godot::print(const String& message) { - godot_print((godot_string *) &message); + godot::api->godot_print((godot_string *) &message); } void Godot::print_warning(const String& description, const String& function, const String& file, int line) { - godot_print_warning(description.c_string(), function.c_string(), file.c_string(), line); + godot::api->godot_print_warning(description.c_string(), function.c_string(), file.c_string(), line); } void Godot::print_error(const String& description, const String& function, const String& file, int line) { - godot_print_error(description.c_string(), function.c_string(), file.c_string(), line); + godot::api->godot_print_error(description.c_string(), function.c_string(), file.c_string(), line); } }; @@ -28,6 +27,7 @@ void Godot::print_error(const String& description, const String& function, const void gdnative_init(godot_gdnative_init_options *options); extern "C" void GDN_EXPORT godot_gdnative_init(godot_gdnative_init_options *options) { + godot::api = options->api_struct; gdnative_init(options); } |