Further changes in GDNative API

- Added new_copy to all types, since trivial copy won't work for all
  types.
- Added functions to convert from String to char array types, which is
  not provided by the methods bound in Variant.
- Added operator index to String.
- Added missing cstring version of some Variant functions. They existed
  in the header but didn't have the implementation and were missing from
  the gdnative_api.json file.
- Added support for static calls on Variant types.
This commit is contained in:
George Marques
2021-02-25 19:50:56 -03:00
parent af0806722f
commit 8fddab9209
40 changed files with 880 additions and 11 deletions
+8
View File
@@ -43,10 +43,18 @@ void GDAPI godot_vector2_new(godot_vector2 *p_self) {
memnew_placement(p_self, Vector2);
}
void GDAPI godot_vector2_new_copy(godot_vector2 *r_dest, const godot_vector2 *p_src) {
memnew_placement(r_dest, Vector2(*(Vector2 *)p_src));
}
void GDAPI godot_vector2i_new(godot_vector2i *p_self) {
memnew_placement(p_self, Vector2i);
}
void GDAPI godot_vector2i_new_copy(godot_vector2i *r_dest, const godot_vector2i *p_src) {
memnew_placement(r_dest, Vector2i(*(Vector2i *)p_src));
}
godot_real_t GDAPI *godot_vector2_operator_index(godot_vector2 *p_self, godot_int p_index) {
Vector2 *self = (Vector2 *)p_self;
return (godot_real_t *)&self->operator[](p_index);