GDNative add new core types.
This commit is contained in:
parent
0187cdae9a
commit
74eecd1d6b
19 changed files with 2778 additions and 244 deletions
|
|
@ -102,9 +102,9 @@ void GDAPI godot_array_new_packed_string_array(godot_array *r_dest, const godot_
|
|||
}
|
||||
}
|
||||
|
||||
void GDAPI godot_array_new_packed_real_array(godot_array *r_dest, const godot_packed_real_array *p_pra) {
|
||||
void GDAPI godot_array_new_packed_float32_array(godot_array *r_dest, const godot_packed_float32_array *p_pra) {
|
||||
Array *dest = (Array *)r_dest;
|
||||
Vector<godot_real> *pca = (Vector<godot_real> *)p_pra;
|
||||
Vector<float> *pca = (Vector<float> *)p_pra;
|
||||
memnew_placement(dest, Array);
|
||||
dest->resize(pca->size());
|
||||
|
||||
|
|
@ -114,9 +114,33 @@ void GDAPI godot_array_new_packed_real_array(godot_array *r_dest, const godot_pa
|
|||
}
|
||||
}
|
||||
|
||||
void GDAPI godot_array_new_packed_int_array(godot_array *r_dest, const godot_packed_int_array *p_pia) {
|
||||
void GDAPI godot_array_new_packed_float64_array(godot_array *r_dest, const godot_packed_float64_array *p_pra) {
|
||||
Array *dest = (Array *)r_dest;
|
||||
Vector<godot_int> *pca = (Vector<godot_int> *)p_pia;
|
||||
Vector<double> *pca = (Vector<double> *)p_pra;
|
||||
memnew_placement(dest, Array);
|
||||
dest->resize(pca->size());
|
||||
|
||||
for (int i = 0; i < dest->size(); i++) {
|
||||
Variant v = pca->operator[](i);
|
||||
dest->operator[](i) = v;
|
||||
}
|
||||
}
|
||||
|
||||
void GDAPI godot_array_new_packed_int32_array(godot_array *r_dest, const godot_packed_int32_array *p_pia) {
|
||||
Array *dest = (Array *)r_dest;
|
||||
Vector<int32_t> *pca = (Vector<int32_t> *)p_pia;
|
||||
memnew_placement(dest, Array);
|
||||
dest->resize(pca->size());
|
||||
|
||||
for (int i = 0; i < dest->size(); i++) {
|
||||
Variant v = pca->operator[](i);
|
||||
dest->operator[](i) = v;
|
||||
}
|
||||
}
|
||||
|
||||
void GDAPI godot_array_new_packed_int64_array(godot_array *r_dest, const godot_packed_int64_array *p_pia) {
|
||||
Array *dest = (Array *)r_dest;
|
||||
Vector<int64_t> *pca = (Vector<int64_t> *)p_pia;
|
||||
memnew_placement(dest, Array);
|
||||
dest->resize(pca->size());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue