made script "inheritance" less OOP

This commit is contained in:
Karroffel
2017-05-13 13:55:04 +02:00
parent cf30b0f39d
commit fad8f7c9eb
6 changed files with 84 additions and 9 deletions

24
src/core/GodotGlobal.cpp Normal file
View File

@@ -0,0 +1,24 @@
#include "GodotGlobal.hpp"
#include "String.hpp"
#include <godot.h>
namespace godot {
void Godot::print(const String& message)
{
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);
}
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);
}
};

View File

@@ -399,7 +399,7 @@ Variant::Type Variant::get_type() const
Variant Variant::call(const String& method, const Variant **args, const int arg_count)
{
Variant v;
*(godot_variant *) &v = godot_variant_call(&_godot_variant, (godot_string *) &method, (const godot_variant **)args, arg_count);
*(godot_variant *) &v = godot_variant_call(&_godot_variant, (godot_string *) &method, (const godot_variant **)args, arg_count, nullptr);
return v;
}