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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user