diff options
Diffstat (limited to 'modules/gdnative/gdnative/variant.cpp')
-rw-r--r-- | modules/gdnative/gdnative/variant.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/modules/gdnative/gdnative/variant.cpp b/modules/gdnative/gdnative/variant.cpp index 423f3312e1..fd6babfc3a 100644 --- a/modules/gdnative/gdnative/variant.cpp +++ b/modules/gdnative/gdnative/variant.cpp @@ -489,6 +489,24 @@ void GDAPI godot_variant_destroy(godot_variant *p_self) { self->~Variant(); } +// GDNative core 1.1 + +godot_string GDAPI godot_variant_get_operator_name(godot_variant_operator p_op) { + Variant::Operator op = (Variant::Operator)p_op; + godot_string raw_dest; + String *dest = (String *)&raw_dest; + memnew_placement(dest, String(Variant::get_operator_name(op))); // operator = is overloaded by String + return raw_dest; +} + +void GDAPI godot_variant_evaluate(godot_variant_operator p_op, const godot_variant *p_a, const godot_variant *p_b, godot_variant *r_ret, godot_bool *r_valid) { + Variant::Operator op = (Variant::Operator)p_op; + const Variant *a = (const Variant *)p_a; + const Variant *b = (const Variant *)p_b; + Variant *ret = (Variant *)r_ret; + Variant::evaluate(op, a, b, *ret, *r_valid); +} + #ifdef __cplusplus } #endif |