Implemented using api struct
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user