GDNative: New core API
This API now uses the discovery functions present in Variant instead of wrapping every built-in function. Users now need to query for function pointers and use those.
This commit is contained in:
parent
d39f6386ce
commit
030d1d6a17
|
@ -31,195 +31,15 @@
|
|||
#include "gdnative/aabb.h"
|
||||
|
||||
#include "core/math/aabb.h"
|
||||
#include "core/variant/variant.h"
|
||||
|
||||
static_assert(sizeof(godot_aabb) == sizeof(AABB), "AABB size mismatch");
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
static_assert(sizeof(godot_aabb) == sizeof(AABB), "AABB size mismatch");
|
||||
|
||||
void GDAPI godot_aabb_new(godot_aabb *r_dest, const godot_vector3 *p_pos, const godot_vector3 *p_size) {
|
||||
const Vector3 *pos = (const Vector3 *)p_pos;
|
||||
const Vector3 *size = (const Vector3 *)p_size;
|
||||
AABB *dest = (AABB *)r_dest;
|
||||
*dest = AABB(*pos, *size);
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_aabb_get_position(const godot_aabb *p_self) {
|
||||
godot_vector3 raw_ret;
|
||||
const AABB *self = (const AABB *)p_self;
|
||||
Vector3 *ret = (Vector3 *)&raw_ret;
|
||||
*ret = self->position;
|
||||
return raw_ret;
|
||||
}
|
||||
|
||||
void GDAPI godot_aabb_set_position(const godot_aabb *p_self, const godot_vector3 *p_v) {
|
||||
AABB *self = (AABB *)p_self;
|
||||
const Vector3 *v = (const Vector3 *)p_v;
|
||||
self->position = *v;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_aabb_get_size(const godot_aabb *p_self) {
|
||||
godot_vector3 raw_ret;
|
||||
const AABB *self = (const AABB *)p_self;
|
||||
Vector3 *ret = (Vector3 *)&raw_ret;
|
||||
*ret = self->size;
|
||||
return raw_ret;
|
||||
}
|
||||
|
||||
void GDAPI godot_aabb_set_size(const godot_aabb *p_self, const godot_vector3 *p_v) {
|
||||
AABB *self = (AABB *)p_self;
|
||||
const Vector3 *v = (const Vector3 *)p_v;
|
||||
self->size = *v;
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_aabb_as_string(const godot_aabb *p_self) {
|
||||
godot_string ret;
|
||||
const AABB *self = (const AABB *)p_self;
|
||||
memnew_placement(&ret, String(*self));
|
||||
return ret;
|
||||
}
|
||||
|
||||
godot_aabb GDAPI godot_aabb_abs(const godot_aabb *p_self) {
|
||||
godot_aabb dest;
|
||||
const AABB *self = (const AABB *)p_self;
|
||||
*((AABB *)&dest) = self->abs();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_aabb_get_area(const godot_aabb *p_self) {
|
||||
const AABB *self = (const AABB *)p_self;
|
||||
return self->get_area();
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_aabb_has_no_area(const godot_aabb *p_self) {
|
||||
const AABB *self = (const AABB *)p_self;
|
||||
return self->has_no_area();
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_aabb_has_no_surface(const godot_aabb *p_self) {
|
||||
const AABB *self = (const AABB *)p_self;
|
||||
return self->has_no_surface();
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_aabb_intersects(const godot_aabb *p_self, const godot_aabb *p_with) {
|
||||
const AABB *self = (const AABB *)p_self;
|
||||
const AABB *with = (const AABB *)p_with;
|
||||
return self->intersects(*with);
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_aabb_encloses(const godot_aabb *p_self, const godot_aabb *p_with) {
|
||||
const AABB *self = (const AABB *)p_self;
|
||||
const AABB *with = (const AABB *)p_with;
|
||||
return self->encloses(*with);
|
||||
}
|
||||
|
||||
godot_aabb GDAPI godot_aabb_merge(const godot_aabb *p_self, const godot_aabb *p_with) {
|
||||
godot_aabb dest;
|
||||
const AABB *self = (const AABB *)p_self;
|
||||
const AABB *with = (const AABB *)p_with;
|
||||
*((AABB *)&dest) = self->merge(*with);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_aabb GDAPI godot_aabb_intersection(const godot_aabb *p_self, const godot_aabb *p_with) {
|
||||
godot_aabb dest;
|
||||
const AABB *self = (const AABB *)p_self;
|
||||
const AABB *with = (const AABB *)p_with;
|
||||
*((AABB *)&dest) = self->intersection(*with);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_aabb_intersects_plane(const godot_aabb *p_self, const godot_plane *p_plane) {
|
||||
const AABB *self = (const AABB *)p_self;
|
||||
const Plane *plane = (const Plane *)p_plane;
|
||||
return self->intersects_plane(*plane);
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_aabb_intersects_segment(const godot_aabb *p_self, const godot_vector3 *p_from, const godot_vector3 *p_to) {
|
||||
const AABB *self = (const AABB *)p_self;
|
||||
const Vector3 *from = (const Vector3 *)p_from;
|
||||
const Vector3 *to = (const Vector3 *)p_to;
|
||||
return self->intersects_segment(*from, *to);
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_aabb_has_point(const godot_aabb *p_self, const godot_vector3 *p_point) {
|
||||
const AABB *self = (const AABB *)p_self;
|
||||
const Vector3 *point = (const Vector3 *)p_point;
|
||||
return self->has_point(*point);
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_aabb_get_support(const godot_aabb *p_self, const godot_vector3 *p_dir) {
|
||||
godot_vector3 dest;
|
||||
const AABB *self = (const AABB *)p_self;
|
||||
const Vector3 *dir = (const Vector3 *)p_dir;
|
||||
*((Vector3 *)&dest) = self->get_support(*dir);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_aabb_get_longest_axis(const godot_aabb *p_self) {
|
||||
godot_vector3 dest;
|
||||
const AABB *self = (const AABB *)p_self;
|
||||
*((Vector3 *)&dest) = self->get_longest_axis();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_aabb_get_longest_axis_index(const godot_aabb *p_self) {
|
||||
const AABB *self = (const AABB *)p_self;
|
||||
return self->get_longest_axis_index();
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_aabb_get_longest_axis_size(const godot_aabb *p_self) {
|
||||
const AABB *self = (const AABB *)p_self;
|
||||
return self->get_longest_axis_size();
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_aabb_get_shortest_axis(const godot_aabb *p_self) {
|
||||
godot_vector3 dest;
|
||||
const AABB *self = (const AABB *)p_self;
|
||||
*((Vector3 *)&dest) = self->get_shortest_axis();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_aabb_get_shortest_axis_index(const godot_aabb *p_self) {
|
||||
const AABB *self = (const AABB *)p_self;
|
||||
return self->get_shortest_axis_index();
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_aabb_get_shortest_axis_size(const godot_aabb *p_self) {
|
||||
const AABB *self = (const AABB *)p_self;
|
||||
return self->get_shortest_axis_size();
|
||||
}
|
||||
|
||||
godot_aabb GDAPI godot_aabb_expand(const godot_aabb *p_self, const godot_vector3 *p_to_point) {
|
||||
godot_aabb dest;
|
||||
const AABB *self = (const AABB *)p_self;
|
||||
const Vector3 *to_point = (const Vector3 *)p_to_point;
|
||||
*((AABB *)&dest) = self->expand(*to_point);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_aabb GDAPI godot_aabb_grow(const godot_aabb *p_self, const godot_real p_by) {
|
||||
godot_aabb dest;
|
||||
const AABB *self = (const AABB *)p_self;
|
||||
|
||||
*((AABB *)&dest) = self->grow(p_by);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_aabb_get_endpoint(const godot_aabb *p_self, const godot_int p_idx) {
|
||||
godot_vector3 dest;
|
||||
const AABB *self = (const AABB *)p_self;
|
||||
|
||||
*((Vector3 *)&dest) = self->get_endpoint(p_idx);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_aabb_operator_equal(const godot_aabb *p_self, const godot_aabb *p_b) {
|
||||
const AABB *self = (const AABB *)p_self;
|
||||
const AABB *b = (const AABB *)p_b;
|
||||
return *self == *b;
|
||||
void GDAPI godot_aabb_new(godot_aabb *p_self) {
|
||||
memnew_placement(p_self, AABB);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -33,369 +33,20 @@
|
|||
#include "core/os/memory.h"
|
||||
#include "core/variant/array.h"
|
||||
|
||||
#include "core/math/color.h"
|
||||
|
||||
#include "core/variant/variant.h"
|
||||
static_assert(sizeof(godot_array) == sizeof(Array), "Array size mismatch");
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
static_assert(sizeof(godot_array) == sizeof(Array), "Array size mismatch");
|
||||
|
||||
void GDAPI godot_array_new(godot_array *r_dest) {
|
||||
Array *dest = (Array *)r_dest;
|
||||
memnew_placement(dest, Array);
|
||||
}
|
||||
|
||||
void GDAPI godot_array_new_copy(godot_array *r_dest, const godot_array *p_src) {
|
||||
Array *dest = (Array *)r_dest;
|
||||
const Array *src = (const Array *)p_src;
|
||||
memnew_placement(dest, Array(*src));
|
||||
}
|
||||
|
||||
void GDAPI godot_array_new_packed_color_array(godot_array *r_dest, const godot_packed_color_array *p_pca) {
|
||||
Array *dest = (Array *)r_dest;
|
||||
Vector<Color> *pca = (Vector<Color> *)p_pca;
|
||||
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_vector3_array(godot_array *r_dest, const godot_packed_vector3_array *p_pv3a) {
|
||||
Array *dest = (Array *)r_dest;
|
||||
Vector<Vector3> *pca = (Vector<Vector3> *)p_pv3a;
|
||||
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_vector2_array(godot_array *r_dest, const godot_packed_vector2_array *p_pv2a) {
|
||||
Array *dest = (Array *)r_dest;
|
||||
Vector<Vector2> *pca = (Vector<Vector2> *)p_pv2a;
|
||||
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_vector2i_array(godot_array *r_dest, const godot_packed_vector2i_array *p_pv2a) {
|
||||
Array *dest = (Array *)r_dest;
|
||||
Vector<Vector2i> *pca = (Vector<Vector2i> *)p_pv2a;
|
||||
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_string_array(godot_array *r_dest, const godot_packed_string_array *p_psa) {
|
||||
Array *dest = (Array *)r_dest;
|
||||
Vector<String> *pca = (Vector<String> *)p_psa;
|
||||
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_float32_array(godot_array *r_dest, const godot_packed_float32_array *p_pra) {
|
||||
Array *dest = (Array *)r_dest;
|
||||
Vector<float> *pca = (Vector<float> *)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_float64_array(godot_array *r_dest, const godot_packed_float64_array *p_pra) {
|
||||
Array *dest = (Array *)r_dest;
|
||||
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());
|
||||
|
||||
for (int i = 0; i < dest->size(); i++) {
|
||||
Variant v = pca->operator[](i);
|
||||
dest->operator[](i) = v;
|
||||
}
|
||||
}
|
||||
|
||||
void GDAPI godot_array_new_packed_byte_array(godot_array *r_dest, const godot_packed_byte_array *p_pba) {
|
||||
Array *dest = (Array *)r_dest;
|
||||
Vector<uint8_t> *pca = (Vector<uint8_t> *)p_pba;
|
||||
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_set(godot_array *p_self, const godot_int p_idx, const godot_variant *p_value) {
|
||||
Array *self = (Array *)p_self;
|
||||
Variant *val = (Variant *)p_value;
|
||||
self->operator[](p_idx) = *val;
|
||||
}
|
||||
|
||||
godot_variant GDAPI godot_array_get(const godot_array *p_self, const godot_int p_idx) {
|
||||
godot_variant raw_dest;
|
||||
Variant *dest = (Variant *)&raw_dest;
|
||||
const Array *self = (const Array *)p_self;
|
||||
memnew_placement(dest, Variant(self->operator[](p_idx)));
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_variant GDAPI *godot_array_operator_index(godot_array *p_self, const godot_int p_idx) {
|
||||
Array *self = (Array *)p_self;
|
||||
return (godot_variant *)&self->operator[](p_idx);
|
||||
}
|
||||
|
||||
const godot_variant GDAPI *godot_array_operator_index_const(const godot_array *p_self, const godot_int p_idx) {
|
||||
const Array *self = (const Array *)p_self;
|
||||
return (const godot_variant *)&self->operator[](p_idx);
|
||||
}
|
||||
|
||||
void GDAPI godot_array_append(godot_array *p_self, const godot_variant *p_value) {
|
||||
Array *self = (Array *)p_self;
|
||||
Variant *val = (Variant *)p_value;
|
||||
self->append(*val);
|
||||
}
|
||||
|
||||
void GDAPI godot_array_clear(godot_array *p_self) {
|
||||
Array *self = (Array *)p_self;
|
||||
self->clear();
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_array_count(const godot_array *p_self, const godot_variant *p_value) {
|
||||
const Array *self = (const Array *)p_self;
|
||||
const Variant *val = (const Variant *)p_value;
|
||||
return self->count(*val);
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_array_is_empty(const godot_array *p_self) {
|
||||
const Array *self = (const Array *)p_self;
|
||||
return self->is_empty();
|
||||
}
|
||||
|
||||
void GDAPI godot_array_erase(godot_array *p_self, const godot_variant *p_value) {
|
||||
Array *self = (Array *)p_self;
|
||||
const Variant *val = (const Variant *)p_value;
|
||||
self->erase(*val);
|
||||
}
|
||||
|
||||
godot_variant GDAPI godot_array_front(const godot_array *p_self) {
|
||||
const Array *self = (const Array *)p_self;
|
||||
godot_variant v;
|
||||
Variant *val = (Variant *)&v;
|
||||
memnew_placement(val, Variant);
|
||||
*val = self->front();
|
||||
return v;
|
||||
}
|
||||
|
||||
godot_variant GDAPI godot_array_back(const godot_array *p_self) {
|
||||
const Array *self = (const Array *)p_self;
|
||||
godot_variant v;
|
||||
Variant *val = (Variant *)&v;
|
||||
memnew_placement(val, Variant);
|
||||
*val = self->back();
|
||||
return v;
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_array_find(const godot_array *p_self, const godot_variant *p_what, const godot_int p_from) {
|
||||
const Array *self = (const Array *)p_self;
|
||||
const Variant *val = (const Variant *)p_what;
|
||||
return self->find(*val, p_from);
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_array_find_last(const godot_array *p_self, const godot_variant *p_what) {
|
||||
const Array *self = (const Array *)p_self;
|
||||
const Variant *val = (const Variant *)p_what;
|
||||
return self->find_last(*val);
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_array_has(const godot_array *p_self, const godot_variant *p_value) {
|
||||
const Array *self = (const Array *)p_self;
|
||||
const Variant *val = (const Variant *)p_value;
|
||||
return self->has(*val);
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_array_hash(const godot_array *p_self) {
|
||||
const Array *self = (const Array *)p_self;
|
||||
return self->hash();
|
||||
}
|
||||
|
||||
void GDAPI godot_array_insert(godot_array *p_self, const godot_int p_pos, const godot_variant *p_value) {
|
||||
Array *self = (Array *)p_self;
|
||||
const Variant *val = (const Variant *)p_value;
|
||||
self->insert(p_pos, *val);
|
||||
}
|
||||
|
||||
void GDAPI godot_array_invert(godot_array *p_self) {
|
||||
Array *self = (Array *)p_self;
|
||||
self->invert();
|
||||
}
|
||||
|
||||
godot_variant GDAPI godot_array_pop_back(godot_array *p_self) {
|
||||
Array *self = (Array *)p_self;
|
||||
godot_variant v;
|
||||
Variant *val = (Variant *)&v;
|
||||
memnew_placement(val, Variant);
|
||||
*val = self->pop_back();
|
||||
return v;
|
||||
}
|
||||
|
||||
godot_variant GDAPI godot_array_pop_front(godot_array *p_self) {
|
||||
Array *self = (Array *)p_self;
|
||||
godot_variant v;
|
||||
Variant *val = (Variant *)&v;
|
||||
memnew_placement(val, Variant);
|
||||
*val = self->pop_front();
|
||||
return v;
|
||||
}
|
||||
|
||||
void GDAPI godot_array_push_back(godot_array *p_self, const godot_variant *p_value) {
|
||||
Array *self = (Array *)p_self;
|
||||
const Variant *val = (const Variant *)p_value;
|
||||
self->push_back(*val);
|
||||
}
|
||||
|
||||
void GDAPI godot_array_push_front(godot_array *p_self, const godot_variant *p_value) {
|
||||
Array *self = (Array *)p_self;
|
||||
const Variant *val = (const Variant *)p_value;
|
||||
self->push_front(*val);
|
||||
}
|
||||
|
||||
void GDAPI godot_array_remove(godot_array *p_self, const godot_int p_idx) {
|
||||
Array *self = (Array *)p_self;
|
||||
self->remove(p_idx);
|
||||
}
|
||||
|
||||
void GDAPI godot_array_resize(godot_array *p_self, const godot_int p_size) {
|
||||
Array *self = (Array *)p_self;
|
||||
self->resize(p_size);
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_array_rfind(const godot_array *p_self, const godot_variant *p_what, const godot_int p_from) {
|
||||
const Array *self = (const Array *)p_self;
|
||||
const Variant *val = (const Variant *)p_what;
|
||||
return self->rfind(*val, p_from);
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_array_size(const godot_array *p_self) {
|
||||
const Array *self = (const Array *)p_self;
|
||||
return self->size();
|
||||
}
|
||||
|
||||
void GDAPI godot_array_sort(godot_array *p_self) {
|
||||
Array *self = (Array *)p_self;
|
||||
self->sort();
|
||||
}
|
||||
|
||||
void GDAPI godot_array_sort_custom(godot_array *p_self, godot_object *p_obj, const godot_string *p_func) {
|
||||
Array *self = (Array *)p_self;
|
||||
const String *func = (const String *)p_func;
|
||||
self->sort_custom((Object *)p_obj, *func);
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_array_bsearch(godot_array *p_self, const godot_variant *p_value, const godot_bool p_before) {
|
||||
Array *self = (Array *)p_self;
|
||||
return self->bsearch(*(const Variant *)p_value, p_before);
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_array_bsearch_custom(godot_array *p_self, const godot_variant *p_value, godot_object *p_obj, const godot_string *p_func, const godot_bool p_before) {
|
||||
Array *self = (Array *)p_self;
|
||||
const String *func = (const String *)p_func;
|
||||
return self->bsearch_custom(*(const Variant *)p_value, (Object *)p_obj, *func, p_before);
|
||||
void GDAPI godot_array_new(godot_array *p_self) {
|
||||
memnew_placement(p_self, Array);
|
||||
}
|
||||
|
||||
void GDAPI godot_array_destroy(godot_array *p_self) {
|
||||
((Array *)p_self)->~Array();
|
||||
}
|
||||
|
||||
godot_array GDAPI godot_array_duplicate(const godot_array *p_self, const godot_bool p_deep) {
|
||||
const Array *self = (const Array *)p_self;
|
||||
godot_array res;
|
||||
Array *val = (Array *)&res;
|
||||
memnew_placement(val, Array);
|
||||
*val = self->duplicate(p_deep);
|
||||
return res;
|
||||
}
|
||||
|
||||
godot_array GDAPI godot_array_slice(const godot_array *p_self, const godot_int p_begin, const godot_int p_end, const godot_int p_step, const godot_bool p_deep) {
|
||||
const Array *self = (const Array *)p_self;
|
||||
godot_array res;
|
||||
Array *val = (Array *)&res;
|
||||
memnew_placement(val, Array);
|
||||
*val = self->slice(p_begin, p_end, p_step, p_deep);
|
||||
return res;
|
||||
}
|
||||
|
||||
godot_variant GDAPI godot_array_max(const godot_array *p_self) {
|
||||
const Array *self = (const Array *)p_self;
|
||||
godot_variant v;
|
||||
Variant *val = (Variant *)&v;
|
||||
memnew_placement(val, Variant);
|
||||
*val = self->max();
|
||||
return v;
|
||||
}
|
||||
|
||||
godot_variant GDAPI godot_array_min(const godot_array *p_self) {
|
||||
const Array *self = (const Array *)p_self;
|
||||
godot_variant v;
|
||||
Variant *val = (Variant *)&v;
|
||||
memnew_placement(val, Variant);
|
||||
*val = self->min();
|
||||
return v;
|
||||
}
|
||||
|
||||
void GDAPI godot_array_shuffle(godot_array *p_self) {
|
||||
Array *self = (Array *)p_self;
|
||||
self->shuffle();
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -31,266 +31,15 @@
|
|||
#include "gdnative/basis.h"
|
||||
|
||||
#include "core/math/basis.h"
|
||||
#include "core/variant/variant.h"
|
||||
|
||||
static_assert(sizeof(godot_basis) == sizeof(Basis), "Basis size mismatch");
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
static_assert(sizeof(godot_basis) == sizeof(Basis), "Basis size mismatch");
|
||||
|
||||
void GDAPI godot_basis_new_with_rows(godot_basis *r_dest, const godot_vector3 *p_x_axis, const godot_vector3 *p_y_axis, const godot_vector3 *p_z_axis) {
|
||||
const Vector3 *x_axis = (const Vector3 *)p_x_axis;
|
||||
const Vector3 *y_axis = (const Vector3 *)p_y_axis;
|
||||
const Vector3 *z_axis = (const Vector3 *)p_z_axis;
|
||||
Basis *dest = (Basis *)r_dest;
|
||||
*dest = Basis(*x_axis, *y_axis, *z_axis);
|
||||
}
|
||||
|
||||
void GDAPI godot_basis_new_with_axis_and_angle(godot_basis *r_dest, const godot_vector3 *p_axis, const godot_real p_phi) {
|
||||
const Vector3 *axis = (const Vector3 *)p_axis;
|
||||
Basis *dest = (Basis *)r_dest;
|
||||
*dest = Basis(*axis, p_phi);
|
||||
}
|
||||
|
||||
void GDAPI godot_basis_new_with_euler(godot_basis *r_dest, const godot_vector3 *p_euler) {
|
||||
const Vector3 *euler = (const Vector3 *)p_euler;
|
||||
Basis *dest = (Basis *)r_dest;
|
||||
*dest = Basis(*euler);
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_basis_as_string(const godot_basis *p_self) {
|
||||
godot_string ret;
|
||||
const Basis *self = (const Basis *)p_self;
|
||||
memnew_placement(&ret, String(*self));
|
||||
return ret;
|
||||
}
|
||||
|
||||
godot_basis GDAPI godot_basis_inverse(const godot_basis *p_self) {
|
||||
godot_basis dest;
|
||||
const Basis *self = (const Basis *)p_self;
|
||||
*((Basis *)&dest) = self->inverse();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_basis GDAPI godot_basis_transposed(const godot_basis *p_self) {
|
||||
godot_basis dest;
|
||||
const Basis *self = (const Basis *)p_self;
|
||||
*((Basis *)&dest) = self->transposed();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_basis GDAPI godot_basis_orthonormalized(const godot_basis *p_self) {
|
||||
godot_basis dest;
|
||||
const Basis *self = (const Basis *)p_self;
|
||||
*((Basis *)&dest) = self->orthonormalized();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_basis_determinant(const godot_basis *p_self) {
|
||||
const Basis *self = (const Basis *)p_self;
|
||||
return self->determinant();
|
||||
}
|
||||
|
||||
godot_basis GDAPI godot_basis_rotated(const godot_basis *p_self, const godot_vector3 *p_axis, const godot_real p_phi) {
|
||||
godot_basis dest;
|
||||
const Basis *self = (const Basis *)p_self;
|
||||
const Vector3 *axis = (const Vector3 *)p_axis;
|
||||
*((Basis *)&dest) = self->rotated(*axis, p_phi);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_basis GDAPI godot_basis_scaled(const godot_basis *p_self, const godot_vector3 *p_scale) {
|
||||
godot_basis dest;
|
||||
const Basis *self = (const Basis *)p_self;
|
||||
const Vector3 *scale = (const Vector3 *)p_scale;
|
||||
*((Basis *)&dest) = self->scaled(*scale);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_basis_get_scale(const godot_basis *p_self) {
|
||||
godot_vector3 dest;
|
||||
const Basis *self = (const Basis *)p_self;
|
||||
*((Vector3 *)&dest) = self->get_scale();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_quat GDAPI godot_basis_get_quat(const godot_basis *p_self) {
|
||||
godot_quat dest;
|
||||
const Basis *self = (const Basis *)p_self;
|
||||
*((Quat *)&dest) = self->get_quat();
|
||||
return dest;
|
||||
}
|
||||
|
||||
void GDAPI godot_basis_set_quat(godot_basis *p_self, const godot_quat *p_quat) {
|
||||
Basis *self = (Basis *)p_self;
|
||||
const Quat *quat = (const Quat *)p_quat;
|
||||
self->set_quat(*quat);
|
||||
}
|
||||
|
||||
void GDAPI godot_basis_set_axis_angle_scale(godot_basis *p_self, const godot_vector3 *p_axis, godot_real p_phi, const godot_vector3 *p_scale) {
|
||||
Basis *self = (Basis *)p_self;
|
||||
const Vector3 *axis = (const Vector3 *)p_axis;
|
||||
const Vector3 *scale = (const Vector3 *)p_scale;
|
||||
self->set_axis_angle_scale(*axis, p_phi, *scale);
|
||||
}
|
||||
|
||||
void GDAPI godot_basis_set_euler_scale(godot_basis *p_self, const godot_vector3 *p_euler, const godot_vector3 *p_scale) {
|
||||
Basis *self = (Basis *)p_self;
|
||||
const Vector3 *euler = (const Vector3 *)p_euler;
|
||||
const Vector3 *scale = (const Vector3 *)p_scale;
|
||||
self->set_euler_scale(*euler, *scale);
|
||||
}
|
||||
|
||||
void GDAPI godot_basis_set_quat_scale(godot_basis *p_self, const godot_quat *p_quat, const godot_vector3 *p_scale) {
|
||||
Basis *self = (Basis *)p_self;
|
||||
const Quat *quat = (const Quat *)p_quat;
|
||||
const Vector3 *scale = (const Vector3 *)p_scale;
|
||||
self->set_quat_scale(*quat, *scale);
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_basis_get_euler(const godot_basis *p_self) {
|
||||
godot_vector3 dest;
|
||||
const Basis *self = (const Basis *)p_self;
|
||||
*((Vector3 *)&dest) = self->get_euler();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_basis_tdotx(const godot_basis *p_self, const godot_vector3 *p_with) {
|
||||
const Basis *self = (const Basis *)p_self;
|
||||
const Vector3 *with = (const Vector3 *)p_with;
|
||||
return self->tdotx(*with);
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_basis_tdoty(const godot_basis *p_self, const godot_vector3 *p_with) {
|
||||
const Basis *self = (const Basis *)p_self;
|
||||
const Vector3 *with = (const Vector3 *)p_with;
|
||||
return self->tdoty(*with);
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_basis_tdotz(const godot_basis *p_self, const godot_vector3 *p_with) {
|
||||
const Basis *self = (const Basis *)p_self;
|
||||
const Vector3 *with = (const Vector3 *)p_with;
|
||||
return self->tdotz(*with);
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_basis_xform(const godot_basis *p_self, const godot_vector3 *p_v) {
|
||||
godot_vector3 dest;
|
||||
const Basis *self = (const Basis *)p_self;
|
||||
const Vector3 *v = (const Vector3 *)p_v;
|
||||
*((Vector3 *)&dest) = self->xform(*v);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_basis_xform_inv(const godot_basis *p_self, const godot_vector3 *p_v) {
|
||||
godot_vector3 dest;
|
||||
const Basis *self = (const Basis *)p_self;
|
||||
const Vector3 *v = (const Vector3 *)p_v;
|
||||
*((Vector3 *)&dest) = self->xform_inv(*v);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_basis_get_orthogonal_index(const godot_basis *p_self) {
|
||||
const Basis *self = (const Basis *)p_self;
|
||||
return self->get_orthogonal_index();
|
||||
}
|
||||
|
||||
void GDAPI godot_basis_new(godot_basis *r_dest) {
|
||||
Basis *dest = (Basis *)r_dest;
|
||||
*dest = Basis();
|
||||
}
|
||||
|
||||
void GDAPI godot_basis_new_with_euler_quat(godot_basis *r_dest, const godot_quat *p_euler) {
|
||||
Basis *dest = (Basis *)r_dest;
|
||||
const Quat *euler = (const Quat *)p_euler;
|
||||
*dest = Basis(*euler);
|
||||
}
|
||||
|
||||
// p_elements is a pointer to an array of 3 (!!) vector3
|
||||
void GDAPI godot_basis_get_elements(const godot_basis *p_self, godot_vector3 *p_elements) {
|
||||
const Basis *self = (const Basis *)p_self;
|
||||
Vector3 *elements = (Vector3 *)p_elements;
|
||||
elements[0] = self->elements[0];
|
||||
elements[1] = self->elements[1];
|
||||
elements[2] = self->elements[2];
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_basis_get_axis(const godot_basis *p_self, const godot_int p_axis) {
|
||||
godot_vector3 dest;
|
||||
Vector3 *d = (Vector3 *)&dest;
|
||||
const Basis *self = (const Basis *)p_self;
|
||||
*d = self->get_axis(p_axis);
|
||||
return dest;
|
||||
}
|
||||
|
||||
void GDAPI godot_basis_set_axis(godot_basis *p_self, const godot_int p_axis, const godot_vector3 *p_value) {
|
||||
Basis *self = (Basis *)p_self;
|
||||
const Vector3 *value = (const Vector3 *)p_value;
|
||||
self->set_axis(p_axis, *value);
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_basis_get_row(const godot_basis *p_self, const godot_int p_row) {
|
||||
godot_vector3 dest;
|
||||
Vector3 *d = (Vector3 *)&dest;
|
||||
const Basis *self = (const Basis *)p_self;
|
||||
*d = self->get_row(p_row);
|
||||
return dest;
|
||||
}
|
||||
|
||||
void GDAPI godot_basis_set_row(godot_basis *p_self, const godot_int p_row, const godot_vector3 *p_value) {
|
||||
Basis *self = (Basis *)p_self;
|
||||
const Vector3 *value = (const Vector3 *)p_value;
|
||||
self->set_row(p_row, *value);
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_basis_operator_equal(const godot_basis *p_self, const godot_basis *p_b) {
|
||||
const Basis *self = (const Basis *)p_self;
|
||||
const Basis *b = (const Basis *)p_b;
|
||||
return *self == *b;
|
||||
}
|
||||
|
||||
godot_basis GDAPI godot_basis_operator_add(const godot_basis *p_self, const godot_basis *p_b) {
|
||||
godot_basis raw_dest;
|
||||
Basis *dest = (Basis *)&raw_dest;
|
||||
const Basis *self = (const Basis *)p_self;
|
||||
const Basis *b = (const Basis *)p_b;
|
||||
*dest = *self + *b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_basis GDAPI godot_basis_operator_subtract(const godot_basis *p_self, const godot_basis *p_b) {
|
||||
godot_basis raw_dest;
|
||||
Basis *dest = (Basis *)&raw_dest;
|
||||
const Basis *self = (const Basis *)p_self;
|
||||
const Basis *b = (const Basis *)p_b;
|
||||
*dest = *self - *b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_basis GDAPI godot_basis_operator_multiply_vector(const godot_basis *p_self, const godot_basis *p_b) {
|
||||
godot_basis raw_dest;
|
||||
Basis *dest = (Basis *)&raw_dest;
|
||||
const Basis *self = (const Basis *)p_self;
|
||||
const Basis *b = (const Basis *)p_b;
|
||||
*dest = *self * *b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_basis GDAPI godot_basis_operator_multiply_scalar(const godot_basis *p_self, const godot_real p_b) {
|
||||
godot_basis raw_dest;
|
||||
Basis *dest = (Basis *)&raw_dest;
|
||||
const Basis *self = (const Basis *)p_self;
|
||||
*dest = *self * p_b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_basis GDAPI godot_basis_slerp(const godot_basis *p_self, const godot_basis *p_b, const godot_real p_t) {
|
||||
godot_basis raw_dest;
|
||||
Basis *dest = (Basis *)&raw_dest;
|
||||
const Basis *self = (const Basis *)p_self;
|
||||
const Basis *b = (const Basis *)p_b;
|
||||
*dest = self->slerp(*b, p_t);
|
||||
return raw_dest;
|
||||
void GDAPI godot_basis_new(godot_basis *p_self) {
|
||||
memnew_placement(p_self, Basis);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -30,36 +30,17 @@
|
|||
|
||||
#include "gdnative/callable.h"
|
||||
|
||||
#include "core/io/resource.h"
|
||||
#include "core/variant/callable.h"
|
||||
#include "core/variant/variant.h"
|
||||
|
||||
static_assert(sizeof(godot_callable) == sizeof(Callable), "Callable size mismatch");
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
static_assert(sizeof(godot_callable) == sizeof(Callable), "Callable size mismatch");
|
||||
static_assert(sizeof(godot_signal) == sizeof(Signal), "Signal size mismatch");
|
||||
|
||||
// Callable
|
||||
|
||||
void GDAPI godot_callable_new_with_object(godot_callable *r_dest, const godot_object *p_object, const godot_string_name *p_method) {
|
||||
Callable *dest = (Callable *)r_dest;
|
||||
const Object *object = (const Object *)p_object;
|
||||
const StringName *method = (const StringName *)p_method;
|
||||
memnew_placement(dest, Callable(object, *method));
|
||||
}
|
||||
|
||||
void GDAPI godot_callable_new_with_object_id(godot_callable *r_dest, uint64_t p_objectid, const godot_string_name *p_method) {
|
||||
Callable *dest = (Callable *)r_dest;
|
||||
const StringName *method = (const StringName *)p_method;
|
||||
memnew_placement(dest, Callable(ObjectID(p_objectid), *method));
|
||||
}
|
||||
|
||||
void GDAPI godot_callable_new_copy(godot_callable *r_dest, const godot_callable *p_src) {
|
||||
Callable *dest = (Callable *)r_dest;
|
||||
const Callable *src = (const Callable *)p_src;
|
||||
memnew_placement(dest, Callable(*src));
|
||||
void GDAPI godot_callable_new(godot_callable *p_self) {
|
||||
memnew_placement(p_self, Callable);
|
||||
}
|
||||
|
||||
void GDAPI godot_callable_destroy(godot_callable *p_self) {
|
||||
|
@ -67,186 +48,6 @@ void GDAPI godot_callable_destroy(godot_callable *p_self) {
|
|||
self->~Callable();
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_callable_call(const godot_callable *p_self, const godot_variant **p_arguments, godot_int p_argcount, godot_variant *r_return_value) {
|
||||
const Callable *self = (const Callable *)p_self;
|
||||
const Variant **arguments = (const Variant **)p_arguments;
|
||||
Variant *return_value = (Variant *)r_return_value;
|
||||
Variant ret;
|
||||
Callable::CallError err;
|
||||
self->call(arguments, p_argcount, ret, err);
|
||||
if (return_value)
|
||||
(*return_value) = ret;
|
||||
return (godot_int)err.error;
|
||||
}
|
||||
|
||||
void GDAPI godot_callable_call_deferred(const godot_callable *p_self, const godot_variant **p_arguments, godot_int p_argcount) {
|
||||
const Callable *self = (const Callable *)p_self;
|
||||
const Variant **arguments = (const Variant **)p_arguments;
|
||||
self->call_deferred(arguments, p_argcount);
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_callable_is_null(const godot_callable *p_self) {
|
||||
const Callable *self = (const Callable *)p_self;
|
||||
return self->is_null();
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_callable_is_custom(const godot_callable *p_self) {
|
||||
const Callable *self = (const Callable *)p_self;
|
||||
return self->is_custom();
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_callable_is_standard(const godot_callable *p_self) {
|
||||
const Callable *self = (const Callable *)p_self;
|
||||
return self->is_standard();
|
||||
}
|
||||
|
||||
godot_object GDAPI *godot_callable_get_object(const godot_callable *p_self) {
|
||||
const Callable *self = (const Callable *)p_self;
|
||||
return (godot_object *)self->get_object();
|
||||
}
|
||||
|
||||
uint64_t GDAPI godot_callable_get_object_id(const godot_callable *p_self) {
|
||||
const Callable *self = (const Callable *)p_self;
|
||||
return (uint64_t)self->get_object_id();
|
||||
}
|
||||
|
||||
godot_string_name GDAPI godot_callable_get_method(const godot_callable *p_self) {
|
||||
godot_string_name raw_dest;
|
||||
const Callable *self = (const Callable *)p_self;
|
||||
StringName *dest = (StringName *)&raw_dest;
|
||||
memnew_placement(dest, StringName(self->get_method()));
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
uint32_t GDAPI godot_callable_hash(const godot_callable *p_self) {
|
||||
const Callable *self = (const Callable *)p_self;
|
||||
return self->hash();
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_callable_as_string(const godot_callable *p_self) {
|
||||
godot_string ret;
|
||||
const Callable *self = (const Callable *)p_self;
|
||||
memnew_placement(&ret, String(*self));
|
||||
return ret;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_callable_operator_equal(const godot_callable *p_self, const godot_callable *p_other) {
|
||||
const Callable *self = (const Callable *)p_self;
|
||||
const Callable *other = (const Callable *)p_other;
|
||||
return *self == *other;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_callable_operator_less(const godot_callable *p_self, const godot_callable *p_other) {
|
||||
const Callable *self = (const Callable *)p_self;
|
||||
const Callable *other = (const Callable *)p_other;
|
||||
return *self < *other;
|
||||
}
|
||||
|
||||
// Signal
|
||||
|
||||
void GDAPI godot_signal_new_with_object(godot_signal *r_dest, const godot_object *p_object, const godot_string_name *p_name) {
|
||||
Signal *dest = (Signal *)r_dest;
|
||||
const Object *object = (const Object *)p_object;
|
||||
const StringName *name = (const StringName *)p_name;
|
||||
memnew_placement(dest, Signal(object, *name));
|
||||
}
|
||||
|
||||
void GDAPI godot_signal_new_with_object_id(godot_signal *r_dest, uint64_t p_objectid, const godot_string_name *p_name) {
|
||||
Signal *dest = (Signal *)r_dest;
|
||||
const StringName *name = (const StringName *)p_name;
|
||||
memnew_placement(dest, Signal(ObjectID(p_objectid), *name));
|
||||
}
|
||||
|
||||
void GDAPI godot_signal_new_copy(godot_signal *r_dest, const godot_signal *p_src) {
|
||||
Signal *dest = (Signal *)r_dest;
|
||||
const Signal *src = (const Signal *)p_src;
|
||||
memnew_placement(dest, Signal(*src));
|
||||
}
|
||||
|
||||
void GDAPI godot_signal_destroy(godot_signal *p_self) {
|
||||
Signal *self = (Signal *)p_self;
|
||||
self->~Signal();
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_signal_emit(const godot_signal *p_self, const godot_variant **p_arguments, godot_int p_argcount) {
|
||||
const Signal *self = (const Signal *)p_self;
|
||||
const Variant **arguments = (const Variant **)p_arguments;
|
||||
return (godot_int)self->emit(arguments, p_argcount);
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_signal_connect(godot_signal *p_self, const godot_callable *p_callable, const godot_array *p_binds, uint32_t p_flags) {
|
||||
Signal *self = (Signal *)p_self;
|
||||
const Callable *callable = (const Callable *)p_callable;
|
||||
const Array *binds_ar = (const Array *)p_binds;
|
||||
Vector<Variant> binds;
|
||||
for (int i = 0; i < binds_ar->size(); i++) {
|
||||
binds.push_back(binds_ar->get(i));
|
||||
}
|
||||
return (godot_int)self->connect(*callable, binds, p_flags);
|
||||
}
|
||||
|
||||
void GDAPI godot_signal_disconnect(godot_signal *p_self, const godot_callable *p_callable) {
|
||||
Signal *self = (Signal *)p_self;
|
||||
const Callable *callable = (const Callable *)p_callable;
|
||||
self->disconnect(*callable);
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_signal_is_null(const godot_signal *p_self) {
|
||||
const Signal *self = (const Signal *)p_self;
|
||||
return self->is_null();
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_signal_is_connected(const godot_signal *p_self, const godot_callable *p_callable) {
|
||||
const Signal *self = (const Signal *)p_self;
|
||||
const Callable *callable = (const Callable *)p_callable;
|
||||
return self->is_connected(*callable);
|
||||
}
|
||||
|
||||
godot_array GDAPI godot_signal_get_connections(const godot_signal *p_self) {
|
||||
godot_array raw_dest;
|
||||
const Signal *self = (const Signal *)p_self;
|
||||
Array *dest = (Array *)&raw_dest;
|
||||
memnew_placement(dest, Array(self->get_connections()));
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_object GDAPI *godot_signal_get_object(const godot_signal *p_self) {
|
||||
const Signal *self = (const Signal *)p_self;
|
||||
return (godot_object *)self->get_object();
|
||||
}
|
||||
|
||||
uint64_t GDAPI godot_signal_get_object_id(const godot_signal *p_self) {
|
||||
const Signal *self = (const Signal *)p_self;
|
||||
return (uint64_t)self->get_object_id();
|
||||
}
|
||||
|
||||
godot_string_name GDAPI godot_signal_get_name(const godot_signal *p_self) {
|
||||
godot_string_name raw_dest;
|
||||
const Signal *self = (const Signal *)p_self;
|
||||
StringName *dest = (StringName *)&raw_dest;
|
||||
memnew_placement(dest, StringName(self->get_name()));
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_signal_as_string(const godot_signal *p_self) {
|
||||
godot_string ret;
|
||||
const Signal *self = (const Signal *)p_self;
|
||||
memnew_placement(&ret, String(*self));
|
||||
return ret;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_signal_operator_equal(const godot_signal *p_self, const godot_signal *p_other) {
|
||||
const Signal *self = (const Signal *)p_self;
|
||||
const Signal *other = (const Signal *)p_other;
|
||||
return *self == *other;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_signal_operator_less(const godot_signal *p_self, const godot_signal *p_other) {
|
||||
const Signal *self = (const Signal *)p_self;
|
||||
const Signal *other = (const Signal *)p_other;
|
||||
return *self < *other;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -31,178 +31,15 @@
|
|||
#include "gdnative/color.h"
|
||||
|
||||
#include "core/math/color.h"
|
||||
#include "core/variant/variant.h"
|
||||
|
||||
static_assert(sizeof(godot_color) == sizeof(Color), "Color size mismatch");
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
static_assert(sizeof(godot_color) == sizeof(Color), "Color size mismatch");
|
||||
|
||||
void GDAPI godot_color_new_rgba(godot_color *r_dest, const godot_real p_r, const godot_real p_g, const godot_real p_b, const godot_real p_a) {
|
||||
Color *dest = (Color *)r_dest;
|
||||
*dest = Color(p_r, p_g, p_b, p_a);
|
||||
}
|
||||
|
||||
void GDAPI godot_color_new_rgb(godot_color *r_dest, const godot_real p_r, const godot_real p_g, const godot_real p_b) {
|
||||
Color *dest = (Color *)r_dest;
|
||||
*dest = Color(p_r, p_g, p_b);
|
||||
}
|
||||
|
||||
godot_real godot_color_get_r(const godot_color *p_self) {
|
||||
const Color *self = (const Color *)p_self;
|
||||
return self->r;
|
||||
}
|
||||
|
||||
void godot_color_set_r(godot_color *p_self, const godot_real val) {
|
||||
Color *self = (Color *)p_self;
|
||||
self->r = val;
|
||||
}
|
||||
|
||||
godot_real godot_color_get_g(const godot_color *p_self) {
|
||||
const Color *self = (const Color *)p_self;
|
||||
return self->g;
|
||||
}
|
||||
|
||||
void godot_color_set_g(godot_color *p_self, const godot_real val) {
|
||||
Color *self = (Color *)p_self;
|
||||
self->g = val;
|
||||
}
|
||||
|
||||
godot_real godot_color_get_b(const godot_color *p_self) {
|
||||
const Color *self = (const Color *)p_self;
|
||||
return self->b;
|
||||
}
|
||||
|
||||
void godot_color_set_b(godot_color *p_self, const godot_real val) {
|
||||
Color *self = (Color *)p_self;
|
||||
self->b = val;
|
||||
}
|
||||
|
||||
godot_real godot_color_get_a(const godot_color *p_self) {
|
||||
const Color *self = (const Color *)p_self;
|
||||
return self->a;
|
||||
}
|
||||
|
||||
void godot_color_set_a(godot_color *p_self, const godot_real val) {
|
||||
Color *self = (Color *)p_self;
|
||||
self->a = val;
|
||||
}
|
||||
|
||||
godot_real godot_color_get_h(const godot_color *p_self) {
|
||||
const Color *self = (const Color *)p_self;
|
||||
return self->get_h();
|
||||
}
|
||||
|
||||
godot_real godot_color_get_s(const godot_color *p_self) {
|
||||
const Color *self = (const Color *)p_self;
|
||||
return self->get_s();
|
||||
}
|
||||
|
||||
godot_real godot_color_get_v(const godot_color *p_self) {
|
||||
const Color *self = (const Color *)p_self;
|
||||
return self->get_v();
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_color_as_string(const godot_color *p_self) {
|
||||
godot_string ret;
|
||||
const Color *self = (const Color *)p_self;
|
||||
memnew_placement(&ret, String(*self));
|
||||
return ret;
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_color_to_rgba32(const godot_color *p_self) {
|
||||
const Color *self = (const Color *)p_self;
|
||||
return self->to_rgba32();
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_color_to_abgr32(const godot_color *p_self) {
|
||||
const Color *self = (const Color *)p_self;
|
||||
return self->to_abgr32();
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_color_to_abgr64(const godot_color *p_self) {
|
||||
const Color *self = (const Color *)p_self;
|
||||
return self->to_abgr64();
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_color_to_argb64(const godot_color *p_self) {
|
||||
const Color *self = (const Color *)p_self;
|
||||
return self->to_argb64();
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_color_to_rgba64(const godot_color *p_self) {
|
||||
const Color *self = (const Color *)p_self;
|
||||
return self->to_rgba64();
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_color_to_argb32(const godot_color *p_self) {
|
||||
const Color *self = (const Color *)p_self;
|
||||
return self->to_argb32();
|
||||
}
|
||||
|
||||
godot_color GDAPI godot_color_inverted(const godot_color *p_self) {
|
||||
godot_color dest;
|
||||
const Color *self = (const Color *)p_self;
|
||||
*((Color *)&dest) = self->inverted();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_color GDAPI godot_color_lerp(const godot_color *p_self, const godot_color *p_b, const godot_real p_t) {
|
||||
godot_color dest;
|
||||
const Color *self = (const Color *)p_self;
|
||||
const Color *b = (const Color *)p_b;
|
||||
*((Color *)&dest) = self->lerp(*b, p_t);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_color GDAPI godot_color_blend(const godot_color *p_self, const godot_color *p_over) {
|
||||
godot_color dest;
|
||||
const Color *self = (const Color *)p_self;
|
||||
const Color *over = (const Color *)p_over;
|
||||
*((Color *)&dest) = self->blend(*over);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_color GDAPI godot_color_darkened(const godot_color *p_self, const godot_real p_amount) {
|
||||
godot_color dest;
|
||||
const Color *self = (const Color *)p_self;
|
||||
*((Color *)&dest) = self->darkened(p_amount);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_color GDAPI godot_color_from_hsv(const godot_color *p_self, const godot_real p_h, const godot_real p_s, const godot_real p_v, const godot_real p_a) {
|
||||
godot_color dest;
|
||||
const Color *self = (const Color *)p_self;
|
||||
*((Color *)&dest) = self->from_hsv(p_h, p_s, p_v, p_a);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_color GDAPI godot_color_lightened(const godot_color *p_self, const godot_real p_amount) {
|
||||
godot_color dest;
|
||||
const Color *self = (const Color *)p_self;
|
||||
*((Color *)&dest) = self->lightened(p_amount);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_color_to_html(const godot_color *p_self, const godot_bool p_with_alpha) {
|
||||
godot_string dest;
|
||||
const Color *self = (const Color *)p_self;
|
||||
|
||||
memnew_placement(&dest, String(self->to_html(p_with_alpha)));
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_color_operator_equal(const godot_color *p_self, const godot_color *p_b) {
|
||||
const Color *self = (const Color *)p_self;
|
||||
const Color *b = (const Color *)p_b;
|
||||
return *self == *b;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_color_operator_less(const godot_color *p_self, const godot_color *p_b) {
|
||||
const Color *self = (const Color *)p_self;
|
||||
const Color *b = (const Color *)p_b;
|
||||
return *self < *b;
|
||||
void GDAPI godot_color_new(godot_color *p_self) {
|
||||
memnew_placement(p_self, Color);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -30,26 +30,16 @@
|
|||
|
||||
#include "gdnative/dictionary.h"
|
||||
|
||||
#include "core/variant/variant.h"
|
||||
// core/variant/variant.h before to avoid compile errors with MSVC
|
||||
#include "core/io/json.h"
|
||||
#include "core/variant/dictionary.h"
|
||||
|
||||
static_assert(sizeof(godot_dictionary) == sizeof(Dictionary), "Dictionary size mismatch");
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
static_assert(sizeof(godot_dictionary) == sizeof(Dictionary), "Dictionary size mismatch");
|
||||
|
||||
void GDAPI godot_dictionary_new(godot_dictionary *r_dest) {
|
||||
Dictionary *dest = (Dictionary *)r_dest;
|
||||
memnew_placement(dest, Dictionary);
|
||||
}
|
||||
|
||||
void GDAPI godot_dictionary_new_copy(godot_dictionary *r_dest, const godot_dictionary *p_src) {
|
||||
Dictionary *dest = (Dictionary *)r_dest;
|
||||
const Dictionary *src = (const Dictionary *)p_src;
|
||||
memnew_placement(dest, Dictionary(*src));
|
||||
void GDAPI godot_dictionary_new(godot_dictionary *p_self) {
|
||||
memnew_placement(p_self, Dictionary);
|
||||
}
|
||||
|
||||
void GDAPI godot_dictionary_destroy(godot_dictionary *p_self) {
|
||||
|
@ -57,135 +47,6 @@ void GDAPI godot_dictionary_destroy(godot_dictionary *p_self) {
|
|||
self->~Dictionary();
|
||||
}
|
||||
|
||||
godot_dictionary GDAPI godot_dictionary_duplicate(const godot_dictionary *p_self, const godot_bool p_deep) {
|
||||
const Dictionary *self = (const Dictionary *)p_self;
|
||||
godot_dictionary res;
|
||||
Dictionary *val = (Dictionary *)&res;
|
||||
memnew_placement(val, Dictionary);
|
||||
*val = self->duplicate(p_deep);
|
||||
return res;
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_dictionary_size(const godot_dictionary *p_self) {
|
||||
const Dictionary *self = (const Dictionary *)p_self;
|
||||
return self->size();
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_dictionary_is_empty(const godot_dictionary *p_self) {
|
||||
const Dictionary *self = (const Dictionary *)p_self;
|
||||
return self->is_empty();
|
||||
}
|
||||
|
||||
void GDAPI godot_dictionary_clear(godot_dictionary *p_self) {
|
||||
Dictionary *self = (Dictionary *)p_self;
|
||||
self->clear();
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_dictionary_has(const godot_dictionary *p_self, const godot_variant *p_key) {
|
||||
const Dictionary *self = (const Dictionary *)p_self;
|
||||
const Variant *key = (const Variant *)p_key;
|
||||
return self->has(*key);
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_dictionary_has_all(const godot_dictionary *p_self, const godot_array *p_keys) {
|
||||
const Dictionary *self = (const Dictionary *)p_self;
|
||||
const Array *keys = (const Array *)p_keys;
|
||||
return self->has_all(*keys);
|
||||
}
|
||||
|
||||
void GDAPI godot_dictionary_erase(godot_dictionary *p_self, const godot_variant *p_key) {
|
||||
Dictionary *self = (Dictionary *)p_self;
|
||||
const Variant *key = (const Variant *)p_key;
|
||||
self->erase(*key);
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_dictionary_hash(const godot_dictionary *p_self) {
|
||||
const Dictionary *self = (const Dictionary *)p_self;
|
||||
return self->hash();
|
||||
}
|
||||
|
||||
godot_array GDAPI godot_dictionary_keys(const godot_dictionary *p_self) {
|
||||
godot_array dest;
|
||||
const Dictionary *self = (const Dictionary *)p_self;
|
||||
memnew_placement(&dest, Array(self->keys()));
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_array GDAPI godot_dictionary_values(const godot_dictionary *p_self) {
|
||||
godot_array dest;
|
||||
const Dictionary *self = (const Dictionary *)p_self;
|
||||
memnew_placement(&dest, Array(self->values()));
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_variant GDAPI godot_dictionary_get(const godot_dictionary *p_self, const godot_variant *p_key) {
|
||||
godot_variant raw_dest;
|
||||
Variant *dest = (Variant *)&raw_dest;
|
||||
const Dictionary *self = (const Dictionary *)p_self;
|
||||
const Variant *key = (const Variant *)p_key;
|
||||
memnew_placement(dest, Variant(self->operator[](*key)));
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
void GDAPI godot_dictionary_set(godot_dictionary *p_self, const godot_variant *p_key, const godot_variant *p_value) {
|
||||
Dictionary *self = (Dictionary *)p_self;
|
||||
const Variant *key = (const Variant *)p_key;
|
||||
const Variant *value = (const Variant *)p_value;
|
||||
self->operator[](*key) = *value;
|
||||
}
|
||||
|
||||
godot_variant GDAPI *godot_dictionary_operator_index(godot_dictionary *p_self, const godot_variant *p_key) {
|
||||
Dictionary *self = (Dictionary *)p_self;
|
||||
const Variant *key = (const Variant *)p_key;
|
||||
return (godot_variant *)&self->operator[](*key);
|
||||
}
|
||||
|
||||
const godot_variant GDAPI *godot_dictionary_operator_index_const(const godot_dictionary *p_self, const godot_variant *p_key) {
|
||||
const Dictionary *self = (const Dictionary *)p_self;
|
||||
const Variant *key = (const Variant *)p_key;
|
||||
return (const godot_variant *)&self->operator[](*key);
|
||||
}
|
||||
|
||||
godot_variant GDAPI *godot_dictionary_next(const godot_dictionary *p_self, const godot_variant *p_key) {
|
||||
Dictionary *self = (Dictionary *)p_self;
|
||||
const Variant *key = (const Variant *)p_key;
|
||||
return (godot_variant *)self->next(key);
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_dictionary_operator_equal(const godot_dictionary *p_self, const godot_dictionary *p_b) {
|
||||
const Dictionary *self = (const Dictionary *)p_self;
|
||||
const Dictionary *b = (const Dictionary *)p_b;
|
||||
return *self == *b;
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_dictionary_to_json(const godot_dictionary *p_self) {
|
||||
godot_string raw_dest;
|
||||
String *dest = (String *)&raw_dest;
|
||||
const Dictionary *self = (const Dictionary *)p_self;
|
||||
memnew_placement(dest, String(JSON::print(Variant(*self))));
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
// GDNative core 1.1
|
||||
|
||||
godot_bool GDAPI godot_dictionary_erase_with_return(godot_dictionary *p_self, const godot_variant *p_key) {
|
||||
Dictionary *self = (Dictionary *)p_self;
|
||||
const Variant *key = (const Variant *)p_key;
|
||||
return self->erase(*key);
|
||||
}
|
||||
|
||||
godot_variant GDAPI godot_dictionary_get_with_default(const godot_dictionary *p_self, const godot_variant *p_key, const godot_variant *p_default) {
|
||||
const Dictionary *self = (const Dictionary *)p_self;
|
||||
const Variant *key = (const Variant *)p_key;
|
||||
const Variant *def = (const Variant *)p_default;
|
||||
|
||||
godot_variant raw_dest;
|
||||
Variant *dest = (Variant *)&raw_dest;
|
||||
memnew_placement(dest, Variant(self->get(*key, *def)));
|
||||
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -99,7 +99,7 @@ godot_class_constructor GDAPI godot_get_class_constructor(const char *p_classnam
|
|||
|
||||
godot_dictionary GDAPI godot_get_global_constants() {
|
||||
godot_dictionary constants;
|
||||
godot_dictionary_new(&constants);
|
||||
memnew_placement(&constants, Dictionary);
|
||||
Dictionary *p_constants = (Dictionary *)&constants;
|
||||
const int constants_count = CoreConstants::get_global_constant_count();
|
||||
for (int i = 0; i < constants_count; ++i) {
|
||||
|
|
|
@ -31,24 +31,15 @@
|
|||
#include "gdnative/node_path.h"
|
||||
|
||||
#include "core/string/node_path.h"
|
||||
#include "core/variant/variant.h"
|
||||
|
||||
static_assert(sizeof(godot_node_path) == sizeof(NodePath), "NodePath size mismatch");
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
static_assert(sizeof(godot_node_path) == sizeof(NodePath), "NodePath size mismatch");
|
||||
|
||||
void GDAPI godot_node_path_new(godot_node_path *r_dest, const godot_string *p_from) {
|
||||
NodePath *dest = (NodePath *)r_dest;
|
||||
const String *from = (const String *)p_from;
|
||||
memnew_placement(dest, NodePath(*from));
|
||||
}
|
||||
|
||||
void GDAPI godot_node_path_new_copy(godot_node_path *r_dest, const godot_node_path *p_src) {
|
||||
NodePath *dest = (NodePath *)r_dest;
|
||||
const NodePath *src = (const NodePath *)p_src;
|
||||
memnew_placement(dest, NodePath(*src));
|
||||
void GDAPI godot_node_path_new(godot_node_path *p_self) {
|
||||
memnew_placement(p_self, NodePath);
|
||||
}
|
||||
|
||||
void GDAPI godot_node_path_destroy(godot_node_path *p_self) {
|
||||
|
@ -56,71 +47,6 @@ void GDAPI godot_node_path_destroy(godot_node_path *p_self) {
|
|||
self->~NodePath();
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_node_path_as_string(const godot_node_path *p_self) {
|
||||
godot_string ret;
|
||||
const NodePath *self = (const NodePath *)p_self;
|
||||
memnew_placement(&ret, String(*self));
|
||||
return ret;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_node_path_is_absolute(const godot_node_path *p_self) {
|
||||
const NodePath *self = (const NodePath *)p_self;
|
||||
return self->is_absolute();
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_node_path_get_name_count(const godot_node_path *p_self) {
|
||||
const NodePath *self = (const NodePath *)p_self;
|
||||
return self->get_name_count();
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_node_path_get_name(const godot_node_path *p_self, const godot_int p_idx) {
|
||||
godot_string dest;
|
||||
const NodePath *self = (const NodePath *)p_self;
|
||||
|
||||
memnew_placement(&dest, String(self->get_name(p_idx)));
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_node_path_get_subname_count(const godot_node_path *p_self) {
|
||||
const NodePath *self = (const NodePath *)p_self;
|
||||
return self->get_subname_count();
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_node_path_get_subname(const godot_node_path *p_self, const godot_int p_idx) {
|
||||
godot_string dest;
|
||||
const NodePath *self = (const NodePath *)p_self;
|
||||
|
||||
memnew_placement(&dest, String(self->get_subname(p_idx)));
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_node_path_get_concatenated_subnames(const godot_node_path *p_self) {
|
||||
godot_string dest;
|
||||
const NodePath *self = (const NodePath *)p_self;
|
||||
memnew_placement(&dest, String(self->get_concatenated_subnames()));
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_node_path_is_empty(const godot_node_path *p_self) {
|
||||
const NodePath *self = (const NodePath *)p_self;
|
||||
return self->is_empty();
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_node_path_operator_equal(const godot_node_path *p_self, const godot_node_path *p_b) {
|
||||
const NodePath *self = (const NodePath *)p_self;
|
||||
const NodePath *b = (const NodePath *)p_b;
|
||||
return *self == *b;
|
||||
}
|
||||
|
||||
godot_node_path godot_node_path_get_as_property_path(const godot_node_path *p_self) {
|
||||
const NodePath *self = (const NodePath *)p_self;
|
||||
godot_node_path res;
|
||||
NodePath *val = (NodePath *)&res;
|
||||
memnew_placement(val, NodePath);
|
||||
*val = self->get_as_property_path();
|
||||
return res;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -31,139 +31,15 @@
|
|||
#include "gdnative/plane.h"
|
||||
|
||||
#include "core/math/plane.h"
|
||||
#include "core/variant/variant.h"
|
||||
|
||||
static_assert(sizeof(godot_plane) == sizeof(Plane), "Plane size mismatch");
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
static_assert(sizeof(godot_plane) == sizeof(Plane), "Plane size mismatch");
|
||||
|
||||
void GDAPI godot_plane_new_with_reals(godot_plane *r_dest, const godot_real p_a, const godot_real p_b, const godot_real p_c, const godot_real p_d) {
|
||||
Plane *dest = (Plane *)r_dest;
|
||||
*dest = Plane(p_a, p_b, p_c, p_d);
|
||||
}
|
||||
|
||||
void GDAPI godot_plane_new_with_vectors(godot_plane *r_dest, const godot_vector3 *p_v1, const godot_vector3 *p_v2, const godot_vector3 *p_v3) {
|
||||
const Vector3 *v1 = (const Vector3 *)p_v1;
|
||||
const Vector3 *v2 = (const Vector3 *)p_v2;
|
||||
const Vector3 *v3 = (const Vector3 *)p_v3;
|
||||
Plane *dest = (Plane *)r_dest;
|
||||
*dest = Plane(*v1, *v2, *v3);
|
||||
}
|
||||
|
||||
void GDAPI godot_plane_new_with_normal(godot_plane *r_dest, const godot_vector3 *p_normal, const godot_real p_d) {
|
||||
const Vector3 *normal = (const Vector3 *)p_normal;
|
||||
Plane *dest = (Plane *)r_dest;
|
||||
*dest = Plane(*normal, p_d);
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_plane_as_string(const godot_plane *p_self) {
|
||||
godot_string ret;
|
||||
const Plane *self = (const Plane *)p_self;
|
||||
memnew_placement(&ret, String(*self));
|
||||
return ret;
|
||||
}
|
||||
|
||||
godot_plane GDAPI godot_plane_normalized(const godot_plane *p_self) {
|
||||
godot_plane dest;
|
||||
const Plane *self = (const Plane *)p_self;
|
||||
*((Plane *)&dest) = self->normalized();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_plane_center(const godot_plane *p_self) {
|
||||
godot_vector3 dest;
|
||||
const Plane *self = (const Plane *)p_self;
|
||||
*((Vector3 *)&dest) = self->center();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_plane_is_point_over(const godot_plane *p_self, const godot_vector3 *p_point) {
|
||||
const Plane *self = (const Plane *)p_self;
|
||||
const Vector3 *point = (const Vector3 *)p_point;
|
||||
return self->is_point_over(*point);
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_plane_distance_to(const godot_plane *p_self, const godot_vector3 *p_point) {
|
||||
const Plane *self = (const Plane *)p_self;
|
||||
const Vector3 *point = (const Vector3 *)p_point;
|
||||
return self->distance_to(*point);
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_plane_has_point(const godot_plane *p_self, const godot_vector3 *p_point, const godot_real p_epsilon) {
|
||||
const Plane *self = (const Plane *)p_self;
|
||||
const Vector3 *point = (const Vector3 *)p_point;
|
||||
return self->has_point(*point, p_epsilon);
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_plane_project(const godot_plane *p_self, const godot_vector3 *p_point) {
|
||||
godot_vector3 dest;
|
||||
const Plane *self = (const Plane *)p_self;
|
||||
const Vector3 *point = (const Vector3 *)p_point;
|
||||
*((Vector3 *)&dest) = self->project(*point);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_plane_intersect_3(const godot_plane *p_self, godot_vector3 *r_dest, const godot_plane *p_b, const godot_plane *p_c) {
|
||||
const Plane *self = (const Plane *)p_self;
|
||||
const Plane *b = (const Plane *)p_b;
|
||||
const Plane *c = (const Plane *)p_c;
|
||||
Vector3 *dest = (Vector3 *)r_dest;
|
||||
return self->intersect_3(*b, *c, dest);
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_plane_intersects_ray(const godot_plane *p_self, godot_vector3 *r_dest, const godot_vector3 *p_from, const godot_vector3 *p_dir) {
|
||||
const Plane *self = (const Plane *)p_self;
|
||||
const Vector3 *from = (const Vector3 *)p_from;
|
||||
const Vector3 *dir = (const Vector3 *)p_dir;
|
||||
Vector3 *dest = (Vector3 *)r_dest;
|
||||
return self->intersects_ray(*from, *dir, dest);
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_plane_intersects_segment(const godot_plane *p_self, godot_vector3 *r_dest, const godot_vector3 *p_begin, const godot_vector3 *p_end) {
|
||||
const Plane *self = (const Plane *)p_self;
|
||||
const Vector3 *begin = (const Vector3 *)p_begin;
|
||||
const Vector3 *end = (const Vector3 *)p_end;
|
||||
Vector3 *dest = (Vector3 *)r_dest;
|
||||
return self->intersects_segment(*begin, *end, dest);
|
||||
}
|
||||
|
||||
godot_plane GDAPI godot_plane_operator_neg(const godot_plane *p_self) {
|
||||
godot_plane raw_dest;
|
||||
Plane *dest = (Plane *)&raw_dest;
|
||||
const Plane *self = (const Plane *)p_self;
|
||||
*dest = -(*self);
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_plane_operator_equal(const godot_plane *p_self, const godot_plane *p_b) {
|
||||
const Plane *self = (const Plane *)p_self;
|
||||
const Plane *b = (const Plane *)p_b;
|
||||
return *self == *b;
|
||||
}
|
||||
|
||||
void GDAPI godot_plane_set_normal(godot_plane *p_self, const godot_vector3 *p_normal) {
|
||||
Plane *self = (Plane *)p_self;
|
||||
const Vector3 *normal = (const Vector3 *)p_normal;
|
||||
self->set_normal(*normal);
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_plane_get_normal(const godot_plane *p_self) {
|
||||
const Plane *self = (const Plane *)p_self;
|
||||
const Vector3 normal = self->get_normal();
|
||||
godot_vector3 *v3 = (godot_vector3 *)&normal;
|
||||
return *v3;
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_plane_get_d(const godot_plane *p_self) {
|
||||
const Plane *self = (const Plane *)p_self;
|
||||
return self->d;
|
||||
}
|
||||
|
||||
void GDAPI godot_plane_set_d(godot_plane *p_self, const godot_real p_d) {
|
||||
Plane *self = (Plane *)p_self;
|
||||
self->d = p_d;
|
||||
void GDAPI godot_plane_new(godot_plane *p_self) {
|
||||
memnew_placement(p_self, Plane);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -31,205 +31,15 @@
|
|||
#include "gdnative/quat.h"
|
||||
|
||||
#include "core/math/quat.h"
|
||||
#include "core/variant/variant.h"
|
||||
|
||||
static_assert(sizeof(godot_quat) == sizeof(Quat), "Quat size mismatch");
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
static_assert(sizeof(godot_quat) == sizeof(Quat), "Quat size mismatch");
|
||||
|
||||
void GDAPI godot_quat_new(godot_quat *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_z, const godot_real p_w) {
|
||||
Quat *dest = (Quat *)r_dest;
|
||||
*dest = Quat(p_x, p_y, p_z, p_w);
|
||||
}
|
||||
|
||||
void GDAPI godot_quat_new_with_axis_angle(godot_quat *r_dest, const godot_vector3 *p_axis, const godot_real p_angle) {
|
||||
const Vector3 *axis = (const Vector3 *)p_axis;
|
||||
Quat *dest = (Quat *)r_dest;
|
||||
*dest = Quat(*axis, p_angle);
|
||||
}
|
||||
|
||||
void GDAPI godot_quat_new_with_basis(godot_quat *r_dest, const godot_basis *p_basis) {
|
||||
const Basis *basis = (const Basis *)p_basis;
|
||||
Quat *dest = (Quat *)r_dest;
|
||||
*dest = Quat(*basis);
|
||||
}
|
||||
|
||||
void GDAPI godot_quat_new_with_euler(godot_quat *r_dest, const godot_vector3 *p_euler) {
|
||||
const Vector3 *euler = (const Vector3 *)p_euler;
|
||||
Quat *dest = (Quat *)r_dest;
|
||||
*dest = Quat(*euler);
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_quat_get_x(const godot_quat *p_self) {
|
||||
const Quat *self = (const Quat *)p_self;
|
||||
return self->x;
|
||||
}
|
||||
|
||||
void GDAPI godot_quat_set_x(godot_quat *p_self, const godot_real val) {
|
||||
Quat *self = (Quat *)p_self;
|
||||
self->x = val;
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_quat_get_y(const godot_quat *p_self) {
|
||||
const Quat *self = (const Quat *)p_self;
|
||||
return self->y;
|
||||
}
|
||||
|
||||
void GDAPI godot_quat_set_y(godot_quat *p_self, const godot_real val) {
|
||||
Quat *self = (Quat *)p_self;
|
||||
self->y = val;
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_quat_get_z(const godot_quat *p_self) {
|
||||
const Quat *self = (const Quat *)p_self;
|
||||
return self->z;
|
||||
}
|
||||
|
||||
void GDAPI godot_quat_set_z(godot_quat *p_self, const godot_real val) {
|
||||
Quat *self = (Quat *)p_self;
|
||||
self->z = val;
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_quat_get_w(const godot_quat *p_self) {
|
||||
const Quat *self = (const Quat *)p_self;
|
||||
return self->w;
|
||||
}
|
||||
|
||||
void GDAPI godot_quat_set_w(godot_quat *p_self, const godot_real val) {
|
||||
Quat *self = (Quat *)p_self;
|
||||
self->w = val;
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_quat_as_string(const godot_quat *p_self) {
|
||||
godot_string ret;
|
||||
const Quat *self = (const Quat *)p_self;
|
||||
memnew_placement(&ret, String(*self));
|
||||
return ret;
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_quat_length(const godot_quat *p_self) {
|
||||
const Quat *self = (const Quat *)p_self;
|
||||
return self->length();
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_quat_length_squared(const godot_quat *p_self) {
|
||||
const Quat *self = (const Quat *)p_self;
|
||||
return self->length_squared();
|
||||
}
|
||||
|
||||
godot_quat GDAPI godot_quat_normalized(const godot_quat *p_self) {
|
||||
godot_quat dest;
|
||||
const Quat *self = (const Quat *)p_self;
|
||||
*((Quat *)&dest) = self->normalized();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_quat_is_normalized(const godot_quat *p_self) {
|
||||
const Quat *self = (const Quat *)p_self;
|
||||
return self->is_normalized();
|
||||
}
|
||||
|
||||
godot_quat GDAPI godot_quat_inverse(const godot_quat *p_self) {
|
||||
godot_quat dest;
|
||||
const Quat *self = (const Quat *)p_self;
|
||||
*((Quat *)&dest) = self->inverse();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_quat_dot(const godot_quat *p_self, const godot_quat *p_b) {
|
||||
const Quat *self = (const Quat *)p_self;
|
||||
const Quat *b = (const Quat *)p_b;
|
||||
return self->dot(*b);
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_quat_xform(const godot_quat *p_self, const godot_vector3 *p_v) {
|
||||
godot_vector3 dest;
|
||||
const Quat *self = (const Quat *)p_self;
|
||||
const Vector3 *v = (const Vector3 *)p_v;
|
||||
*((Vector3 *)&dest) = self->xform(*v);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_quat GDAPI godot_quat_slerp(const godot_quat *p_self, const godot_quat *p_b, const godot_real p_t) {
|
||||
godot_quat dest;
|
||||
const Quat *self = (const Quat *)p_self;
|
||||
const Quat *b = (const Quat *)p_b;
|
||||
*((Quat *)&dest) = self->slerp(*b, p_t);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_quat GDAPI godot_quat_slerpni(const godot_quat *p_self, const godot_quat *p_b, const godot_real p_t) {
|
||||
godot_quat dest;
|
||||
const Quat *self = (const Quat *)p_self;
|
||||
const Quat *b = (const Quat *)p_b;
|
||||
*((Quat *)&dest) = self->slerpni(*b, p_t);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_quat GDAPI godot_quat_cubic_slerp(const godot_quat *p_self, const godot_quat *p_b, const godot_quat *p_pre_a, const godot_quat *p_post_b, const godot_real p_t) {
|
||||
godot_quat dest;
|
||||
const Quat *self = (const Quat *)p_self;
|
||||
const Quat *b = (const Quat *)p_b;
|
||||
const Quat *pre_a = (const Quat *)p_pre_a;
|
||||
const Quat *post_b = (const Quat *)p_post_b;
|
||||
*((Quat *)&dest) = self->cubic_slerp(*b, *pre_a, *post_b, p_t);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_quat GDAPI godot_quat_operator_multiply(const godot_quat *p_self, const godot_real p_b) {
|
||||
godot_quat raw_dest;
|
||||
Quat *dest = (Quat *)&raw_dest;
|
||||
const Quat *self = (const Quat *)p_self;
|
||||
*dest = *self * p_b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_quat GDAPI godot_quat_operator_add(const godot_quat *p_self, const godot_quat *p_b) {
|
||||
godot_quat raw_dest;
|
||||
Quat *dest = (Quat *)&raw_dest;
|
||||
const Quat *self = (const Quat *)p_self;
|
||||
const Quat *b = (const Quat *)p_b;
|
||||
*dest = *self + *b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_quat GDAPI godot_quat_operator_subtract(const godot_quat *p_self, const godot_quat *p_b) {
|
||||
godot_quat raw_dest;
|
||||
Quat *dest = (Quat *)&raw_dest;
|
||||
const Quat *self = (const Quat *)p_self;
|
||||
const Quat *b = (const Quat *)p_b;
|
||||
*dest = *self - *b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_quat GDAPI godot_quat_operator_divide(const godot_quat *p_self, const godot_real p_b) {
|
||||
godot_quat raw_dest;
|
||||
Quat *dest = (Quat *)&raw_dest;
|
||||
const Quat *self = (const Quat *)p_self;
|
||||
*dest = *self / p_b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_quat_operator_equal(const godot_quat *p_self, const godot_quat *p_b) {
|
||||
const Quat *self = (const Quat *)p_self;
|
||||
const Quat *b = (const Quat *)p_b;
|
||||
return *self == *b;
|
||||
}
|
||||
|
||||
godot_quat GDAPI godot_quat_operator_neg(const godot_quat *p_self) {
|
||||
godot_quat raw_dest;
|
||||
Quat *dest = (Quat *)&raw_dest;
|
||||
const Quat *self = (const Quat *)p_self;
|
||||
*dest = -(*self);
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
void GDAPI godot_quat_set_axis_angle(godot_quat *p_self, const godot_vector3 *p_axis, const godot_real p_angle) {
|
||||
Quat *self = (Quat *)p_self;
|
||||
const Vector3 *axis = (const Vector3 *)p_axis;
|
||||
self->set_axis_angle(*axis, p_angle);
|
||||
void GDAPI godot_quat_new(godot_quat *p_self) {
|
||||
memnew_placement(p_self, Quat);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -30,300 +30,21 @@
|
|||
|
||||
#include "gdnative/rect2.h"
|
||||
|
||||
#include "core/math/transform_2d.h"
|
||||
#include "core/variant/variant.h"
|
||||
#include "core/math/rect2.h"
|
||||
|
||||
static_assert(sizeof(godot_rect2) == sizeof(Rect2), "Rect2 size mismatch");
|
||||
static_assert(sizeof(godot_rect2i) == sizeof(Rect2i), "Rect2i size mismatch");
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
static_assert(sizeof(godot_rect2) == sizeof(Rect2), "Rect2 size mismatch");
|
||||
static_assert(sizeof(godot_rect2i) == sizeof(Rect2i), "Rect2i size mismatch");
|
||||
|
||||
// Rect2
|
||||
|
||||
void GDAPI godot_rect2_new_with_position_and_size(godot_rect2 *r_dest, const godot_vector2 *p_pos, const godot_vector2 *p_size) {
|
||||
const Vector2 *position = (const Vector2 *)p_pos;
|
||||
const Vector2 *size = (const Vector2 *)p_size;
|
||||
Rect2 *dest = (Rect2 *)r_dest;
|
||||
*dest = Rect2(*position, *size);
|
||||
void GDAPI godot_rect2_new(godot_rect2 *p_self) {
|
||||
memnew_placement(p_self, Rect2);
|
||||
}
|
||||
|
||||
void GDAPI godot_rect2_new(godot_rect2 *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_width, const godot_real p_height) {
|
||||
Rect2 *dest = (Rect2 *)r_dest;
|
||||
*dest = Rect2(p_x, p_y, p_width, p_height);
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_rect2_as_string(const godot_rect2 *p_self) {
|
||||
godot_string ret;
|
||||
const Rect2 *self = (const Rect2 *)p_self;
|
||||
memnew_placement(&ret, String(*self));
|
||||
return ret;
|
||||
}
|
||||
|
||||
godot_rect2i GDAPI godot_rect2_as_rect2i(const godot_rect2 *p_self) {
|
||||
godot_rect2i dest;
|
||||
const Rect2 *self = (const Rect2 *)p_self;
|
||||
*((Rect2i *)&dest) = Rect2i(*self);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_rect2_get_area(const godot_rect2 *p_self) {
|
||||
const Rect2 *self = (const Rect2 *)p_self;
|
||||
return self->get_area();
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_rect2_intersects(const godot_rect2 *p_self, const godot_rect2 *p_b) {
|
||||
const Rect2 *self = (const Rect2 *)p_self;
|
||||
const Rect2 *b = (const Rect2 *)p_b;
|
||||
return self->intersects(*b);
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_rect2_encloses(const godot_rect2 *p_self, const godot_rect2 *p_b) {
|
||||
const Rect2 *self = (const Rect2 *)p_self;
|
||||
const Rect2 *b = (const Rect2 *)p_b;
|
||||
return self->encloses(*b);
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_rect2_has_no_area(const godot_rect2 *p_self) {
|
||||
const Rect2 *self = (const Rect2 *)p_self;
|
||||
return self->has_no_area();
|
||||
}
|
||||
|
||||
godot_rect2 GDAPI godot_rect2_intersection(const godot_rect2 *p_self, const godot_rect2 *p_b) {
|
||||
godot_rect2 dest;
|
||||
const Rect2 *self = (const Rect2 *)p_self;
|
||||
const Rect2 *b = (const Rect2 *)p_b;
|
||||
*((Rect2 *)&dest) = self->intersection(*b);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_rect2 GDAPI godot_rect2_merge(const godot_rect2 *p_self, const godot_rect2 *p_b) {
|
||||
godot_rect2 dest;
|
||||
const Rect2 *self = (const Rect2 *)p_self;
|
||||
const Rect2 *b = (const Rect2 *)p_b;
|
||||
*((Rect2 *)&dest) = self->merge(*b);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_rect2_has_point(const godot_rect2 *p_self, const godot_vector2 *p_point) {
|
||||
const Rect2 *self = (const Rect2 *)p_self;
|
||||
const Vector2 *point = (const Vector2 *)p_point;
|
||||
return self->has_point(*point);
|
||||
}
|
||||
|
||||
godot_rect2 GDAPI godot_rect2_grow(const godot_rect2 *p_self, const godot_real p_by) {
|
||||
godot_rect2 dest;
|
||||
const Rect2 *self = (const Rect2 *)p_self;
|
||||
|
||||
*((Rect2 *)&dest) = self->grow(p_by);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_rect2 GDAPI godot_rect2_grow_individual(const godot_rect2 *p_self, const godot_real p_left, const godot_real p_top, const godot_real p_right, const godot_real p_bottom) {
|
||||
godot_rect2 dest;
|
||||
const Rect2 *self = (const Rect2 *)p_self;
|
||||
*((Rect2 *)&dest) = self->grow_individual(p_left, p_top, p_right, p_bottom);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_rect2 GDAPI godot_rect2_grow_side(const godot_rect2 *p_self, const godot_int p_side, const godot_real p_by) {
|
||||
godot_rect2 dest;
|
||||
const Rect2 *self = (const Rect2 *)p_self;
|
||||
*((Rect2 *)&dest) = self->grow_side((Side)p_side, p_by);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_rect2 GDAPI godot_rect2_abs(const godot_rect2 *p_self) {
|
||||
godot_rect2 dest;
|
||||
const Rect2 *self = (const Rect2 *)p_self;
|
||||
*((Rect2 *)&dest) = self->abs();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_rect2 GDAPI godot_rect2_expand(const godot_rect2 *p_self, const godot_vector2 *p_to) {
|
||||
godot_rect2 dest;
|
||||
const Rect2 *self = (const Rect2 *)p_self;
|
||||
const Vector2 *to = (const Vector2 *)p_to;
|
||||
*((Rect2 *)&dest) = self->expand(*to);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_rect2_operator_equal(const godot_rect2 *p_self, const godot_rect2 *p_b) {
|
||||
const Rect2 *self = (const Rect2 *)p_self;
|
||||
const Rect2 *b = (const Rect2 *)p_b;
|
||||
return *self == *b;
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_rect2_get_position(const godot_rect2 *p_self) {
|
||||
godot_vector2 dest;
|
||||
Vector2 *d = (Vector2 *)&dest;
|
||||
const Rect2 *self = (const Rect2 *)p_self;
|
||||
*d = self->get_position();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_rect2_get_size(const godot_rect2 *p_self) {
|
||||
godot_vector2 dest;
|
||||
Vector2 *d = (Vector2 *)&dest;
|
||||
const Rect2 *self = (const Rect2 *)p_self;
|
||||
*d = self->get_size();
|
||||
return dest;
|
||||
}
|
||||
|
||||
void GDAPI godot_rect2_set_position(godot_rect2 *p_self, const godot_vector2 *p_pos) {
|
||||
Rect2 *self = (Rect2 *)p_self;
|
||||
const Vector2 *position = (const Vector2 *)p_pos;
|
||||
self->set_position(*position);
|
||||
}
|
||||
|
||||
void GDAPI godot_rect2_set_size(godot_rect2 *p_self, const godot_vector2 *p_size) {
|
||||
Rect2 *self = (Rect2 *)p_self;
|
||||
const Vector2 *size = (const Vector2 *)p_size;
|
||||
self->set_size(*size);
|
||||
}
|
||||
|
||||
// Rect2i
|
||||
|
||||
void GDAPI godot_rect2i_new_with_position_and_size(godot_rect2i *r_dest, const godot_vector2i *p_pos, const godot_vector2i *p_size) {
|
||||
const Vector2i *position = (const Vector2i *)p_pos;
|
||||
const Vector2i *size = (const Vector2i *)p_size;
|
||||
Rect2i *dest = (Rect2i *)r_dest;
|
||||
*dest = Rect2i(*position, *size);
|
||||
}
|
||||
|
||||
void GDAPI godot_rect2i_new(godot_rect2i *r_dest, const godot_int p_x, const godot_int p_y, const godot_int p_width, const godot_int p_height) {
|
||||
Rect2i *dest = (Rect2i *)r_dest;
|
||||
*dest = Rect2i(p_x, p_y, p_width, p_height);
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_rect2i_as_string(const godot_rect2i *p_self) {
|
||||
godot_string ret;
|
||||
const Rect2i *self = (const Rect2i *)p_self;
|
||||
memnew_placement(&ret, String(*self));
|
||||
return ret;
|
||||
}
|
||||
|
||||
godot_rect2 GDAPI godot_rect2i_as_rect2(const godot_rect2i *p_self) {
|
||||
godot_rect2 dest;
|
||||
const Rect2i *self = (const Rect2i *)p_self;
|
||||
*((Rect2 *)&dest) = Rect2(*self);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_rect2i_get_area(const godot_rect2i *p_self) {
|
||||
const Rect2i *self = (const Rect2i *)p_self;
|
||||
return self->get_area();
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_rect2i_intersects(const godot_rect2i *p_self, const godot_rect2i *p_b) {
|
||||
const Rect2i *self = (const Rect2i *)p_self;
|
||||
const Rect2i *b = (const Rect2i *)p_b;
|
||||
return self->intersects(*b);
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_rect2i_encloses(const godot_rect2i *p_self, const godot_rect2i *p_b) {
|
||||
const Rect2i *self = (const Rect2i *)p_self;
|
||||
const Rect2i *b = (const Rect2i *)p_b;
|
||||
return self->encloses(*b);
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_rect2i_has_no_area(const godot_rect2i *p_self) {
|
||||
const Rect2i *self = (const Rect2i *)p_self;
|
||||
return self->has_no_area();
|
||||
}
|
||||
|
||||
godot_rect2i GDAPI godot_rect2i_intersection(const godot_rect2i *p_self, const godot_rect2i *p_b) {
|
||||
godot_rect2i dest;
|
||||
const Rect2i *self = (const Rect2i *)p_self;
|
||||
const Rect2i *b = (const Rect2i *)p_b;
|
||||
*((Rect2i *)&dest) = self->intersection(*b);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_rect2i GDAPI godot_rect2i_merge(const godot_rect2i *p_self, const godot_rect2i *p_b) {
|
||||
godot_rect2i dest;
|
||||
const Rect2i *self = (const Rect2i *)p_self;
|
||||
const Rect2i *b = (const Rect2i *)p_b;
|
||||
*((Rect2i *)&dest) = self->merge(*b);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_rect2i_has_point(const godot_rect2i *p_self, const godot_vector2i *p_point) {
|
||||
const Rect2i *self = (const Rect2i *)p_self;
|
||||
const Vector2i *point = (const Vector2i *)p_point;
|
||||
return self->has_point(*point);
|
||||
}
|
||||
|
||||
godot_rect2i GDAPI godot_rect2i_grow(const godot_rect2i *p_self, const godot_int p_by) {
|
||||
godot_rect2i dest;
|
||||
const Rect2i *self = (const Rect2i *)p_self;
|
||||
|
||||
*((Rect2i *)&dest) = self->grow(p_by);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_rect2i GDAPI godot_rect2i_grow_individual(const godot_rect2i *p_self, const godot_int p_left, const godot_int p_top, const godot_int p_right, const godot_int p_bottom) {
|
||||
godot_rect2i dest;
|
||||
const Rect2i *self = (const Rect2i *)p_self;
|
||||
*((Rect2i *)&dest) = self->grow_individual(p_left, p_top, p_right, p_bottom);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_rect2i GDAPI godot_rect2i_grow_side(const godot_rect2i *p_self, const godot_int p_side, const godot_int p_by) {
|
||||
godot_rect2i dest;
|
||||
const Rect2i *self = (const Rect2i *)p_self;
|
||||
*((Rect2i *)&dest) = self->grow_side((Side)p_side, p_by);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_rect2i GDAPI godot_rect2i_abs(const godot_rect2i *p_self) {
|
||||
godot_rect2i dest;
|
||||
const Rect2i *self = (const Rect2i *)p_self;
|
||||
*((Rect2i *)&dest) = self->abs();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_rect2i GDAPI godot_rect2i_expand(const godot_rect2i *p_self, const godot_vector2i *p_to) {
|
||||
godot_rect2i dest;
|
||||
const Rect2i *self = (const Rect2i *)p_self;
|
||||
const Vector2i *to = (const Vector2i *)p_to;
|
||||
*((Rect2i *)&dest) = self->expand(*to);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_rect2i_operator_equal(const godot_rect2i *p_self, const godot_rect2i *p_b) {
|
||||
const Rect2i *self = (const Rect2i *)p_self;
|
||||
const Rect2i *b = (const Rect2i *)p_b;
|
||||
return *self == *b;
|
||||
}
|
||||
|
||||
godot_vector2i GDAPI godot_rect2i_get_position(const godot_rect2i *p_self) {
|
||||
godot_vector2i dest;
|
||||
Vector2i *d = (Vector2i *)&dest;
|
||||
const Rect2i *self = (const Rect2i *)p_self;
|
||||
*d = self->get_position();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector2i GDAPI godot_rect2i_get_size(const godot_rect2i *p_self) {
|
||||
godot_vector2i dest;
|
||||
Vector2i *d = (Vector2i *)&dest;
|
||||
const Rect2i *self = (const Rect2i *)p_self;
|
||||
*d = self->get_size();
|
||||
return dest;
|
||||
}
|
||||
|
||||
void GDAPI godot_rect2i_set_position(godot_rect2i *p_self, const godot_vector2i *p_pos) {
|
||||
Rect2i *self = (Rect2i *)p_self;
|
||||
const Vector2i *position = (const Vector2i *)p_pos;
|
||||
self->set_position(*position);
|
||||
}
|
||||
|
||||
void GDAPI godot_rect2i_set_size(godot_rect2i *p_self, const godot_vector2i *p_size) {
|
||||
Rect2i *self = (Rect2i *)p_self;
|
||||
const Vector2i *size = (const Vector2i *)p_size;
|
||||
self->set_size(*size);
|
||||
void GDAPI godot_rect2i_new(godot_rect2i *p_self) {
|
||||
memnew_placement(p_self, Rect2i);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -30,45 +30,17 @@
|
|||
|
||||
#include "gdnative/rid.h"
|
||||
|
||||
#include "core/io/resource.h"
|
||||
#include "core/os/memory.h"
|
||||
#include "core/templates/rid.h"
|
||||
#include "core/variant/variant.h"
|
||||
|
||||
static_assert(sizeof(godot_rid) == sizeof(RID), "RID size mismatch");
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
static_assert(sizeof(godot_rid) == sizeof(RID), "RID size mismatch");
|
||||
|
||||
void GDAPI godot_rid_new(godot_rid *r_dest) {
|
||||
RID *dest = (RID *)r_dest;
|
||||
memnew_placement(dest, RID);
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_rid_get_id(const godot_rid *p_self) {
|
||||
const RID *self = (const RID *)p_self;
|
||||
return self->get_id();
|
||||
}
|
||||
|
||||
void GDAPI godot_rid_new_with_resource(godot_rid *r_dest, const godot_object *p_from) {
|
||||
const Resource *res_from = Object::cast_to<Resource>((Object *)p_from);
|
||||
godot_rid_new(r_dest);
|
||||
if (res_from) {
|
||||
RID *dest = (RID *)r_dest;
|
||||
*dest = RID(res_from->get_rid());
|
||||
}
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_rid_operator_equal(const godot_rid *p_self, const godot_rid *p_b) {
|
||||
const RID *self = (const RID *)p_self;
|
||||
const RID *b = (const RID *)p_b;
|
||||
return *self == *b;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_rid_operator_less(const godot_rid *p_self, const godot_rid *p_b) {
|
||||
const RID *self = (const RID *)p_self;
|
||||
const RID *b = (const RID *)p_b;
|
||||
return *self < *b;
|
||||
void GDAPI godot_rid_new(godot_rid *p_self) {
|
||||
memnew_placement(p_self, RID);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
/*************************************************************************/
|
||||
/* signal.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
/* "Software"), to deal in the Software without restriction, including */
|
||||
/* without limitation the rights to use, copy, modify, merge, publish, */
|
||||
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
||||
/* permit persons to whom the Software is furnished to do so, subject to */
|
||||
/* the following conditions: */
|
||||
/* */
|
||||
/* The above copyright notice and this permission notice shall be */
|
||||
/* included in all copies or substantial portions of the Software. */
|
||||
/* */
|
||||
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
||||
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
||||
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
||||
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
||||
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
||||
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/*************************************************************************/
|
||||
|
||||
#include "gdnative/signal.h"
|
||||
|
||||
#include "core/variant/callable.h"
|
||||
#include "core/variant/variant.h"
|
||||
|
||||
static_assert(sizeof(godot_signal) == sizeof(Signal), "Signal size mismatch");
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GDAPI godot_signal_new(godot_signal *p_self) {
|
||||
memnew_placement(p_self, Signal);
|
||||
}
|
||||
|
||||
void GDAPI godot_signal_destroy(godot_signal *p_self) {
|
||||
Signal *self = (Signal *)p_self;
|
||||
self->~Signal();
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
|
@ -31,54 +31,27 @@
|
|||
#include "gdnative/string_name.h"
|
||||
|
||||
#include "core/string/string_name.h"
|
||||
#include "core/string/ustring.h"
|
||||
|
||||
#include <string.h>
|
||||
static_assert(sizeof(godot_string_name) == sizeof(StringName), "StringName size mismatch");
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
static_assert(sizeof(godot_string_name) == sizeof(StringName), "StringName size mismatch");
|
||||
|
||||
void GDAPI godot_string_name_new(godot_string_name *r_dest, const godot_string *p_name) {
|
||||
void GDAPI godot_string_name_new(godot_string_name *r_dest) {
|
||||
StringName *dest = (StringName *)r_dest;
|
||||
const String *name = (const String *)p_name;
|
||||
memnew_placement(dest, StringName(*name));
|
||||
memnew_placement(dest, StringName);
|
||||
}
|
||||
|
||||
void GDAPI godot_string_name_new_data(godot_string_name *r_dest, const char *p_name) {
|
||||
void GDAPI godot_string_name_new_copy(godot_string_name *r_dest, const godot_string_name *p_src) {
|
||||
StringName *dest = (StringName *)r_dest;
|
||||
memnew_placement(dest, StringName(p_name));
|
||||
const StringName *src = (const StringName *)p_src;
|
||||
memnew_placement(dest, StringName(*src));
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_string_name_get_name(const godot_string_name *p_self) {
|
||||
godot_string ret;
|
||||
const StringName *self = (const StringName *)p_self;
|
||||
memnew_placement(&ret, String(*self));
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint32_t GDAPI godot_string_name_get_hash(const godot_string_name *p_self) {
|
||||
const StringName *self = (const StringName *)p_self;
|
||||
return self->hash();
|
||||
}
|
||||
|
||||
const void GDAPI *godot_string_name_get_data_unique_pointer(const godot_string_name *p_self) {
|
||||
const StringName *self = (const StringName *)p_self;
|
||||
return self->data_unique_pointer();
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_string_name_operator_equal(const godot_string_name *p_self, const godot_string_name *p_other) {
|
||||
const StringName *self = (const StringName *)p_self;
|
||||
const StringName *other = (const StringName *)p_other;
|
||||
return self == other;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_string_name_operator_less(const godot_string_name *p_self, const godot_string_name *p_other) {
|
||||
const StringName *self = (const StringName *)p_self;
|
||||
const StringName *other = (const StringName *)p_other;
|
||||
return self < other;
|
||||
void GDAPI godot_string_name_new_with_latin1_chars(godot_string_name *r_dest, const char *p_contents) {
|
||||
StringName *dest = (StringName *)r_dest;
|
||||
memnew_placement(dest, StringName(p_contents));
|
||||
}
|
||||
|
||||
void GDAPI godot_string_name_destroy(godot_string_name *p_self) {
|
||||
|
|
|
@ -31,198 +31,15 @@
|
|||
#include "gdnative/transform.h"
|
||||
|
||||
#include "core/math/transform.h"
|
||||
#include "core/variant/variant.h"
|
||||
|
||||
static_assert(sizeof(godot_transform) == sizeof(Transform), "Transform size mismatch");
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
static_assert(sizeof(godot_transform) == sizeof(Transform), "Transform size mismatch");
|
||||
|
||||
void GDAPI godot_transform_new_with_axis_origin(godot_transform *r_dest, const godot_vector3 *p_x_axis, const godot_vector3 *p_y_axis, const godot_vector3 *p_z_axis, const godot_vector3 *p_origin) {
|
||||
const Vector3 *x_axis = (const Vector3 *)p_x_axis;
|
||||
const Vector3 *y_axis = (const Vector3 *)p_y_axis;
|
||||
const Vector3 *z_axis = (const Vector3 *)p_z_axis;
|
||||
const Vector3 *origin = (const Vector3 *)p_origin;
|
||||
Transform *dest = (Transform *)r_dest;
|
||||
dest->basis.set_axis(0, *x_axis);
|
||||
dest->basis.set_axis(1, *y_axis);
|
||||
dest->basis.set_axis(2, *z_axis);
|
||||
dest->origin = *origin;
|
||||
}
|
||||
|
||||
void GDAPI godot_transform_new(godot_transform *r_dest, const godot_basis *p_basis, const godot_vector3 *p_origin) {
|
||||
const Basis *basis = (const Basis *)p_basis;
|
||||
const Vector3 *origin = (const Vector3 *)p_origin;
|
||||
Transform *dest = (Transform *)r_dest;
|
||||
*dest = Transform(*basis, *origin);
|
||||
}
|
||||
|
||||
void GDAPI godot_transform_new_with_quat(godot_transform *r_dest, const godot_quat *p_quat) {
|
||||
const Quat *quat = (const Quat *)p_quat;
|
||||
Transform *dest = (Transform *)r_dest;
|
||||
*dest = Transform(*quat);
|
||||
}
|
||||
|
||||
godot_basis GDAPI godot_transform_get_basis(const godot_transform *p_self) {
|
||||
godot_basis dest;
|
||||
const Transform *self = (const Transform *)p_self;
|
||||
*((Basis *)&dest) = self->basis;
|
||||
return dest;
|
||||
}
|
||||
|
||||
void GDAPI godot_transform_set_basis(godot_transform *p_self, const godot_basis *p_v) {
|
||||
Transform *self = (Transform *)p_self;
|
||||
const Basis *v = (const Basis *)p_v;
|
||||
self->basis = *v;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_transform_get_origin(const godot_transform *p_self) {
|
||||
godot_vector3 dest;
|
||||
const Transform *self = (const Transform *)p_self;
|
||||
*((Vector3 *)&dest) = self->origin;
|
||||
return dest;
|
||||
}
|
||||
|
||||
void GDAPI godot_transform_set_origin(godot_transform *p_self, const godot_vector3 *p_v) {
|
||||
Transform *self = (Transform *)p_self;
|
||||
const Vector3 *v = (const Vector3 *)p_v;
|
||||
self->origin = *v;
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_transform_as_string(const godot_transform *p_self) {
|
||||
godot_string ret;
|
||||
const Transform *self = (const Transform *)p_self;
|
||||
memnew_placement(&ret, String(*self));
|
||||
return ret;
|
||||
}
|
||||
|
||||
godot_transform GDAPI godot_transform_inverse(const godot_transform *p_self) {
|
||||
godot_transform dest;
|
||||
const Transform *self = (const Transform *)p_self;
|
||||
*((Transform *)&dest) = self->inverse();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_transform GDAPI godot_transform_affine_inverse(const godot_transform *p_self) {
|
||||
godot_transform dest;
|
||||
const Transform *self = (const Transform *)p_self;
|
||||
*((Transform *)&dest) = self->affine_inverse();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_transform GDAPI godot_transform_orthonormalized(const godot_transform *p_self) {
|
||||
godot_transform dest;
|
||||
const Transform *self = (const Transform *)p_self;
|
||||
*((Transform *)&dest) = self->orthonormalized();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_transform GDAPI godot_transform_rotated(const godot_transform *p_self, const godot_vector3 *p_axis, const godot_real p_phi) {
|
||||
godot_transform dest;
|
||||
const Transform *self = (const Transform *)p_self;
|
||||
const Vector3 *axis = (const Vector3 *)p_axis;
|
||||
*((Transform *)&dest) = self->rotated(*axis, p_phi);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_transform GDAPI godot_transform_scaled(const godot_transform *p_self, const godot_vector3 *p_scale) {
|
||||
godot_transform dest;
|
||||
const Transform *self = (const Transform *)p_self;
|
||||
const Vector3 *scale = (const Vector3 *)p_scale;
|
||||
*((Transform *)&dest) = self->scaled(*scale);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_transform GDAPI godot_transform_translated(const godot_transform *p_self, const godot_vector3 *p_ofs) {
|
||||
godot_transform dest;
|
||||
const Transform *self = (const Transform *)p_self;
|
||||
const Vector3 *ofs = (const Vector3 *)p_ofs;
|
||||
*((Transform *)&dest) = self->translated(*ofs);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_transform GDAPI godot_transform_looking_at(const godot_transform *p_self, const godot_vector3 *p_target, const godot_vector3 *p_up) {
|
||||
godot_transform dest;
|
||||
const Transform *self = (const Transform *)p_self;
|
||||
const Vector3 *target = (const Vector3 *)p_target;
|
||||
const Vector3 *up = (const Vector3 *)p_up;
|
||||
*((Transform *)&dest) = self->looking_at(*target, *up);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_plane GDAPI godot_transform_xform_plane(const godot_transform *p_self, const godot_plane *p_v) {
|
||||
godot_plane raw_dest;
|
||||
Plane *dest = (Plane *)&raw_dest;
|
||||
const Transform *self = (const Transform *)p_self;
|
||||
const Plane *v = (const Plane *)p_v;
|
||||
*dest = self->xform(*v);
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_plane GDAPI godot_transform_xform_inv_plane(const godot_transform *p_self, const godot_plane *p_v) {
|
||||
godot_plane raw_dest;
|
||||
Plane *dest = (Plane *)&raw_dest;
|
||||
const Transform *self = (const Transform *)p_self;
|
||||
const Plane *v = (const Plane *)p_v;
|
||||
*dest = self->xform_inv(*v);
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
void GDAPI godot_transform_new_identity(godot_transform *r_dest) {
|
||||
Transform *dest = (Transform *)r_dest;
|
||||
*dest = Transform();
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_transform_operator_equal(const godot_transform *p_self, const godot_transform *p_b) {
|
||||
const Transform *self = (const Transform *)p_self;
|
||||
const Transform *b = (const Transform *)p_b;
|
||||
return *self == *b;
|
||||
}
|
||||
|
||||
godot_transform GDAPI godot_transform_operator_multiply(const godot_transform *p_self, const godot_transform *p_b) {
|
||||
godot_transform raw_dest;
|
||||
Transform *dest = (Transform *)&raw_dest;
|
||||
const Transform *self = (const Transform *)p_self;
|
||||
const Transform *b = (const Transform *)p_b;
|
||||
*dest = *self * *b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_transform_xform_vector3(const godot_transform *p_self, const godot_vector3 *p_v) {
|
||||
godot_vector3 raw_dest;
|
||||
Vector3 *dest = (Vector3 *)&raw_dest;
|
||||
const Transform *self = (const Transform *)p_self;
|
||||
const Vector3 *v = (const Vector3 *)p_v;
|
||||
*dest = self->xform(*v);
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_transform_xform_inv_vector3(const godot_transform *p_self, const godot_vector3 *p_v) {
|
||||
godot_vector3 raw_dest;
|
||||
Vector3 *dest = (Vector3 *)&raw_dest;
|
||||
const Transform *self = (const Transform *)p_self;
|
||||
const Vector3 *v = (const Vector3 *)p_v;
|
||||
*dest = self->xform_inv(*v);
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_aabb GDAPI godot_transform_xform_aabb(const godot_transform *p_self, const godot_aabb *p_v) {
|
||||
godot_aabb raw_dest;
|
||||
AABB *dest = (AABB *)&raw_dest;
|
||||
const Transform *self = (const Transform *)p_self;
|
||||
const AABB *v = (const AABB *)p_v;
|
||||
*dest = self->xform(*v);
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_aabb GDAPI godot_transform_xform_inv_aabb(const godot_transform *p_self, const godot_aabb *p_v) {
|
||||
godot_aabb raw_dest;
|
||||
AABB *dest = (AABB *)&raw_dest;
|
||||
const Transform *self = (const Transform *)p_self;
|
||||
const AABB *v = (const AABB *)p_v;
|
||||
*dest = self->xform_inv(*v);
|
||||
return raw_dest;
|
||||
void GDAPI godot_transform_new(godot_transform *p_self) {
|
||||
memnew_placement(p_self, Transform);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -31,179 +31,15 @@
|
|||
#include "gdnative/transform2d.h"
|
||||
|
||||
#include "core/math/transform_2d.h"
|
||||
#include "core/variant/variant.h"
|
||||
|
||||
static_assert(sizeof(godot_transform2d) == sizeof(Transform2D), "Transform2D size mismatch");
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
static_assert(sizeof(godot_transform2d) == sizeof(Transform2D), "Transform2D size mismatch");
|
||||
|
||||
void GDAPI godot_transform2d_new(godot_transform2d *r_dest, const godot_real p_rot, const godot_vector2 *p_pos) {
|
||||
const Vector2 *pos = (const Vector2 *)p_pos;
|
||||
Transform2D *dest = (Transform2D *)r_dest;
|
||||
*dest = Transform2D(p_rot, *pos);
|
||||
}
|
||||
|
||||
void GDAPI godot_transform2d_new_axis_origin(godot_transform2d *r_dest, const godot_vector2 *p_x_axis, const godot_vector2 *p_y_axis, const godot_vector2 *p_origin) {
|
||||
const Vector2 *x_axis = (const Vector2 *)p_x_axis;
|
||||
const Vector2 *y_axis = (const Vector2 *)p_y_axis;
|
||||
const Vector2 *origin = (const Vector2 *)p_origin;
|
||||
Transform2D *dest = (Transform2D *)r_dest;
|
||||
*dest = Transform2D(x_axis->x, x_axis->y, y_axis->x, y_axis->y, origin->x, origin->y);
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_transform2d_as_string(const godot_transform2d *p_self) {
|
||||
godot_string ret;
|
||||
const Transform2D *self = (const Transform2D *)p_self;
|
||||
memnew_placement(&ret, String(*self));
|
||||
return ret;
|
||||
}
|
||||
|
||||
godot_transform2d GDAPI godot_transform2d_inverse(const godot_transform2d *p_self) {
|
||||
godot_transform2d dest;
|
||||
const Transform2D *self = (const Transform2D *)p_self;
|
||||
*((Transform2D *)&dest) = self->inverse();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_transform2d GDAPI godot_transform2d_affine_inverse(const godot_transform2d *p_self) {
|
||||
godot_transform2d dest;
|
||||
const Transform2D *self = (const Transform2D *)p_self;
|
||||
*((Transform2D *)&dest) = self->affine_inverse();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_transform2d_get_rotation(const godot_transform2d *p_self) {
|
||||
const Transform2D *self = (const Transform2D *)p_self;
|
||||
return self->get_rotation();
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_transform2d_get_origin(const godot_transform2d *p_self) {
|
||||
godot_vector2 dest;
|
||||
const Transform2D *self = (const Transform2D *)p_self;
|
||||
*((Vector2 *)&dest) = self->get_origin();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_transform2d_get_scale(const godot_transform2d *p_self) {
|
||||
godot_vector2 dest;
|
||||
const Transform2D *self = (const Transform2D *)p_self;
|
||||
*((Vector2 *)&dest) = self->get_scale();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_transform2d GDAPI godot_transform2d_orthonormalized(const godot_transform2d *p_self) {
|
||||
godot_transform2d dest;
|
||||
const Transform2D *self = (const Transform2D *)p_self;
|
||||
*((Transform2D *)&dest) = self->orthonormalized();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_transform2d GDAPI godot_transform2d_rotated(const godot_transform2d *p_self, const godot_real p_phi) {
|
||||
godot_transform2d dest;
|
||||
const Transform2D *self = (const Transform2D *)p_self;
|
||||
|
||||
*((Transform2D *)&dest) = self->rotated(p_phi);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_transform2d GDAPI godot_transform2d_scaled(const godot_transform2d *p_self, const godot_vector2 *p_scale) {
|
||||
godot_transform2d dest;
|
||||
const Transform2D *self = (const Transform2D *)p_self;
|
||||
const Vector2 *scale = (const Vector2 *)p_scale;
|
||||
*((Transform2D *)&dest) = self->scaled(*scale);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_transform2d GDAPI godot_transform2d_translated(const godot_transform2d *p_self, const godot_vector2 *p_offset) {
|
||||
godot_transform2d dest;
|
||||
const Transform2D *self = (const Transform2D *)p_self;
|
||||
const Vector2 *offset = (const Vector2 *)p_offset;
|
||||
*((Transform2D *)&dest) = self->translated(*offset);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_transform2d_xform_vector2(const godot_transform2d *p_self, const godot_vector2 *p_v) {
|
||||
godot_vector2 raw_dest;
|
||||
Vector2 *dest = (Vector2 *)&raw_dest;
|
||||
const Transform2D *self = (const Transform2D *)p_self;
|
||||
const Vector2 *v = (const Vector2 *)p_v;
|
||||
*dest = self->xform(*v);
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_transform2d_xform_inv_vector2(const godot_transform2d *p_self, const godot_vector2 *p_v) {
|
||||
godot_vector2 raw_dest;
|
||||
Vector2 *dest = (Vector2 *)&raw_dest;
|
||||
const Transform2D *self = (const Transform2D *)p_self;
|
||||
const Vector2 *v = (const Vector2 *)p_v;
|
||||
*dest = self->xform_inv(*v);
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_transform2d_basis_xform_vector2(const godot_transform2d *p_self, const godot_vector2 *p_v) {
|
||||
godot_vector2 raw_dest;
|
||||
Vector2 *dest = (Vector2 *)&raw_dest;
|
||||
const Transform2D *self = (const Transform2D *)p_self;
|
||||
const Vector2 *v = (const Vector2 *)p_v;
|
||||
*dest = self->basis_xform(*v);
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_transform2d_basis_xform_inv_vector2(const godot_transform2d *p_self, const godot_vector2 *p_v) {
|
||||
godot_vector2 raw_dest;
|
||||
Vector2 *dest = (Vector2 *)&raw_dest;
|
||||
const Transform2D *self = (const Transform2D *)p_self;
|
||||
const Vector2 *v = (const Vector2 *)p_v;
|
||||
*dest = self->basis_xform_inv(*v);
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_transform2d GDAPI godot_transform2d_interpolate_with(const godot_transform2d *p_self, const godot_transform2d *p_m, const godot_real p_c) {
|
||||
godot_transform2d dest;
|
||||
const Transform2D *self = (const Transform2D *)p_self;
|
||||
const Transform2D *m = (const Transform2D *)p_m;
|
||||
*((Transform2D *)&dest) = self->interpolate_with(*m, p_c);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_transform2d_operator_equal(const godot_transform2d *p_self, const godot_transform2d *p_b) {
|
||||
const Transform2D *self = (const Transform2D *)p_self;
|
||||
const Transform2D *b = (const Transform2D *)p_b;
|
||||
return *self == *b;
|
||||
}
|
||||
|
||||
godot_transform2d GDAPI godot_transform2d_operator_multiply(const godot_transform2d *p_self, const godot_transform2d *p_b) {
|
||||
godot_transform2d raw_dest;
|
||||
Transform2D *dest = (Transform2D *)&raw_dest;
|
||||
const Transform2D *self = (const Transform2D *)p_self;
|
||||
const Transform2D *b = (const Transform2D *)p_b;
|
||||
*dest = *self * *b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
void GDAPI godot_transform2d_new_identity(godot_transform2d *r_dest) {
|
||||
Transform2D *dest = (Transform2D *)r_dest;
|
||||
*dest = Transform2D();
|
||||
}
|
||||
|
||||
godot_rect2 GDAPI godot_transform2d_xform_rect2(const godot_transform2d *p_self, const godot_rect2 *p_v) {
|
||||
godot_rect2 raw_dest;
|
||||
Rect2 *dest = (Rect2 *)&raw_dest;
|
||||
const Transform2D *self = (const Transform2D *)p_self;
|
||||
const Rect2 *v = (const Rect2 *)p_v;
|
||||
*dest = self->xform(*v);
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_rect2 GDAPI godot_transform2d_xform_inv_rect2(const godot_transform2d *p_self, const godot_rect2 *p_v) {
|
||||
godot_rect2 raw_dest;
|
||||
Rect2 *dest = (Rect2 *)&raw_dest;
|
||||
const Transform2D *self = (const Transform2D *)p_self;
|
||||
const Rect2 *v = (const Rect2 *)p_v;
|
||||
*dest = self->xform_inv(*v);
|
||||
return raw_dest;
|
||||
void GDAPI godot_transform2d_new(godot_transform2d *p_self) {
|
||||
memnew_placement(p_self, Transform2D);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -55,16 +55,11 @@ static_assert(sizeof(godot_variant) == sizeof(Variant), "Variant size mismatch")
|
|||
#pragma GCC pop_options
|
||||
#endif
|
||||
|
||||
// Constructors
|
||||
|
||||
godot_variant_type GDAPI godot_variant_get_type(const godot_variant *p_self) {
|
||||
const Variant *self = (const Variant *)p_self;
|
||||
return (godot_variant_type)self->get_type();
|
||||
}
|
||||
// Memory
|
||||
|
||||
void GDAPI godot_variant_new_copy(godot_variant *p_dest, const godot_variant *p_src) {
|
||||
Variant *dest = (Variant *)p_dest;
|
||||
Variant *src = (Variant *)p_src;
|
||||
const Variant *src = (const Variant *)p_src;
|
||||
memnew_placement(dest, Variant(*src));
|
||||
}
|
||||
|
||||
|
@ -78,139 +73,134 @@ void GDAPI godot_variant_new_bool(godot_variant *r_dest, const godot_bool p_b) {
|
|||
memnew_placement_custom(dest, Variant, Variant(p_b));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_uint(godot_variant *r_dest, const uint64_t p_i) {
|
||||
void GDAPI godot_variant_new_int(godot_variant *r_dest, const godot_int p_i) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
memnew_placement_custom(dest, Variant, Variant(p_i));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_int(godot_variant *r_dest, const int64_t p_i) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
memnew_placement_custom(dest, Variant, Variant(p_i));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_real(godot_variant *r_dest, const double p_r) {
|
||||
void GDAPI godot_variant_new_float(godot_variant *r_dest, const godot_float p_r) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
memnew_placement_custom(dest, Variant, Variant(p_r));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_string(godot_variant *r_dest, const godot_string *p_s) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
String *s = (String *)p_s;
|
||||
const String *s = (const String *)p_s;
|
||||
memnew_placement_custom(dest, Variant, Variant(*s));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_string_name(godot_variant *r_dest, const godot_string_name *p_s) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
StringName *s = (StringName *)p_s;
|
||||
const StringName *s = (const StringName *)p_s;
|
||||
memnew_placement_custom(dest, Variant, Variant(*s));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_vector2(godot_variant *r_dest, const godot_vector2 *p_v2) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
Vector2 *v2 = (Vector2 *)p_v2;
|
||||
const Vector2 *v2 = (const Vector2 *)p_v2;
|
||||
memnew_placement_custom(dest, Variant, Variant(*v2));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_vector2i(godot_variant *r_dest, const godot_vector2i *p_v2) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
Vector2i *v2 = (Vector2i *)p_v2;
|
||||
const Vector2i *v2 = (const Vector2i *)p_v2;
|
||||
memnew_placement_custom(dest, Variant, Variant(*v2));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_rect2(godot_variant *r_dest, const godot_rect2 *p_rect2) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
Rect2 *rect2 = (Rect2 *)p_rect2;
|
||||
const Rect2 *rect2 = (const Rect2 *)p_rect2;
|
||||
memnew_placement_custom(dest, Variant, Variant(*rect2));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_rect2i(godot_variant *r_dest, const godot_rect2i *p_rect2) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
Rect2i *rect2 = (Rect2i *)p_rect2;
|
||||
const Rect2i *rect2 = (const Rect2i *)p_rect2;
|
||||
memnew_placement_custom(dest, Variant, Variant(*rect2));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_vector3(godot_variant *r_dest, const godot_vector3 *p_v3) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
Vector3 *v3 = (Vector3 *)p_v3;
|
||||
const Vector3 *v3 = (const Vector3 *)p_v3;
|
||||
memnew_placement_custom(dest, Variant, Variant(*v3));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_vector3i(godot_variant *r_dest, const godot_vector3i *p_v3) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
Vector3i *v3 = (Vector3i *)p_v3;
|
||||
const Vector3i *v3 = (const Vector3i *)p_v3;
|
||||
memnew_placement_custom(dest, Variant, Variant(*v3));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_transform2d(godot_variant *r_dest, const godot_transform2d *p_t2d) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
Transform2D *t2d = (Transform2D *)p_t2d;
|
||||
const Transform2D *t2d = (const Transform2D *)p_t2d;
|
||||
memnew_placement_custom(dest, Variant, Variant(*t2d));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_plane(godot_variant *r_dest, const godot_plane *p_plane) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
Plane *plane = (Plane *)p_plane;
|
||||
const Plane *plane = (const Plane *)p_plane;
|
||||
memnew_placement_custom(dest, Variant, Variant(*plane));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_quat(godot_variant *r_dest, const godot_quat *p_quat) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
Quat *quat = (Quat *)p_quat;
|
||||
const Quat *quat = (const Quat *)p_quat;
|
||||
memnew_placement_custom(dest, Variant, Variant(*quat));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_aabb(godot_variant *r_dest, const godot_aabb *p_aabb) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
AABB *aabb = (AABB *)p_aabb;
|
||||
const AABB *aabb = (const AABB *)p_aabb;
|
||||
memnew_placement_custom(dest, Variant, Variant(*aabb));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_basis(godot_variant *r_dest, const godot_basis *p_basis) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
Basis *basis = (Basis *)p_basis;
|
||||
const Basis *basis = (const Basis *)p_basis;
|
||||
memnew_placement_custom(dest, Variant, Variant(*basis));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_transform(godot_variant *r_dest, const godot_transform *p_trans) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
Transform *trans = (Transform *)p_trans;
|
||||
const Transform *trans = (const Transform *)p_trans;
|
||||
memnew_placement_custom(dest, Variant, Variant(*trans));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_color(godot_variant *r_dest, const godot_color *p_color) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
Color *color = (Color *)p_color;
|
||||
const Color *color = (const Color *)p_color;
|
||||
memnew_placement_custom(dest, Variant, Variant(*color));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_node_path(godot_variant *r_dest, const godot_node_path *p_np) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
NodePath *np = (NodePath *)p_np;
|
||||
const NodePath *np = (const NodePath *)p_np;
|
||||
memnew_placement_custom(dest, Variant, Variant(*np));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_rid(godot_variant *r_dest, const godot_rid *p_rid) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
RID *rid = (RID *)p_rid;
|
||||
const RID *rid = (const RID *)p_rid;
|
||||
memnew_placement_custom(dest, Variant, Variant(*rid));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_callable(godot_variant *r_dest, const godot_callable *p_cb) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
Callable *cb = (Callable *)p_cb;
|
||||
const Callable *cb = (const Callable *)p_cb;
|
||||
memnew_placement_custom(dest, Variant, Variant(*cb));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_signal(godot_variant *r_dest, const godot_signal *p_signal) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
Signal *signal = (Signal *)p_signal;
|
||||
const Signal *signal = (const Signal *)p_signal;
|
||||
memnew_placement_custom(dest, Variant, Variant(*signal));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_object(godot_variant *r_dest, const godot_object *p_obj) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
Object *obj = (Object *)p_obj;
|
||||
Reference *reference = Object::cast_to<Reference>(obj);
|
||||
const Object *obj = (const Object *)p_obj;
|
||||
const Reference *reference = Object::cast_to<Reference>(obj);
|
||||
REF ref;
|
||||
if (reference) {
|
||||
ref = REF(reference);
|
||||
|
@ -229,67 +219,67 @@ void GDAPI godot_variant_new_object(godot_variant *r_dest, const godot_object *p
|
|||
|
||||
void GDAPI godot_variant_new_dictionary(godot_variant *r_dest, const godot_dictionary *p_dict) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
Dictionary *dict = (Dictionary *)p_dict;
|
||||
const Dictionary *dict = (const Dictionary *)p_dict;
|
||||
memnew_placement_custom(dest, Variant, Variant(*dict));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_array(godot_variant *r_dest, const godot_array *p_arr) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
Array *arr = (Array *)p_arr;
|
||||
const Array *arr = (const Array *)p_arr;
|
||||
memnew_placement_custom(dest, Variant, Variant(*arr));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_packed_byte_array(godot_variant *r_dest, const godot_packed_byte_array *p_pba) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
PackedByteArray *pba = (PackedByteArray *)p_pba;
|
||||
const PackedByteArray *pba = (const PackedByteArray *)p_pba;
|
||||
memnew_placement_custom(dest, Variant, Variant(*pba));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_packed_int32_array(godot_variant *r_dest, const godot_packed_int32_array *p_pia) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
PackedInt32Array *pia = (PackedInt32Array *)p_pia;
|
||||
const PackedInt32Array *pia = (const PackedInt32Array *)p_pia;
|
||||
memnew_placement_custom(dest, Variant, Variant(*pia));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_packed_int64_array(godot_variant *r_dest, const godot_packed_int64_array *p_pia) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
PackedInt64Array *pia = (PackedInt64Array *)p_pia;
|
||||
const PackedInt64Array *pia = (const PackedInt64Array *)p_pia;
|
||||
memnew_placement_custom(dest, Variant, Variant(*pia));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_packed_float32_array(godot_variant *r_dest, const godot_packed_float32_array *p_pra) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
PackedFloat32Array *pra = (PackedFloat32Array *)p_pra;
|
||||
const PackedFloat32Array *pra = (const PackedFloat32Array *)p_pra;
|
||||
memnew_placement_custom(dest, Variant, Variant(*pra));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_packed_float64_array(godot_variant *r_dest, const godot_packed_float64_array *p_pra) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
PackedFloat64Array *pra = (PackedFloat64Array *)p_pra;
|
||||
const PackedFloat64Array *pra = (const PackedFloat64Array *)p_pra;
|
||||
memnew_placement_custom(dest, Variant, Variant(*pra));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_packed_string_array(godot_variant *r_dest, const godot_packed_string_array *p_psa) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
PackedStringArray *psa = (PackedStringArray *)p_psa;
|
||||
const PackedStringArray *psa = (const PackedStringArray *)p_psa;
|
||||
memnew_placement_custom(dest, Variant, Variant(*psa));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_packed_vector2_array(godot_variant *r_dest, const godot_packed_vector2_array *p_pv2a) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
PackedVector2Array *pv2a = (PackedVector2Array *)p_pv2a;
|
||||
const PackedVector2Array *pv2a = (const PackedVector2Array *)p_pv2a;
|
||||
memnew_placement_custom(dest, Variant, Variant(*pv2a));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_packed_vector3_array(godot_variant *r_dest, const godot_packed_vector3_array *p_pv3a) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
PackedVector3Array *pv3a = (PackedVector3Array *)p_pv3a;
|
||||
const PackedVector3Array *pv3a = (const PackedVector3Array *)p_pv3a;
|
||||
memnew_placement_custom(dest, Variant, Variant(*pv3a));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_new_packed_color_array(godot_variant *r_dest, const godot_packed_color_array *p_pca) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
PackedColorArray *pca = (PackedColorArray *)p_pca;
|
||||
const PackedColorArray *pca = (const PackedColorArray *)p_pca;
|
||||
memnew_placement_custom(dest, Variant, Variant(*pca));
|
||||
}
|
||||
|
||||
|
@ -298,17 +288,12 @@ godot_bool GDAPI godot_variant_as_bool(const godot_variant *p_self) {
|
|||
return self->operator bool();
|
||||
}
|
||||
|
||||
uint64_t GDAPI godot_variant_as_uint(const godot_variant *p_self) {
|
||||
const Variant *self = (const Variant *)p_self;
|
||||
return self->operator uint64_t();
|
||||
}
|
||||
|
||||
int64_t GDAPI godot_variant_as_int(const godot_variant *p_self) {
|
||||
godot_int GDAPI godot_variant_as_int(const godot_variant *p_self) {
|
||||
const Variant *self = (const Variant *)p_self;
|
||||
return self->operator int64_t();
|
||||
}
|
||||
|
||||
double GDAPI godot_variant_as_real(const godot_variant *p_self) {
|
||||
godot_float GDAPI godot_variant_as_float(const godot_variant *p_self) {
|
||||
const Variant *self = (const Variant *)p_self;
|
||||
return self->operator double();
|
||||
}
|
||||
|
@ -569,47 +554,137 @@ godot_packed_color_array GDAPI godot_variant_as_packed_color_array(const godot_v
|
|||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_variant GDAPI godot_variant_call(godot_variant *p_self, const godot_string *p_method, const godot_variant **p_args, const godot_int p_argcount, godot_variant_call_error *r_error) {
|
||||
void GDAPI godot_variant_destroy(godot_variant *p_self) {
|
||||
Variant *self = (Variant *)p_self;
|
||||
String *method = (String *)p_method;
|
||||
self->~Variant();
|
||||
}
|
||||
|
||||
// Dynamic interaction.
|
||||
|
||||
void GDAPI godot_variant_call(godot_variant *p_self, const godot_string_name *p_method, const godot_variant **p_args, const godot_int p_argcount, godot_variant *r_return, godot_variant_call_error *r_error) {
|
||||
Variant *self = (Variant *)p_self;
|
||||
const StringName *method = (const StringName *)p_method;
|
||||
const Variant **args = (const Variant **)p_args;
|
||||
godot_variant raw_dest;
|
||||
Variant *dest = (Variant *)&raw_dest;
|
||||
Callable::CallError error;
|
||||
Variant ret;
|
||||
Callable::CallError error;
|
||||
self->call(*method, args, p_argcount, ret, error);
|
||||
memnew_placement_custom(dest, Variant, Variant(ret));
|
||||
memnew_placement_custom(r_return, Variant, Variant(ret));
|
||||
|
||||
if (r_error) {
|
||||
r_error->error = (godot_variant_call_error_error)error.error;
|
||||
r_error->argument = error.argument;
|
||||
r_error->expected = (godot_variant_type)error.expected;
|
||||
}
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_variant_has_method(const godot_variant *p_self, const godot_string *p_method) {
|
||||
void GDAPI godot_variant_evaluate(godot_variant_operator p_op, const godot_variant *p_a, const godot_variant *p_b, godot_variant *r_return, 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_return;
|
||||
Variant::evaluate(op, *a, *b, *ret, *r_valid);
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_set(godot_variant *p_self, const godot_variant *p_key, const godot_variant *p_value, bool *r_valid) {
|
||||
Variant *self = (Variant *)p_self;
|
||||
const Variant *key = (const Variant *)p_key;
|
||||
const Variant *value = (const Variant *)p_value;
|
||||
|
||||
self->set(*key, *value, r_valid);
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_set_named(godot_variant *p_self, const godot_string_name *p_name, const godot_variant *p_value, bool *r_valid) {
|
||||
Variant *self = (Variant *)p_self;
|
||||
const StringName *name = (const StringName *)p_name;
|
||||
const Variant *value = (const Variant *)p_value;
|
||||
|
||||
self->set_named(*name, *value, *r_valid);
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_set_keyed(godot_variant *p_self, const godot_variant *p_key, const godot_variant *p_value, bool *r_valid) {
|
||||
Variant *self = (Variant *)p_self;
|
||||
const Variant *key = (const Variant *)p_key;
|
||||
const Variant *value = (const Variant *)p_value;
|
||||
|
||||
self->set_keyed(*key, *value, *r_valid);
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_set_indexed(godot_variant *p_self, godot_int p_index, const godot_variant *p_value, bool *r_valid, bool *r_oob) {
|
||||
Variant *self = (Variant *)p_self;
|
||||
const Variant *value = (const Variant *)p_value;
|
||||
|
||||
self->set_indexed(p_index, value, *r_valid, *r_oob);
|
||||
}
|
||||
|
||||
godot_variant GDAPI godot_variant_get(const godot_variant *p_self, const godot_variant *p_key, bool *r_valid) {
|
||||
const Variant *self = (const Variant *)p_self;
|
||||
const String *method = (const String *)p_method;
|
||||
return self->has_method(*method);
|
||||
const Variant *key = (const Variant *)p_key;
|
||||
Variant ret;
|
||||
|
||||
ret = self->get(*key, r_valid);
|
||||
godot_variant result;
|
||||
memnew_placement_custom(&result, Variant, Variant(ret));
|
||||
return result;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_variant_operator_equal(const godot_variant *p_self, const godot_variant *p_other) {
|
||||
godot_variant GDAPI godot_variant_get_named(const godot_variant *p_self, const godot_string_name *p_key, bool *r_valid) {
|
||||
const Variant *self = (const Variant *)p_self;
|
||||
const Variant *other = (const Variant *)p_other;
|
||||
return self->operator==(*other);
|
||||
const StringName *key = (const StringName *)p_key;
|
||||
Variant ret;
|
||||
|
||||
ret = self->get_named(*key, *r_valid);
|
||||
godot_variant result;
|
||||
memnew_placement_custom(&result, Variant, Variant(ret));
|
||||
return result;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_variant_operator_less(const godot_variant *p_self, const godot_variant *p_other) {
|
||||
godot_variant GDAPI godot_variant_get_keyed(const godot_variant *p_self, const godot_variant *p_key, bool *r_valid) {
|
||||
const Variant *self = (const Variant *)p_self;
|
||||
const Variant *other = (const Variant *)p_other;
|
||||
return self->operator<(*other);
|
||||
const Variant *key = (const Variant *)p_key;
|
||||
Variant ret;
|
||||
|
||||
ret = self->get_keyed(*key, *r_valid);
|
||||
godot_variant result;
|
||||
memnew_placement_custom(&result, Variant, Variant(ret));
|
||||
return result;
|
||||
}
|
||||
|
||||
uint32_t GDAPI godot_variant_hash(const godot_variant *p_self) {
|
||||
godot_variant GDAPI godot_variant_get_indexed(const godot_variant *p_self, godot_int p_index, bool *r_valid, bool *r_oob) {
|
||||
const Variant *self = (const Variant *)p_self;
|
||||
return self->hash();
|
||||
Variant ret;
|
||||
|
||||
ret = self->get_indexed(p_index, *r_valid, *r_oob);
|
||||
godot_variant result;
|
||||
memnew_placement_custom(&result, Variant, Variant(ret));
|
||||
return result;
|
||||
}
|
||||
|
||||
/// Iteration.
|
||||
bool GDAPI godot_variant_iter_init(const godot_variant *p_self, godot_variant *r_iter, bool *r_valid) {
|
||||
const Variant *self = (const Variant *)p_self;
|
||||
Variant *iter = (Variant *)r_iter;
|
||||
|
||||
return self->iter_init(*iter, *r_valid);
|
||||
}
|
||||
|
||||
bool GDAPI godot_variant_iter_next(const godot_variant *p_self, godot_variant *r_iter, bool *r_valid) {
|
||||
const Variant *self = (const Variant *)p_self;
|
||||
Variant *iter = (Variant *)r_iter;
|
||||
|
||||
return self->iter_next(*iter, *r_valid);
|
||||
}
|
||||
|
||||
godot_variant GDAPI godot_variant_iter_get(const godot_variant *p_self, godot_variant *r_iter, bool *r_valid) {
|
||||
const Variant *self = (const Variant *)p_self;
|
||||
Variant *iter = (Variant *)r_iter;
|
||||
|
||||
Variant result = self->iter_next(*iter, *r_valid);
|
||||
godot_variant ret;
|
||||
memnew_placement_custom(&ret, Variant, Variant(result));
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// Variant functions.
|
||||
godot_bool GDAPI godot_variant_hash_compare(const godot_variant *p_self, const godot_variant *p_other) {
|
||||
const Variant *self = (const Variant *)p_self;
|
||||
const Variant *other = (const Variant *)p_other;
|
||||
|
@ -621,27 +696,487 @@ godot_bool GDAPI godot_variant_booleanize(const godot_variant *p_self) {
|
|||
return self->booleanize();
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_destroy(godot_variant *p_self) {
|
||||
Variant *self = (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;
|
||||
void GDAPI godot_variant_blend(const godot_variant *p_a, const godot_variant *p_b, float p_c, godot_variant *r_dst) {
|
||||
const Variant *a = (const Variant *)p_a;
|
||||
const Variant *b = (const Variant *)p_b;
|
||||
Variant *dst = (Variant *)r_dst;
|
||||
Variant::blend(*a, *b, p_c, *dst);
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_interpolate(const godot_variant *p_a, const godot_variant *p_b, float p_c, godot_variant *r_dst) {
|
||||
const Variant *a = (const Variant *)p_a;
|
||||
const Variant *b = (const Variant *)p_b;
|
||||
Variant *dst = (Variant *)r_dst;
|
||||
Variant::interpolate(*a, *b, p_c, *dst);
|
||||
}
|
||||
|
||||
godot_variant GDAPI godot_variant_duplicate(const godot_variant *p_self, godot_bool p_deep) {
|
||||
const Variant *self = (const Variant *)p_self;
|
||||
Variant result = self->duplicate(p_deep);
|
||||
godot_variant ret;
|
||||
memnew_placement_custom(&ret, Variant, Variant(result));
|
||||
return ret;
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_variant_stringify(const godot_variant *p_self) {
|
||||
const Variant *self = (const Variant *)p_self;
|
||||
String result = *self;
|
||||
godot_string ret;
|
||||
memnew_placement_custom(&ret, String, String(result));
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Discovery API
|
||||
|
||||
/// Operators
|
||||
godot_validated_operator_evaluator GDAPI godot_variant_get_validated_operator_evaluator(godot_variant_operator p_operator, godot_variant_type p_type_a, godot_variant_type p_type_b) {
|
||||
return (godot_validated_operator_evaluator)Variant::get_validated_operator_evaluator((Variant::Operator)p_operator, (Variant::Type)p_type_a, (Variant::Type)p_type_b);
|
||||
}
|
||||
|
||||
godot_ptr_operator_evaluator GDAPI godot_variant_get_ptr_operator_evaluator(godot_variant_operator p_operator, godot_variant_type p_type_a, godot_variant_type p_type_b) {
|
||||
return (godot_ptr_operator_evaluator)Variant::get_ptr_operator_evaluator((Variant::Operator)p_operator, (Variant::Type)p_type_a, (Variant::Type)p_type_b);
|
||||
}
|
||||
|
||||
godot_variant_type GDAPI godot_variant_get_operator_return_type(godot_variant_operator p_operator, godot_variant_type p_type_a, godot_variant_type p_type_b) {
|
||||
return (godot_variant_type)Variant::get_operator_return_type((Variant::Operator)p_operator, (Variant::Type)p_type_a, (Variant::Type)p_type_b);
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_variant_get_operator_name(godot_variant_operator p_operator) {
|
||||
String op_name = Variant::get_operator_name((Variant::Operator)p_operator);
|
||||
godot_string ret;
|
||||
memnew_placement_custom(&ret, String, String(op_name));
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// Built-in Methods
|
||||
|
||||
bool GDAPI godot_variant_has_builtin_method(godot_variant_type p_type, const godot_string_name *p_method) {
|
||||
return Variant::has_builtin_method((Variant::Type)p_type, *((const StringName *)p_method));
|
||||
}
|
||||
|
||||
bool GDAPI godot_variant_has_builtin_method_with_cstring(godot_variant_type p_type, const char *p_method) {
|
||||
return Variant::has_builtin_method((Variant::Type)p_type, StringName(p_method));
|
||||
}
|
||||
|
||||
godot_validated_builtin_method GDAPI godot_variant_get_validated_builtin_method(godot_variant_type p_type, const godot_string_name *p_method) {
|
||||
return (godot_validated_builtin_method)Variant::get_validated_builtin_method((Variant::Type)p_type, *((const StringName *)p_method));
|
||||
}
|
||||
|
||||
godot_validated_builtin_method GDAPI godot_variant_get_validated_builtin_method_with_cstring(godot_variant_type p_type, const char *p_method) {
|
||||
return (godot_validated_builtin_method)Variant::get_validated_builtin_method((Variant::Type)p_type, StringName(p_method));
|
||||
}
|
||||
|
||||
godot_ptr_builtin_method GDAPI godot_variant_get_ptr_builtin_method(godot_variant_type p_type, const godot_string_name *p_method) {
|
||||
return (godot_ptr_builtin_method)Variant::get_ptr_builtin_method((Variant::Type)p_type, *((const StringName *)p_method));
|
||||
}
|
||||
|
||||
godot_ptr_builtin_method GDAPI godot_variant_get_ptr_builtin_method_with_cstring(godot_variant_type p_type, const char *p_method) {
|
||||
return (godot_ptr_builtin_method)Variant::get_ptr_builtin_method((Variant::Type)p_type, StringName(p_method));
|
||||
}
|
||||
|
||||
int GDAPI godot_variant_get_builtin_method_argument_count(godot_variant_type p_type, const godot_string_name *p_method) {
|
||||
return Variant::get_builtin_method_argument_count((Variant::Type)p_type, *((const StringName *)p_method));
|
||||
}
|
||||
|
||||
int GDAPI godot_variant_get_builtin_method_argument_count_with_cstring(godot_variant_type p_type, const char *p_method) {
|
||||
return Variant::get_builtin_method_argument_count((Variant::Type)p_type, StringName(p_method));
|
||||
}
|
||||
|
||||
godot_variant_type GDAPI godot_variant_get_builtin_method_argument_type(godot_variant_type p_type, const godot_string_name *p_method, int p_argument) {
|
||||
return (godot_variant_type)Variant::get_builtin_method_argument_type((Variant::Type)p_type, *((const StringName *)p_method), p_argument);
|
||||
}
|
||||
|
||||
godot_variant_type GDAPI godot_variant_get_builtin_method_argument_type_with_cstring(godot_variant_type p_type, const char *p_method, int p_argument) {
|
||||
return (godot_variant_type)Variant::get_builtin_method_argument_type((Variant::Type)p_type, StringName(p_method), p_argument);
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_variant_get_builtin_method_argument_name(godot_variant_type p_type, const godot_string_name *p_method, int p_argument) {
|
||||
String name = Variant::get_builtin_method_argument_name((Variant::Type)p_type, *((const StringName *)p_method), p_argument);
|
||||
return *(godot_string *)&name;
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_variant_get_builtin_method_argument_name_with_cstring(godot_variant_type p_type, const char *p_method, int p_argument) {
|
||||
String name = Variant::get_builtin_method_argument_name((Variant::Type)p_type, StringName(p_method), p_argument);
|
||||
return *(godot_string *)&name;
|
||||
}
|
||||
|
||||
bool GDAPI godot_variant_has_builtin_method_return_value(godot_variant_type p_type, const godot_string_name *p_method) {
|
||||
return Variant::has_builtin_method_return_value((Variant::Type)p_type, *((const StringName *)p_method));
|
||||
}
|
||||
|
||||
bool GDAPI godot_variant_has_builtin_method_return_value_with_cstring(godot_variant_type p_type, const char *p_method) {
|
||||
return Variant::has_builtin_method_return_value((Variant::Type)p_type, StringName(p_method));
|
||||
}
|
||||
|
||||
godot_variant_type GDAPI godot_variant_get_builtin_method_return_type(godot_variant_type p_type, const godot_string_name *p_method) {
|
||||
return (godot_variant_type)Variant::get_builtin_method_return_type((Variant::Type)p_type, *((const StringName *)p_method));
|
||||
}
|
||||
|
||||
godot_variant_type GDAPI godot_variant_get_builtin_method_return_type_with_cstring(godot_variant_type p_type, const char *p_method) {
|
||||
return (godot_variant_type)Variant::get_builtin_method_return_type((Variant::Type)p_type, StringName(p_method));
|
||||
}
|
||||
|
||||
bool GDAPI godot_variant_is_builtin_method_const(godot_variant_type p_type, const godot_string_name *p_method) {
|
||||
return Variant::is_builtin_method_const((Variant::Type)p_type, *((const StringName *)p_method));
|
||||
}
|
||||
|
||||
bool GDAPI godot_variant_is_builtin_method_const_with_cstring(godot_variant_type p_type, const char *p_method) {
|
||||
return Variant::is_builtin_method_const((Variant::Type)p_type, StringName(p_method));
|
||||
}
|
||||
|
||||
bool GDAPI godot_variant_is_builtin_method_vararg(godot_variant_type p_type, const godot_string_name *p_method) {
|
||||
return Variant::is_builtin_method_vararg((Variant::Type)p_type, *((const StringName *)p_method));
|
||||
}
|
||||
|
||||
bool GDAPI godot_variant_is_builtin_method_vararg_with_cstring(godot_variant_type p_type, const char *p_method) {
|
||||
return Variant::is_builtin_method_vararg((Variant::Type)p_type, StringName(p_method));
|
||||
}
|
||||
|
||||
int GDAPI godot_variant_get_builtin_method_count(godot_variant_type p_type) {
|
||||
return Variant::get_builtin_method_count((Variant::Type)p_type);
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_get_builtin_method_list(godot_variant_type p_type, godot_string_name *r_list) {
|
||||
List<StringName> list;
|
||||
Variant::get_builtin_method_list((Variant::Type)p_type, &list);
|
||||
int i = 0;
|
||||
for (const List<StringName>::Element *E = list.front(); E; E = E->next()) {
|
||||
memnew_placement_custom(&r_list[i], StringName, StringName(E->get()));
|
||||
}
|
||||
}
|
||||
|
||||
/// Constructors
|
||||
|
||||
int GDAPI godot_variant_get_constructor_count(godot_variant_type p_type) {
|
||||
return Variant::get_constructor_count((Variant::Type)p_type);
|
||||
}
|
||||
|
||||
godot_validated_constructor GDAPI godot_variant_get_validated_constructor(godot_variant_type p_type, int p_constructor) {
|
||||
return (godot_validated_constructor)Variant::get_validated_constructor((Variant::Type)p_type, p_constructor);
|
||||
}
|
||||
|
||||
godot_ptr_constructor GDAPI godot_variant_get_ptr_constructor(godot_variant_type p_type, int p_constructor) {
|
||||
return (godot_ptr_constructor)Variant::get_ptr_constructor((Variant::Type)p_type, p_constructor);
|
||||
}
|
||||
|
||||
int GDAPI godot_variant_get_constructor_argument_count(godot_variant_type p_type, int p_constructor) {
|
||||
return Variant::get_constructor_argument_count((Variant::Type)p_type, p_constructor);
|
||||
}
|
||||
|
||||
godot_variant_type GDAPI godot_variant_get_constructor_argument_type(godot_variant_type p_type, int p_constructor, int p_argument) {
|
||||
return (godot_variant_type)Variant::get_constructor_argument_type((Variant::Type)p_type, p_constructor, p_argument);
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_variant_get_constructor_argument_name(godot_variant_type p_type, int p_constructor, int p_argument) {
|
||||
String name = Variant::get_constructor_argument_name((Variant::Type)p_type, p_constructor, p_argument);
|
||||
godot_string ret;
|
||||
memnew_placement(&ret, String(name));
|
||||
return ret;
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_construct(godot_variant_type p_type, godot_variant *p_base, const godot_variant **p_args, int p_argcount, godot_variant_call_error *r_error) {
|
||||
Variant::construct((Variant::Type)p_type, *((Variant *)p_base), (const Variant **)p_args, p_argcount, *((Callable::CallError *)r_error));
|
||||
}
|
||||
|
||||
/// Properties.
|
||||
godot_variant_type GDAPI godot_variant_get_member_type(godot_variant_type p_type, const godot_string_name *p_member) {
|
||||
return (godot_variant_type)Variant::get_member_type((Variant::Type)p_type, *((const StringName *)p_member));
|
||||
}
|
||||
|
||||
godot_variant_type GDAPI godot_variant_get_member_type_with_cstring(godot_variant_type p_type, const char *p_member) {
|
||||
return (godot_variant_type)Variant::get_member_type((Variant::Type)p_type, StringName(p_member));
|
||||
}
|
||||
|
||||
int GDAPI godot_variant_get_member_count(godot_variant_type p_type) {
|
||||
return Variant::get_member_count((Variant::Type)p_type);
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_get_member_list(godot_variant_type p_type, godot_string_name *r_list) {
|
||||
List<StringName> members;
|
||||
Variant::get_member_list((Variant::Type)p_type, &members);
|
||||
int i = 0;
|
||||
for (const List<StringName>::Element *E = members.front(); E; E = E->next()) {
|
||||
memnew_placement_custom(&r_list[i++], StringName, StringName(E->get()));
|
||||
}
|
||||
}
|
||||
|
||||
godot_validated_setter GDAPI godot_variant_get_validated_setter(godot_variant_type p_type, const godot_string_name *p_member) {
|
||||
return (godot_validated_setter)Variant::get_member_validated_setter((Variant::Type)p_type, *((const StringName *)p_member));
|
||||
}
|
||||
|
||||
godot_validated_setter GDAPI godot_variant_get_validated_setter_with_cstring(godot_variant_type p_type, const char *p_member) {
|
||||
return (godot_validated_setter)Variant::get_member_validated_setter((Variant::Type)p_type, StringName(p_member));
|
||||
}
|
||||
|
||||
godot_validated_getter GDAPI godot_variant_get_validated_getter(godot_variant_type p_type, const godot_string_name *p_member) {
|
||||
return (godot_validated_getter)Variant::get_member_validated_getter((Variant::Type)p_type, *((const StringName *)p_member));
|
||||
}
|
||||
|
||||
godot_validated_getter GDAPI godot_variant_get_validated_getter_with_cstring(godot_variant_type p_type, const char *p_member) {
|
||||
return (godot_validated_getter)Variant::get_member_validated_getter((Variant::Type)p_type, StringName(p_member));
|
||||
}
|
||||
|
||||
godot_ptr_setter GDAPI godot_variant_get_ptr_setter(godot_variant_type p_type, const godot_string_name *p_member) {
|
||||
return (godot_ptr_setter)Variant::get_member_ptr_setter((Variant::Type)p_type, *((const StringName *)p_member));
|
||||
}
|
||||
|
||||
godot_ptr_setter GDAPI godot_variant_get_ptr_setter_with_cstring(godot_variant_type p_type, const char *p_member) {
|
||||
return (godot_ptr_setter)Variant::get_member_ptr_setter((Variant::Type)p_type, StringName(p_member));
|
||||
}
|
||||
|
||||
godot_ptr_getter GDAPI godot_variant_get_ptr_getter(godot_variant_type p_type, const godot_string_name *p_member) {
|
||||
return (godot_ptr_getter)Variant::get_member_ptr_getter((Variant::Type)p_type, *((const StringName *)p_member));
|
||||
}
|
||||
|
||||
godot_ptr_getter GDAPI godot_variant_get_ptr_getter_with_cstring(godot_variant_type p_type, const char *p_member) {
|
||||
return (godot_ptr_getter)Variant::get_member_ptr_getter((Variant::Type)p_type, StringName(p_member));
|
||||
}
|
||||
|
||||
/// Indexing.
|
||||
bool GDAPI godot_variant_has_indexing(godot_variant_type p_type) {
|
||||
return Variant::has_indexing((Variant::Type)p_type);
|
||||
}
|
||||
|
||||
godot_variant_type GDAPI godot_variant_get_indexed_element_type(godot_variant_type p_type) {
|
||||
return (godot_variant_type)Variant::get_indexed_element_type((Variant::Type)p_type);
|
||||
}
|
||||
|
||||
godot_validated_indexed_setter GDAPI godot_variant_get_validated_indexed_setter(godot_variant_type p_type) {
|
||||
return (godot_validated_indexed_setter)Variant::get_member_validated_indexed_setter((Variant::Type)p_type);
|
||||
}
|
||||
|
||||
godot_validated_indexed_getter GDAPI godot_variant_get_validated_indexed_getter(godot_variant_type p_type) {
|
||||
return (godot_validated_indexed_getter)Variant::get_member_validated_indexed_getter((Variant::Type)p_type);
|
||||
}
|
||||
|
||||
godot_ptr_indexed_setter GDAPI godot_variant_get_ptr_indexed_setter(godot_variant_type p_type) {
|
||||
return (godot_ptr_indexed_setter)Variant::get_member_ptr_indexed_setter((Variant::Type)p_type);
|
||||
}
|
||||
|
||||
godot_ptr_indexed_getter GDAPI godot_variant_get_ptr_indexed_getter(godot_variant_type p_type) {
|
||||
return (godot_ptr_indexed_getter)Variant::get_member_ptr_indexed_getter((Variant::Type)p_type);
|
||||
}
|
||||
|
||||
uint64_t GDAPI godot_variant_get_indexed_size(const godot_variant *p_self) {
|
||||
const Variant *self = (const Variant *)p_self;
|
||||
return self->get_indexed_size();
|
||||
}
|
||||
|
||||
/// Keying.
|
||||
bool GDAPI godot_variant_is_keyed(godot_variant_type p_type) {
|
||||
return Variant::is_keyed((Variant::Type)p_type);
|
||||
}
|
||||
|
||||
godot_validated_keyed_setter GDAPI godot_variant_get_validated_keyed_setter(godot_variant_type p_type) {
|
||||
return (godot_validated_keyed_setter)Variant::get_member_validated_keyed_setter((Variant::Type)p_type);
|
||||
}
|
||||
|
||||
godot_validated_keyed_getter GDAPI godot_variant_get_validated_keyed_getter(godot_variant_type p_type) {
|
||||
return (godot_validated_keyed_getter)Variant::get_member_validated_keyed_getter((Variant::Type)p_type);
|
||||
}
|
||||
|
||||
godot_validated_keyed_checker GDAPI godot_variant_get_validated_keyed_checker(godot_variant_type p_type) {
|
||||
return (godot_validated_keyed_checker)Variant::get_member_validated_keyed_checker((Variant::Type)p_type);
|
||||
}
|
||||
|
||||
godot_ptr_keyed_setter GDAPI godot_variant_get_ptr_keyed_setter(godot_variant_type p_type) {
|
||||
return (godot_ptr_keyed_setter)Variant::get_member_ptr_keyed_setter((Variant::Type)p_type);
|
||||
}
|
||||
|
||||
godot_ptr_keyed_getter GDAPI godot_variant_get_ptr_keyed_getter(godot_variant_type p_type) {
|
||||
return (godot_ptr_keyed_getter)Variant::get_member_ptr_keyed_getter((Variant::Type)p_type);
|
||||
}
|
||||
|
||||
godot_ptr_keyed_checker GDAPI godot_variant_get_ptr_keyed_checker(godot_variant_type p_type) {
|
||||
return (godot_ptr_keyed_checker)Variant::get_member_ptr_keyed_checker((Variant::Type)p_type);
|
||||
}
|
||||
|
||||
/// Constants.
|
||||
int GDAPI godot_variant_get_constants_count(godot_variant_type p_type) {
|
||||
return Variant::get_constants_count_for_type((Variant::Type)p_type);
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_get_constants_list(godot_variant_type p_type, godot_string_name *r_list) {
|
||||
List<StringName> constants;
|
||||
int i = 0;
|
||||
Variant::get_constants_for_type((Variant::Type)p_type, &constants);
|
||||
for (const List<StringName>::Element *E = constants.front(); E; E = E->next()) {
|
||||
memnew_placement_custom(&r_list[i++], StringName, StringName(E->get()));
|
||||
}
|
||||
}
|
||||
|
||||
bool GDAPI godot_variant_has_constant(godot_variant_type p_type, const godot_string_name *p_constant) {
|
||||
return Variant::has_constant((Variant::Type)p_type, *((const StringName *)p_constant));
|
||||
}
|
||||
|
||||
bool GDAPI godot_variant_has_constant_with_cstring(godot_variant_type p_type, const char *p_constant) {
|
||||
return Variant::has_constant((Variant::Type)p_type, StringName(p_constant));
|
||||
}
|
||||
|
||||
godot_variant GDAPI godot_variant_get_constant_value(godot_variant_type p_type, const godot_string_name *p_constant) {
|
||||
Variant constant = Variant::get_constant_value((Variant::Type)p_type, *((const StringName *)p_constant));
|
||||
godot_variant ret;
|
||||
memnew_placement_custom(&ret, Variant, Variant(constant));
|
||||
return ret;
|
||||
}
|
||||
|
||||
godot_variant GDAPI godot_variant_get_constant_value_with_cstring(godot_variant_type p_type, const char *p_constant) {
|
||||
Variant constant = Variant::get_constant_value((Variant::Type)p_type, StringName(p_constant));
|
||||
godot_variant ret;
|
||||
memnew_placement_custom(&ret, Variant, Variant(constant));
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// Utilities.
|
||||
bool GDAPI godot_variant_has_utility_function(const godot_string_name *p_function) {
|
||||
return Variant::has_utility_function(*((const StringName *)p_function));
|
||||
}
|
||||
|
||||
bool GDAPI godot_variant_has_utility_function_with_cstring(const char *p_function) {
|
||||
return Variant::has_utility_function(StringName(p_function));
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_call_utility_function(const godot_string_name *p_function, godot_variant *r_ret, const godot_variant **p_args, int p_argument_count, godot_variant_call_error *r_error) {
|
||||
const StringName *function = (const StringName *)p_function;
|
||||
Variant *ret = (Variant *)r_ret;
|
||||
Variant::evaluate(op, *a, *b, *ret, *r_valid);
|
||||
const Variant **args = (const Variant **)p_args;
|
||||
Callable::CallError error;
|
||||
|
||||
Variant::call_utility_function(*function, ret, args, p_argument_count, error);
|
||||
|
||||
if (r_error) {
|
||||
r_error->error = (godot_variant_call_error_error)error.error;
|
||||
r_error->argument = error.argument;
|
||||
r_error->expected = (godot_variant_type)error.expected;
|
||||
}
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_call_utility_function_with_cstring(const char *p_function, godot_variant *r_ret, const godot_variant **p_args, int p_argument_count, godot_variant_call_error *r_error) {
|
||||
Variant *ret = (Variant *)r_ret;
|
||||
const Variant **args = (const Variant **)p_args;
|
||||
Callable::CallError error;
|
||||
|
||||
Variant::call_utility_function(StringName(p_function), ret, args, p_argument_count, error);
|
||||
|
||||
if (r_error) {
|
||||
r_error->error = (godot_variant_call_error_error)error.error;
|
||||
r_error->argument = error.argument;
|
||||
r_error->expected = (godot_variant_type)error.expected;
|
||||
}
|
||||
}
|
||||
|
||||
godot_variant_utility_function_type GDAPI godot_variant_get_utility_function_type(const godot_string_name *p_function) {
|
||||
return (godot_variant_utility_function_type)Variant::get_utility_function_type(*((const StringName *)p_function));
|
||||
}
|
||||
|
||||
godot_variant_utility_function_type GDAPI godot_variant_get_utility_function_type_with_cstring(const char *p_function) {
|
||||
return (godot_variant_utility_function_type)Variant::get_utility_function_type(StringName(p_function));
|
||||
}
|
||||
|
||||
int GDAPI godot_variant_get_utility_function_argument_count(const godot_string_name *p_function) {
|
||||
return Variant::get_utility_function_argument_count(*((const StringName *)p_function));
|
||||
}
|
||||
|
||||
int GDAPI godot_variant_get_utility_function_argument_count_with_cstring(const char *p_function) {
|
||||
return Variant::get_utility_function_argument_count(StringName(p_function));
|
||||
}
|
||||
|
||||
godot_variant_type GDAPI godot_variant_get_utility_function_argument_type(const godot_string_name *p_function, int p_argument) {
|
||||
return (godot_variant_type)Variant::get_utility_function_argument_type(*((const StringName *)p_function), p_argument);
|
||||
}
|
||||
|
||||
godot_variant_type GDAPI godot_variant_get_utility_function_argument_type_with_cstring(const char *p_function, int p_argument) {
|
||||
return (godot_variant_type)Variant::get_utility_function_argument_type(StringName(p_function), p_argument);
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_variant_get_utility_function_argument_name(const godot_string_name *p_function, int p_argument) {
|
||||
String argument_name = Variant::get_utility_function_argument_name(*((const StringName *)p_function), p_argument);
|
||||
godot_string ret;
|
||||
memnew_placement_custom(&ret, String, String(argument_name));
|
||||
return ret;
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_variant_get_utility_function_argument_name_with_cstring(const char *p_function, int p_argument) {
|
||||
String argument_name = Variant::get_utility_function_argument_name(StringName(p_function), p_argument);
|
||||
godot_string ret;
|
||||
memnew_placement_custom(&ret, String, String(argument_name));
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool GDAPI godot_variant_has_utility_function_return_value(const godot_string_name *p_function) {
|
||||
return Variant::has_utility_function_return_value(*((const StringName *)p_function));
|
||||
}
|
||||
|
||||
bool GDAPI godot_variant_has_utility_function_return_value_with_cstring(const char *p_function) {
|
||||
return Variant::has_utility_function_return_value(StringName(p_function));
|
||||
}
|
||||
|
||||
godot_variant_type GDAPI godot_variant_get_utility_function_return_type(const godot_string_name *p_function) {
|
||||
return (godot_variant_type)Variant::get_utility_function_return_type(*((const StringName *)p_function));
|
||||
}
|
||||
|
||||
godot_variant_type GDAPI godot_variant_get_utility_function_return_type_with_cstring(const char *p_function) {
|
||||
return (godot_variant_type)Variant::get_utility_function_return_type(StringName(p_function));
|
||||
}
|
||||
|
||||
bool GDAPI godot_variant_is_utility_function_vararg(const godot_string_name *p_function) {
|
||||
return Variant::is_utility_function_vararg(*((const StringName *)p_function));
|
||||
}
|
||||
|
||||
bool GDAPI godot_variant_is_utility_function_vararg_with_cstring(const char *p_function) {
|
||||
return Variant::is_utility_function_vararg(StringName(p_function));
|
||||
}
|
||||
|
||||
int GDAPI godot_variant_get_utility_function_count() {
|
||||
return Variant::get_utility_function_count();
|
||||
}
|
||||
|
||||
void GDAPI godot_variant_get_utility_function_list(godot_string_name *r_functions) {
|
||||
List<StringName> functions;
|
||||
godot_string_name *func = r_functions;
|
||||
Variant::get_utility_function_list(&functions);
|
||||
|
||||
for (const List<StringName>::Element *E = functions.front(); E; E = E->next()) {
|
||||
memnew_placement_custom(func++, StringName, StringName(E->get()));
|
||||
}
|
||||
}
|
||||
|
||||
// Introspection.
|
||||
|
||||
godot_variant_type GDAPI godot_variant_get_type(const godot_variant *p_self) {
|
||||
const Variant *self = (const Variant *)p_self;
|
||||
return (godot_variant_type)self->get_type();
|
||||
}
|
||||
|
||||
bool GDAPI godot_variant_has_method(const godot_variant *p_self, const godot_string_name *p_method) {
|
||||
const Variant *self = (const Variant *)p_self;
|
||||
const StringName *method = (const StringName *)p_method;
|
||||
return self->has_method(*method);
|
||||
}
|
||||
|
||||
bool GDAPI godot_variant_has_member(godot_variant_type p_type, const godot_string_name *p_member) {
|
||||
return Variant::has_member((Variant::Type)p_type, *((const StringName *)p_member));
|
||||
}
|
||||
|
||||
bool GDAPI godot_variant_has_key(const godot_variant *p_self, const godot_variant *p_key, bool *r_valid) {
|
||||
const Variant *self = (const Variant *)p_self;
|
||||
const Variant *key = (const Variant *)p_key;
|
||||
return self->has_key(*key, *r_valid);
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_variant_get_type_name(godot_variant_type p_type) {
|
||||
String name = Variant::get_type_name((Variant::Type)p_type);
|
||||
godot_string ret;
|
||||
memnew_placement_custom(&ret, String, String(name));
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool GDAPI godot_variant_can_convert(godot_variant_type p_from, godot_variant_type p_to) {
|
||||
return Variant::can_convert((Variant::Type)p_from, (Variant::Type)p_to);
|
||||
}
|
||||
|
||||
bool GDAPI godot_variant_can_convert_strict(godot_variant_type p_from, godot_variant_type p_to) {
|
||||
return Variant::can_convert_strict((Variant::Type)p_from, (Variant::Type)p_to);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -31,430 +31,20 @@
|
|||
#include "gdnative/vector2.h"
|
||||
|
||||
#include "core/math/vector2.h"
|
||||
#include "core/variant/variant.h"
|
||||
|
||||
static_assert(sizeof(godot_vector2) == sizeof(Vector2), "Vector2 size mismatch");
|
||||
static_assert(sizeof(godot_vector2i) == sizeof(Vector2i), "Vector2i size mismatch");
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
static_assert(sizeof(godot_vector2) == sizeof(Vector2), "Vector2 size mismatch");
|
||||
static_assert(sizeof(godot_vector2i) == sizeof(Vector2i), "Vector2i size mismatch");
|
||||
|
||||
// Vector2
|
||||
|
||||
void GDAPI godot_vector2_new(godot_vector2 *r_dest, const godot_real p_x, const godot_real p_y) {
|
||||
Vector2 *dest = (Vector2 *)r_dest;
|
||||
*dest = Vector2(p_x, p_y);
|
||||
void GDAPI godot_vector2_new(godot_vector2 *p_self) {
|
||||
memnew_placement(p_self, Vector2);
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_vector2_as_string(const godot_vector2 *p_self) {
|
||||
godot_string ret;
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
memnew_placement(&ret, String(*self));
|
||||
return ret;
|
||||
}
|
||||
|
||||
godot_vector2i GDAPI godot_vector2_as_vector2i(const godot_vector2 *p_self) {
|
||||
godot_vector2i dest;
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
*((Vector2i *)&dest) = Vector2i(*self);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_normalized(const godot_vector2 *p_self) {
|
||||
godot_vector2 dest;
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
*((Vector2 *)&dest) = self->normalized();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_vector2_length(const godot_vector2 *p_self) {
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
return self->length();
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_vector2_angle(const godot_vector2 *p_self) {
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
return self->angle();
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_vector2_length_squared(const godot_vector2 *p_self) {
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
return self->length_squared();
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_vector2_is_normalized(const godot_vector2 *p_self) {
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
return self->is_normalized();
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_direction_to(const godot_vector2 *p_self, const godot_vector2 *p_to) {
|
||||
godot_vector2 dest;
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
const Vector2 *to = (const Vector2 *)p_to;
|
||||
*((Vector2 *)&dest) = self->direction_to(*to);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_vector2_distance_to(const godot_vector2 *p_self, const godot_vector2 *p_to) {
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
const Vector2 *to = (const Vector2 *)p_to;
|
||||
return self->distance_to(*to);
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_vector2_distance_squared_to(const godot_vector2 *p_self, const godot_vector2 *p_to) {
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
const Vector2 *to = (const Vector2 *)p_to;
|
||||
return self->distance_squared_to(*to);
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_vector2_angle_to(const godot_vector2 *p_self, const godot_vector2 *p_to) {
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
const Vector2 *to = (const Vector2 *)p_to;
|
||||
return self->angle_to(*to);
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_vector2_angle_to_point(const godot_vector2 *p_self, const godot_vector2 *p_to) {
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
const Vector2 *to = (const Vector2 *)p_to;
|
||||
return self->angle_to_point(*to);
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_lerp(const godot_vector2 *p_self, const godot_vector2 *p_b, const godot_real p_t) {
|
||||
godot_vector2 dest;
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
const Vector2 *b = (const Vector2 *)p_b;
|
||||
*((Vector2 *)&dest) = self->lerp(*b, p_t);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_cubic_interpolate(const godot_vector2 *p_self, const godot_vector2 *p_b, const godot_vector2 *p_pre_a, const godot_vector2 *p_post_b, const godot_real p_t) {
|
||||
godot_vector2 dest;
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
const Vector2 *b = (const Vector2 *)p_b;
|
||||
const Vector2 *pre_a = (const Vector2 *)p_pre_a;
|
||||
const Vector2 *post_b = (const Vector2 *)p_post_b;
|
||||
*((Vector2 *)&dest) = self->cubic_interpolate(*b, *pre_a, *post_b, p_t);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_move_toward(const godot_vector2 *p_self, const godot_vector2 *p_to, const godot_real p_delta) {
|
||||
godot_vector2 dest;
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
const Vector2 *to = (const Vector2 *)p_to;
|
||||
*((Vector2 *)&dest) = self->move_toward(*to, p_delta);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_rotated(const godot_vector2 *p_self, const godot_real p_phi) {
|
||||
godot_vector2 dest;
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
|
||||
*((Vector2 *)&dest) = self->rotated(p_phi);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_orthogonal(const godot_vector2 *p_self) {
|
||||
godot_vector2 dest;
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
*((Vector2 *)&dest) = self->orthogonal();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_floor(const godot_vector2 *p_self) {
|
||||
godot_vector2 dest;
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
*((Vector2 *)&dest) = self->floor();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_sign(const godot_vector2 *p_self) {
|
||||
godot_vector2 dest;
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
*((Vector2 *)&dest) = self->sign();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_snapped(const godot_vector2 *p_self, const godot_vector2 *p_by) {
|
||||
godot_vector2 dest;
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
const Vector2 *by = (const Vector2 *)p_by;
|
||||
*((Vector2 *)&dest) = self->snapped(*by);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_vector2_aspect(const godot_vector2 *p_self) {
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
return self->aspect();
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_vector2_dot(const godot_vector2 *p_self, const godot_vector2 *p_with) {
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
const Vector2 *with = (const Vector2 *)p_with;
|
||||
return self->dot(*with);
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_slide(const godot_vector2 *p_self, const godot_vector2 *p_n) {
|
||||
godot_vector2 dest;
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
const Vector2 *n = (const Vector2 *)p_n;
|
||||
*((Vector2 *)&dest) = self->slide(*n);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_bounce(const godot_vector2 *p_self, const godot_vector2 *p_n) {
|
||||
godot_vector2 dest;
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
const Vector2 *n = (const Vector2 *)p_n;
|
||||
*((Vector2 *)&dest) = self->bounce(*n);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_reflect(const godot_vector2 *p_self, const godot_vector2 *p_n) {
|
||||
godot_vector2 dest;
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
const Vector2 *n = (const Vector2 *)p_n;
|
||||
*((Vector2 *)&dest) = self->reflect(*n);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_abs(const godot_vector2 *p_self) {
|
||||
godot_vector2 dest;
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
*((Vector2 *)&dest) = self->abs();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_clamped(const godot_vector2 *p_self, const godot_real p_length) {
|
||||
godot_vector2 dest;
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
|
||||
*((Vector2 *)&dest) = self->clamped(p_length);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_operator_add(const godot_vector2 *p_self, const godot_vector2 *p_b) {
|
||||
godot_vector2 raw_dest;
|
||||
Vector2 *dest = (Vector2 *)&raw_dest;
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
const Vector2 *b = (const Vector2 *)p_b;
|
||||
*dest = *self + *b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_operator_subtract(const godot_vector2 *p_self, const godot_vector2 *p_b) {
|
||||
godot_vector2 raw_dest;
|
||||
Vector2 *dest = (Vector2 *)&raw_dest;
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
const Vector2 *b = (const Vector2 *)p_b;
|
||||
*dest = *self - *b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_operator_multiply_vector(const godot_vector2 *p_self, const godot_vector2 *p_b) {
|
||||
godot_vector2 raw_dest;
|
||||
Vector2 *dest = (Vector2 *)&raw_dest;
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
const Vector2 *b = (const Vector2 *)p_b;
|
||||
*dest = *self * *b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_operator_multiply_scalar(const godot_vector2 *p_self, const godot_real p_b) {
|
||||
godot_vector2 raw_dest;
|
||||
Vector2 *dest = (Vector2 *)&raw_dest;
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
*dest = *self * p_b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_operator_divide_vector(const godot_vector2 *p_self, const godot_vector2 *p_b) {
|
||||
godot_vector2 raw_dest;
|
||||
Vector2 *dest = (Vector2 *)&raw_dest;
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
const Vector2 *b = (const Vector2 *)p_b;
|
||||
*dest = *self / *b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_operator_divide_scalar(const godot_vector2 *p_self, const godot_real p_b) {
|
||||
godot_vector2 raw_dest;
|
||||
Vector2 *dest = (Vector2 *)&raw_dest;
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
*dest = *self / p_b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_vector2_operator_equal(const godot_vector2 *p_self, const godot_vector2 *p_b) {
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
const Vector2 *b = (const Vector2 *)p_b;
|
||||
return *self == *b;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_vector2_operator_less(const godot_vector2 *p_self, const godot_vector2 *p_b) {
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
const Vector2 *b = (const Vector2 *)p_b;
|
||||
return *self < *b;
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_operator_neg(const godot_vector2 *p_self) {
|
||||
godot_vector2 raw_dest;
|
||||
Vector2 *dest = (Vector2 *)&raw_dest;
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
*dest = -(*self);
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
void GDAPI godot_vector2_set_x(godot_vector2 *p_self, const godot_real p_x) {
|
||||
Vector2 *self = (Vector2 *)p_self;
|
||||
self->x = p_x;
|
||||
}
|
||||
|
||||
void GDAPI godot_vector2_set_y(godot_vector2 *p_self, const godot_real p_y) {
|
||||
Vector2 *self = (Vector2 *)p_self;
|
||||
self->y = p_y;
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_vector2_get_x(const godot_vector2 *p_self) {
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
return self->x;
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_vector2_get_y(const godot_vector2 *p_self) {
|
||||
const Vector2 *self = (const Vector2 *)p_self;
|
||||
return self->y;
|
||||
}
|
||||
|
||||
// Vector2i
|
||||
|
||||
void GDAPI godot_vector2i_new(godot_vector2i *r_dest, const godot_int p_x, const godot_int p_y) {
|
||||
Vector2i *dest = (Vector2i *)r_dest;
|
||||
*dest = Vector2i(p_x, p_y);
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_vector2i_as_string(const godot_vector2i *p_self) {
|
||||
godot_string ret;
|
||||
const Vector2i *self = (const Vector2i *)p_self;
|
||||
memnew_placement(&ret, String(*self));
|
||||
return ret;
|
||||
}
|
||||
|
||||
godot_vector2 GDAPI godot_vector2i_as_vector2(const godot_vector2i *p_self) {
|
||||
godot_vector2 dest;
|
||||
const Vector2i *self = (const Vector2i *)p_self;
|
||||
*((Vector2 *)&dest) = Vector2(*self);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_vector2i_aspect(const godot_vector2i *p_self) {
|
||||
const Vector2i *self = (const Vector2i *)p_self;
|
||||
return self->aspect();
|
||||
}
|
||||
|
||||
godot_vector2i GDAPI godot_vector2i_abs(const godot_vector2i *p_self) {
|
||||
godot_vector2i dest;
|
||||
const Vector2i *self = (const Vector2i *)p_self;
|
||||
*((Vector2i *)&dest) = self->abs();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector2i GDAPI godot_vector2i_sign(const godot_vector2i *p_self) {
|
||||
godot_vector2i dest;
|
||||
const Vector2i *self = (const Vector2i *)p_self;
|
||||
*((Vector2i *)&dest) = self->sign();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector2i GDAPI godot_vector2i_operator_add(const godot_vector2i *p_self, const godot_vector2i *p_b) {
|
||||
godot_vector2i raw_dest;
|
||||
Vector2i *dest = (Vector2i *)&raw_dest;
|
||||
const Vector2i *self = (const Vector2i *)p_self;
|
||||
const Vector2i *b = (const Vector2i *)p_b;
|
||||
*dest = *self + *b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_vector2i GDAPI godot_vector2i_operator_subtract(const godot_vector2i *p_self, const godot_vector2i *p_b) {
|
||||
godot_vector2i raw_dest;
|
||||
Vector2i *dest = (Vector2i *)&raw_dest;
|
||||
const Vector2i *self = (const Vector2i *)p_self;
|
||||
const Vector2i *b = (const Vector2i *)p_b;
|
||||
*dest = *self - *b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_vector2i GDAPI godot_vector2i_operator_multiply_vector(const godot_vector2i *p_self, const godot_vector2i *p_b) {
|
||||
godot_vector2i raw_dest;
|
||||
Vector2i *dest = (Vector2i *)&raw_dest;
|
||||
const Vector2i *self = (const Vector2i *)p_self;
|
||||
const Vector2i *b = (const Vector2i *)p_b;
|
||||
*dest = *self * *b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_vector2i GDAPI godot_vector2i_operator_multiply_scalar(const godot_vector2i *p_self, const godot_int p_b) {
|
||||
godot_vector2i raw_dest;
|
||||
Vector2i *dest = (Vector2i *)&raw_dest;
|
||||
const Vector2i *self = (const Vector2i *)p_self;
|
||||
*dest = *self * p_b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_vector2i GDAPI godot_vector2i_operator_divide_vector(const godot_vector2i *p_self, const godot_vector2i *p_b) {
|
||||
godot_vector2i raw_dest;
|
||||
Vector2i *dest = (Vector2i *)&raw_dest;
|
||||
const Vector2i *self = (const Vector2i *)p_self;
|
||||
const Vector2i *b = (const Vector2i *)p_b;
|
||||
*dest = *self / *b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_vector2i GDAPI godot_vector2i_operator_divide_scalar(const godot_vector2i *p_self, const godot_int p_b) {
|
||||
godot_vector2i raw_dest;
|
||||
Vector2i *dest = (Vector2i *)&raw_dest;
|
||||
const Vector2i *self = (const Vector2i *)p_self;
|
||||
*dest = *self / p_b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_vector2i_operator_equal(const godot_vector2i *p_self, const godot_vector2i *p_b) {
|
||||
const Vector2i *self = (const Vector2i *)p_self;
|
||||
const Vector2i *b = (const Vector2i *)p_b;
|
||||
return *self == *b;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_vector2i_operator_less(const godot_vector2i *p_self, const godot_vector2i *p_b) {
|
||||
const Vector2i *self = (const Vector2i *)p_self;
|
||||
const Vector2i *b = (const Vector2i *)p_b;
|
||||
return *self < *b;
|
||||
}
|
||||
|
||||
godot_vector2i GDAPI godot_vector2i_operator_neg(const godot_vector2i *p_self) {
|
||||
godot_vector2i raw_dest;
|
||||
Vector2i *dest = (Vector2i *)&raw_dest;
|
||||
const Vector2i *self = (const Vector2i *)p_self;
|
||||
*dest = -(*self);
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
void GDAPI godot_vector2i_set_x(godot_vector2i *p_self, const godot_int p_x) {
|
||||
Vector2i *self = (Vector2i *)p_self;
|
||||
self->x = p_x;
|
||||
}
|
||||
|
||||
void GDAPI godot_vector2i_set_y(godot_vector2i *p_self, const godot_int p_y) {
|
||||
Vector2i *self = (Vector2i *)p_self;
|
||||
self->y = p_y;
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_vector2i_get_x(const godot_vector2i *p_self) {
|
||||
const Vector2i *self = (const Vector2i *)p_self;
|
||||
return self->x;
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_vector2i_get_y(const godot_vector2i *p_self) {
|
||||
const Vector2i *self = (const Vector2i *)p_self;
|
||||
return self->y;
|
||||
void GDAPI godot_vector2i_new(godot_vector2i *p_self) {
|
||||
memnew_placement(p_self, Vector2i);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -30,433 +30,21 @@
|
|||
|
||||
#include "gdnative/vector3.h"
|
||||
|
||||
#include "core/templates/vector.h"
|
||||
#include "core/variant/variant.h"
|
||||
#include "core/math/vector3.h"
|
||||
|
||||
static_assert(sizeof(godot_vector3) == sizeof(Vector3), "Vector3 size mismatch");
|
||||
static_assert(sizeof(godot_vector3i) == sizeof(Vector3i), "Vector3i size mismatch");
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
static_assert(sizeof(godot_vector3) == sizeof(Vector3), "Vector3 size mismatch");
|
||||
static_assert(sizeof(godot_vector3i) == sizeof(Vector3i), "Vector3i size mismatch");
|
||||
|
||||
// Vector3
|
||||
|
||||
void GDAPI godot_vector3_new(godot_vector3 *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_z) {
|
||||
Vector3 *dest = (Vector3 *)r_dest;
|
||||
*dest = Vector3(p_x, p_y, p_z);
|
||||
void GDAPI godot_vector3_new(godot_vector3 *p_self) {
|
||||
memnew_placement(p_self, Vector3);
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_vector3_as_string(const godot_vector3 *p_self) {
|
||||
godot_string ret;
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
memnew_placement(&ret, String(*self));
|
||||
return ret;
|
||||
}
|
||||
|
||||
godot_vector3i GDAPI godot_vector3_as_vector3i(const godot_vector3 *p_self) {
|
||||
godot_vector3i dest;
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
*((Vector3i *)&dest) = Vector3i(*self);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_vector3_min_axis(const godot_vector3 *p_self) {
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
return self->min_axis();
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_vector3_max_axis(const godot_vector3 *p_self) {
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
return self->max_axis();
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_vector3_length(const godot_vector3 *p_self) {
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
return self->length();
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_vector3_length_squared(const godot_vector3 *p_self) {
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
return self->length_squared();
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_vector3_is_normalized(const godot_vector3 *p_self) {
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
return self->is_normalized();
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_normalized(const godot_vector3 *p_self) {
|
||||
godot_vector3 dest;
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
*((Vector3 *)&dest) = self->normalized();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_inverse(const godot_vector3 *p_self) {
|
||||
godot_vector3 dest;
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
*((Vector3 *)&dest) = self->inverse();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_snapped(const godot_vector3 *p_self, const godot_vector3 *p_by) {
|
||||
godot_vector3 dest;
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
const Vector3 *snap_axis = (const Vector3 *)p_by;
|
||||
|
||||
*((Vector3 *)&dest) = self->snapped(*snap_axis);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_rotated(const godot_vector3 *p_self, const godot_vector3 *p_axis, const godot_real p_phi) {
|
||||
godot_vector3 dest;
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
const Vector3 *axis = (const Vector3 *)p_axis;
|
||||
*((Vector3 *)&dest) = self->rotated(*axis, p_phi);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_lerp(const godot_vector3 *p_self, const godot_vector3 *p_b, const godot_real p_t) {
|
||||
godot_vector3 dest;
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
const Vector3 *b = (const Vector3 *)p_b;
|
||||
*((Vector3 *)&dest) = self->lerp(*b, p_t);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_cubic_interpolate(const godot_vector3 *p_self, const godot_vector3 *p_b, const godot_vector3 *p_pre_a, const godot_vector3 *p_post_b, const godot_real p_t) {
|
||||
godot_vector3 dest;
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
const Vector3 *b = (const Vector3 *)p_b;
|
||||
const Vector3 *pre_a = (const Vector3 *)p_pre_a;
|
||||
const Vector3 *post_b = (const Vector3 *)p_post_b;
|
||||
*((Vector3 *)&dest) = self->cubic_interpolate(*b, *pre_a, *post_b, p_t);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_move_toward(const godot_vector3 *p_self, const godot_vector3 *p_to, const godot_real p_delta) {
|
||||
godot_vector3 dest;
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
const Vector3 *to = (const Vector3 *)p_to;
|
||||
*((Vector3 *)&dest) = self->move_toward(*to, p_delta);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_vector3_dot(const godot_vector3 *p_self, const godot_vector3 *p_b) {
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
const Vector3 *b = (const Vector3 *)p_b;
|
||||
return self->dot(*b);
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_cross(const godot_vector3 *p_self, const godot_vector3 *p_b) {
|
||||
godot_vector3 dest;
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
const Vector3 *b = (const Vector3 *)p_b;
|
||||
*((Vector3 *)&dest) = self->cross(*b);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_basis GDAPI godot_vector3_outer(const godot_vector3 *p_self, const godot_vector3 *p_b) {
|
||||
godot_basis dest;
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
const Vector3 *b = (const Vector3 *)p_b;
|
||||
*((Basis *)&dest) = self->outer(*b);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_basis GDAPI godot_vector3_to_diagonal_matrix(const godot_vector3 *p_self) {
|
||||
godot_basis dest;
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
*((Basis *)&dest) = self->to_diagonal_matrix();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_abs(const godot_vector3 *p_self) {
|
||||
godot_vector3 dest;
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
*((Vector3 *)&dest) = self->abs();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_sign(const godot_vector3 *p_self) {
|
||||
godot_vector3 dest;
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
*((Vector3 *)&dest) = self->sign();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_floor(const godot_vector3 *p_self) {
|
||||
godot_vector3 dest;
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
*((Vector3 *)&dest) = self->floor();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_ceil(const godot_vector3 *p_self) {
|
||||
godot_vector3 dest;
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
*((Vector3 *)&dest) = self->ceil();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_direction_to(const godot_vector3 *p_self, const godot_vector3 *p_to) {
|
||||
godot_vector3 dest;
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
const Vector3 *to = (const Vector3 *)p_to;
|
||||
*((Vector3 *)&dest) = self->direction_to(*to);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_vector3_distance_to(const godot_vector3 *p_self, const godot_vector3 *p_b) {
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
const Vector3 *b = (const Vector3 *)p_b;
|
||||
return self->distance_to(*b);
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_vector3_distance_squared_to(const godot_vector3 *p_self, const godot_vector3 *p_b) {
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
const Vector3 *b = (const Vector3 *)p_b;
|
||||
return self->distance_squared_to(*b);
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_vector3_angle_to(const godot_vector3 *p_self, const godot_vector3 *p_to) {
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
const Vector3 *to = (const Vector3 *)p_to;
|
||||
return self->angle_to(*to);
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_slide(const godot_vector3 *p_self, const godot_vector3 *p_n) {
|
||||
godot_vector3 dest;
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
const Vector3 *n = (const Vector3 *)p_n;
|
||||
*((Vector3 *)&dest) = self->slide(*n);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_bounce(const godot_vector3 *p_self, const godot_vector3 *p_n) {
|
||||
godot_vector3 dest;
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
const Vector3 *n = (const Vector3 *)p_n;
|
||||
*((Vector3 *)&dest) = self->bounce(*n);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_reflect(const godot_vector3 *p_self, const godot_vector3 *p_n) {
|
||||
godot_vector3 dest;
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
const Vector3 *n = (const Vector3 *)p_n;
|
||||
*((Vector3 *)&dest) = self->reflect(*n);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_operator_add(const godot_vector3 *p_self, const godot_vector3 *p_b) {
|
||||
godot_vector3 raw_dest;
|
||||
Vector3 *dest = (Vector3 *)&raw_dest;
|
||||
Vector3 *self = (Vector3 *)p_self;
|
||||
const Vector3 *b = (const Vector3 *)p_b;
|
||||
*dest = *self + *b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_operator_subtract(const godot_vector3 *p_self, const godot_vector3 *p_b) {
|
||||
godot_vector3 raw_dest;
|
||||
Vector3 *dest = (Vector3 *)&raw_dest;
|
||||
Vector3 *self = (Vector3 *)p_self;
|
||||
const Vector3 *b = (const Vector3 *)p_b;
|
||||
*dest = *self - *b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_operator_multiply_vector(const godot_vector3 *p_self, const godot_vector3 *p_b) {
|
||||
godot_vector3 raw_dest;
|
||||
Vector3 *dest = (Vector3 *)&raw_dest;
|
||||
Vector3 *self = (Vector3 *)p_self;
|
||||
const Vector3 *b = (const Vector3 *)p_b;
|
||||
*dest = *self * *b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_operator_multiply_scalar(const godot_vector3 *p_self, const godot_real p_b) {
|
||||
godot_vector3 raw_dest;
|
||||
Vector3 *dest = (Vector3 *)&raw_dest;
|
||||
Vector3 *self = (Vector3 *)p_self;
|
||||
*dest = *self * p_b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_operator_divide_vector(const godot_vector3 *p_self, const godot_vector3 *p_b) {
|
||||
godot_vector3 raw_dest;
|
||||
Vector3 *dest = (Vector3 *)&raw_dest;
|
||||
Vector3 *self = (Vector3 *)p_self;
|
||||
const Vector3 *b = (const Vector3 *)p_b;
|
||||
*dest = *self / *b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_operator_divide_scalar(const godot_vector3 *p_self, const godot_real p_b) {
|
||||
godot_vector3 raw_dest;
|
||||
Vector3 *dest = (Vector3 *)&raw_dest;
|
||||
Vector3 *self = (Vector3 *)p_self;
|
||||
*dest = *self / p_b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_vector3_operator_equal(const godot_vector3 *p_self, const godot_vector3 *p_b) {
|
||||
Vector3 *self = (Vector3 *)p_self;
|
||||
const Vector3 *b = (const Vector3 *)p_b;
|
||||
return *self == *b;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_vector3_operator_less(const godot_vector3 *p_self, const godot_vector3 *p_b) {
|
||||
Vector3 *self = (Vector3 *)p_self;
|
||||
const Vector3 *b = (const Vector3 *)p_b;
|
||||
return *self < *b;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_operator_neg(const godot_vector3 *p_self) {
|
||||
godot_vector3 raw_dest;
|
||||
Vector3 *dest = (Vector3 *)&raw_dest;
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
*dest = -(*self);
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
void GDAPI godot_vector3_set_axis(godot_vector3 *p_self, const godot_vector3_axis p_axis, const godot_real p_val) {
|
||||
Vector3 *self = (Vector3 *)p_self;
|
||||
self->set_axis(p_axis, p_val);
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_vector3_get_axis(const godot_vector3 *p_self, const godot_vector3_axis p_axis) {
|
||||
const Vector3 *self = (const Vector3 *)p_self;
|
||||
return self->get_axis(p_axis);
|
||||
}
|
||||
|
||||
// Vector3i
|
||||
|
||||
void GDAPI godot_vector3i_new(godot_vector3i *r_dest, const godot_int p_x, const godot_int p_y, const godot_int p_z) {
|
||||
Vector3i *dest = (Vector3i *)r_dest;
|
||||
*dest = Vector3i(p_x, p_y, p_z);
|
||||
}
|
||||
|
||||
godot_string GDAPI godot_vector3i_as_string(const godot_vector3i *p_self) {
|
||||
godot_string ret;
|
||||
const Vector3i *self = (const Vector3i *)p_self;
|
||||
memnew_placement(&ret, String(*self));
|
||||
return ret;
|
||||
}
|
||||
|
||||
godot_vector3 GDAPI godot_vector3i_as_vector3(const godot_vector3i *p_self) {
|
||||
godot_vector3 dest;
|
||||
const Vector3i *self = (const Vector3i *)p_self;
|
||||
*((Vector3 *)&dest) = Vector3(*self);
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_vector3i_min_axis(const godot_vector3i *p_self) {
|
||||
const Vector3i *self = (const Vector3i *)p_self;
|
||||
return self->min_axis();
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_vector3i_max_axis(const godot_vector3i *p_self) {
|
||||
const Vector3i *self = (const Vector3i *)p_self;
|
||||
return self->max_axis();
|
||||
}
|
||||
|
||||
godot_vector3i GDAPI godot_vector3i_abs(const godot_vector3i *p_self) {
|
||||
godot_vector3i dest;
|
||||
const Vector3i *self = (const Vector3i *)p_self;
|
||||
*((Vector3i *)&dest) = self->abs();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector3i GDAPI godot_vector3i_sign(const godot_vector3i *p_self) {
|
||||
godot_vector3i dest;
|
||||
const Vector3i *self = (const Vector3i *)p_self;
|
||||
*((Vector3i *)&dest) = self->sign();
|
||||
return dest;
|
||||
}
|
||||
|
||||
godot_vector3i GDAPI godot_vector3i_operator_add(const godot_vector3i *p_self, const godot_vector3i *p_b) {
|
||||
godot_vector3i raw_dest;
|
||||
Vector3i *dest = (Vector3i *)&raw_dest;
|
||||
Vector3i *self = (Vector3i *)p_self;
|
||||
const Vector3i *b = (const Vector3i *)p_b;
|
||||
*dest = *self + *b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_vector3i GDAPI godot_vector3i_operator_subtract(const godot_vector3i *p_self, const godot_vector3i *p_b) {
|
||||
godot_vector3i raw_dest;
|
||||
Vector3i *dest = (Vector3i *)&raw_dest;
|
||||
Vector3i *self = (Vector3i *)p_self;
|
||||
const Vector3i *b = (const Vector3i *)p_b;
|
||||
*dest = *self - *b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_vector3i GDAPI godot_vector3i_operator_multiply_vector(const godot_vector3i *p_self, const godot_vector3i *p_b) {
|
||||
godot_vector3i raw_dest;
|
||||
Vector3i *dest = (Vector3i *)&raw_dest;
|
||||
Vector3i *self = (Vector3i *)p_self;
|
||||
const Vector3i *b = (const Vector3i *)p_b;
|
||||
*dest = *self * *b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_vector3i GDAPI godot_vector3i_operator_multiply_scalar(const godot_vector3i *p_self, const godot_int p_b) {
|
||||
godot_vector3i raw_dest;
|
||||
Vector3i *dest = (Vector3i *)&raw_dest;
|
||||
Vector3i *self = (Vector3i *)p_self;
|
||||
*dest = *self * p_b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_vector3i GDAPI godot_vector3i_operator_divide_vector(const godot_vector3i *p_self, const godot_vector3i *p_b) {
|
||||
godot_vector3i raw_dest;
|
||||
Vector3i *dest = (Vector3i *)&raw_dest;
|
||||
Vector3i *self = (Vector3i *)p_self;
|
||||
const Vector3i *b = (const Vector3i *)p_b;
|
||||
*dest = *self / *b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_vector3i GDAPI godot_vector3i_operator_divide_scalar(const godot_vector3i *p_self, const godot_int p_b) {
|
||||
godot_vector3i raw_dest;
|
||||
Vector3i *dest = (Vector3i *)&raw_dest;
|
||||
Vector3i *self = (Vector3i *)p_self;
|
||||
*dest = *self / p_b;
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_vector3i_operator_equal(const godot_vector3i *p_self, const godot_vector3i *p_b) {
|
||||
Vector3i *self = (Vector3i *)p_self;
|
||||
const Vector3i *b = (const Vector3i *)p_b;
|
||||
return *self == *b;
|
||||
}
|
||||
|
||||
godot_bool GDAPI godot_vector3i_operator_less(const godot_vector3i *p_self, const godot_vector3i *p_b) {
|
||||
Vector3i *self = (Vector3i *)p_self;
|
||||
const Vector3i *b = (const Vector3i *)p_b;
|
||||
return *self < *b;
|
||||
}
|
||||
|
||||
godot_vector3i GDAPI godot_vector3i_operator_neg(const godot_vector3i *p_self) {
|
||||
godot_vector3i raw_dest;
|
||||
Vector3i *dest = (Vector3i *)&raw_dest;
|
||||
const Vector3i *self = (const Vector3i *)p_self;
|
||||
*dest = -(*self);
|
||||
return raw_dest;
|
||||
}
|
||||
|
||||
void GDAPI godot_vector3i_set_axis(godot_vector3i *p_self, const godot_vector3_axis p_axis, const godot_int p_val) {
|
||||
Vector3i *self = (Vector3i *)p_self;
|
||||
self->set_axis(p_axis, p_val);
|
||||
}
|
||||
|
||||
godot_int GDAPI godot_vector3i_get_axis(const godot_vector3i *p_self, const godot_vector3_axis p_axis) {
|
||||
const Vector3i *self = (const Vector3i *)p_self;
|
||||
return self->get_axis(p_axis);
|
||||
void GDAPI godot_vector3i_new(godot_vector3i *p_self) {
|
||||
memnew_placement(p_self, Vector3i);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -46,72 +46,9 @@ typedef struct {
|
|||
} godot_aabb;
|
||||
#endif
|
||||
|
||||
// reduce extern "C" nesting for VS2013
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <gdnative/gdnative.h>
|
||||
#include <gdnative/plane.h>
|
||||
#include <gdnative/vector3.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GDAPI godot_aabb_new(godot_aabb *r_dest, const godot_vector3 *p_pos, const godot_vector3 *p_size);
|
||||
|
||||
godot_vector3 GDAPI godot_aabb_get_position(const godot_aabb *p_self);
|
||||
void GDAPI godot_aabb_set_position(const godot_aabb *p_self, const godot_vector3 *p_v);
|
||||
|
||||
godot_vector3 GDAPI godot_aabb_get_size(const godot_aabb *p_self);
|
||||
void GDAPI godot_aabb_set_size(const godot_aabb *p_self, const godot_vector3 *p_v);
|
||||
|
||||
godot_string GDAPI godot_aabb_as_string(const godot_aabb *p_self);
|
||||
|
||||
godot_aabb GDAPI godot_aabb_abs(const godot_aabb *p_self);
|
||||
|
||||
godot_real GDAPI godot_aabb_get_area(const godot_aabb *p_self);
|
||||
|
||||
godot_bool GDAPI godot_aabb_has_no_area(const godot_aabb *p_self);
|
||||
|
||||
godot_bool GDAPI godot_aabb_has_no_surface(const godot_aabb *p_self);
|
||||
|
||||
godot_bool GDAPI godot_aabb_intersects(const godot_aabb *p_self, const godot_aabb *p_with);
|
||||
|
||||
godot_bool GDAPI godot_aabb_encloses(const godot_aabb *p_self, const godot_aabb *p_with);
|
||||
|
||||
godot_aabb GDAPI godot_aabb_merge(const godot_aabb *p_self, const godot_aabb *p_with);
|
||||
|
||||
godot_aabb GDAPI godot_aabb_intersection(const godot_aabb *p_self, const godot_aabb *p_with);
|
||||
|
||||
godot_bool GDAPI godot_aabb_intersects_plane(const godot_aabb *p_self, const godot_plane *p_plane);
|
||||
|
||||
godot_bool GDAPI godot_aabb_intersects_segment(const godot_aabb *p_self, const godot_vector3 *p_from, const godot_vector3 *p_to);
|
||||
|
||||
godot_bool GDAPI godot_aabb_has_point(const godot_aabb *p_self, const godot_vector3 *p_point);
|
||||
|
||||
godot_vector3 GDAPI godot_aabb_get_support(const godot_aabb *p_self, const godot_vector3 *p_dir);
|
||||
|
||||
godot_vector3 GDAPI godot_aabb_get_longest_axis(const godot_aabb *p_self);
|
||||
|
||||
godot_int GDAPI godot_aabb_get_longest_axis_index(const godot_aabb *p_self);
|
||||
|
||||
godot_real GDAPI godot_aabb_get_longest_axis_size(const godot_aabb *p_self);
|
||||
|
||||
godot_vector3 GDAPI godot_aabb_get_shortest_axis(const godot_aabb *p_self);
|
||||
|
||||
godot_int GDAPI godot_aabb_get_shortest_axis_index(const godot_aabb *p_self);
|
||||
|
||||
godot_real GDAPI godot_aabb_get_shortest_axis_size(const godot_aabb *p_self);
|
||||
|
||||
godot_aabb GDAPI godot_aabb_expand(const godot_aabb *p_self, const godot_vector3 *p_to_point);
|
||||
|
||||
godot_aabb GDAPI godot_aabb_grow(const godot_aabb *p_self, const godot_real p_by);
|
||||
|
||||
godot_vector3 GDAPI godot_aabb_get_endpoint(const godot_aabb *p_self, const godot_int p_idx);
|
||||
|
||||
godot_bool GDAPI godot_aabb_operator_equal(const godot_aabb *p_self, const godot_aabb *p_b);
|
||||
void GDAPI godot_aabb_new(godot_aabb *p_self);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -46,103 +46,11 @@ typedef struct {
|
|||
} godot_array;
|
||||
#endif
|
||||
|
||||
// reduce extern "C" nesting for VS2013
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <gdnative/packed_arrays.h>
|
||||
#include <gdnative/variant.h>
|
||||
|
||||
#include <gdnative/gdnative.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GDAPI godot_array_new(godot_array *r_dest);
|
||||
void GDAPI godot_array_new_copy(godot_array *r_dest, const godot_array *p_src);
|
||||
void GDAPI godot_array_new_packed_color_array(godot_array *r_dest, const godot_packed_color_array *p_pca);
|
||||
void GDAPI godot_array_new_packed_vector3_array(godot_array *r_dest, const godot_packed_vector3_array *p_pv3a);
|
||||
void GDAPI godot_array_new_packed_vector2_array(godot_array *r_dest, const godot_packed_vector2_array *p_pv2a);
|
||||
void GDAPI godot_array_new_packed_vector2i_array(godot_array *r_dest, const godot_packed_vector2i_array *p_pv2a);
|
||||
void GDAPI godot_array_new_packed_string_array(godot_array *r_dest, const godot_packed_string_array *p_psa);
|
||||
void GDAPI godot_array_new_packed_float32_array(godot_array *r_dest, const godot_packed_float32_array *p_pra);
|
||||
void GDAPI godot_array_new_packed_float64_array(godot_array *r_dest, const godot_packed_float64_array *p_pra);
|
||||
void GDAPI godot_array_new_packed_int32_array(godot_array *r_dest, const godot_packed_int32_array *p_pia);
|
||||
void GDAPI godot_array_new_packed_int64_array(godot_array *r_dest, const godot_packed_int64_array *p_pia);
|
||||
void GDAPI godot_array_new_packed_byte_array(godot_array *r_dest, const godot_packed_byte_array *p_pba);
|
||||
|
||||
void GDAPI godot_array_set(godot_array *p_self, const godot_int p_idx, const godot_variant *p_value);
|
||||
|
||||
godot_variant GDAPI godot_array_get(const godot_array *p_self, const godot_int p_idx);
|
||||
|
||||
godot_variant GDAPI *godot_array_operator_index(godot_array *p_self, const godot_int p_idx);
|
||||
|
||||
const godot_variant GDAPI *godot_array_operator_index_const(const godot_array *p_self, const godot_int p_idx);
|
||||
|
||||
void GDAPI godot_array_append(godot_array *p_self, const godot_variant *p_value);
|
||||
|
||||
void GDAPI godot_array_clear(godot_array *p_self);
|
||||
|
||||
godot_int GDAPI godot_array_count(const godot_array *p_self, const godot_variant *p_value);
|
||||
|
||||
godot_bool GDAPI godot_array_is_empty(const godot_array *p_self);
|
||||
|
||||
void GDAPI godot_array_erase(godot_array *p_self, const godot_variant *p_value);
|
||||
|
||||
godot_variant GDAPI godot_array_front(const godot_array *p_self);
|
||||
|
||||
godot_variant GDAPI godot_array_back(const godot_array *p_self);
|
||||
|
||||
godot_int GDAPI godot_array_find(const godot_array *p_self, const godot_variant *p_what, const godot_int p_from);
|
||||
|
||||
godot_int GDAPI godot_array_find_last(const godot_array *p_self, const godot_variant *p_what);
|
||||
|
||||
godot_bool GDAPI godot_array_has(const godot_array *p_self, const godot_variant *p_value);
|
||||
|
||||
godot_int GDAPI godot_array_hash(const godot_array *p_self);
|
||||
|
||||
void GDAPI godot_array_insert(godot_array *p_self, const godot_int p_pos, const godot_variant *p_value);
|
||||
|
||||
void GDAPI godot_array_invert(godot_array *p_self);
|
||||
|
||||
godot_variant GDAPI godot_array_pop_back(godot_array *p_self);
|
||||
|
||||
godot_variant GDAPI godot_array_pop_front(godot_array *p_self);
|
||||
|
||||
void GDAPI godot_array_push_back(godot_array *p_self, const godot_variant *p_value);
|
||||
|
||||
void GDAPI godot_array_push_front(godot_array *p_self, const godot_variant *p_value);
|
||||
|
||||
void GDAPI godot_array_remove(godot_array *p_self, const godot_int p_idx);
|
||||
|
||||
void GDAPI godot_array_resize(godot_array *p_self, const godot_int p_size);
|
||||
|
||||
godot_int GDAPI godot_array_rfind(const godot_array *p_self, const godot_variant *p_what, const godot_int p_from);
|
||||
|
||||
godot_int GDAPI godot_array_size(const godot_array *p_self);
|
||||
|
||||
void GDAPI godot_array_sort(godot_array *p_self);
|
||||
|
||||
void GDAPI godot_array_sort_custom(godot_array *p_self, godot_object *p_obj, const godot_string *p_func);
|
||||
|
||||
godot_int GDAPI godot_array_bsearch(godot_array *p_self, const godot_variant *p_value, const godot_bool p_before);
|
||||
|
||||
godot_int GDAPI godot_array_bsearch_custom(godot_array *p_self, const godot_variant *p_value, godot_object *p_obj, const godot_string *p_func, const godot_bool p_before);
|
||||
|
||||
void GDAPI godot_array_new(godot_array *p_self);
|
||||
void GDAPI godot_array_destroy(godot_array *p_self);
|
||||
|
||||
godot_array GDAPI godot_array_duplicate(const godot_array *p_self, const godot_bool p_deep);
|
||||
|
||||
godot_array GDAPI godot_array_slice(const godot_array *p_self, const godot_int p_begin, const godot_int p_end, const godot_int p_step, const godot_bool p_deep);
|
||||
|
||||
godot_variant GDAPI godot_array_max(const godot_array *p_self);
|
||||
|
||||
godot_variant GDAPI godot_array_min(const godot_array *p_self);
|
||||
|
||||
void GDAPI godot_array_shuffle(godot_array *p_self);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -46,88 +46,9 @@ typedef struct {
|
|||
} godot_basis;
|
||||
#endif
|
||||
|
||||
// reduce extern "C" nesting for VS2013
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <gdnative/gdnative.h>
|
||||
#include <gdnative/quat.h>
|
||||
#include <gdnative/vector3.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GDAPI godot_basis_new_with_rows(godot_basis *r_dest, const godot_vector3 *p_x_axis, const godot_vector3 *p_y_axis, const godot_vector3 *p_z_axis);
|
||||
void GDAPI godot_basis_new_with_axis_and_angle(godot_basis *r_dest, const godot_vector3 *p_axis, const godot_real p_phi);
|
||||
void GDAPI godot_basis_new_with_euler(godot_basis *r_dest, const godot_vector3 *p_euler);
|
||||
void GDAPI godot_basis_new_with_euler_quat(godot_basis *r_dest, const godot_quat *p_euler);
|
||||
|
||||
godot_string GDAPI godot_basis_as_string(const godot_basis *p_self);
|
||||
|
||||
godot_basis GDAPI godot_basis_inverse(const godot_basis *p_self);
|
||||
|
||||
godot_basis GDAPI godot_basis_transposed(const godot_basis *p_self);
|
||||
|
||||
godot_basis GDAPI godot_basis_orthonormalized(const godot_basis *p_self);
|
||||
|
||||
godot_real GDAPI godot_basis_determinant(const godot_basis *p_self);
|
||||
|
||||
godot_basis GDAPI godot_basis_rotated(const godot_basis *p_self, const godot_vector3 *p_axis, const godot_real p_phi);
|
||||
|
||||
godot_basis GDAPI godot_basis_scaled(const godot_basis *p_self, const godot_vector3 *p_scale);
|
||||
|
||||
godot_vector3 GDAPI godot_basis_get_scale(const godot_basis *p_self);
|
||||
|
||||
godot_vector3 GDAPI godot_basis_get_euler(const godot_basis *p_self);
|
||||
|
||||
godot_quat GDAPI godot_basis_get_quat(const godot_basis *p_self);
|
||||
|
||||
void GDAPI godot_basis_set_quat(godot_basis *p_self, const godot_quat *p_quat);
|
||||
|
||||
void GDAPI godot_basis_set_axis_angle_scale(godot_basis *p_self, const godot_vector3 *p_axis, godot_real p_phi, const godot_vector3 *p_scale);
|
||||
|
||||
void GDAPI godot_basis_set_euler_scale(godot_basis *p_self, const godot_vector3 *p_euler, const godot_vector3 *p_scale);
|
||||
|
||||
void GDAPI godot_basis_set_quat_scale(godot_basis *p_self, const godot_quat *p_quat, const godot_vector3 *p_scale);
|
||||
|
||||
godot_real GDAPI godot_basis_tdotx(const godot_basis *p_self, const godot_vector3 *p_with);
|
||||
|
||||
godot_real GDAPI godot_basis_tdoty(const godot_basis *p_self, const godot_vector3 *p_with);
|
||||
|
||||
godot_real GDAPI godot_basis_tdotz(const godot_basis *p_self, const godot_vector3 *p_with);
|
||||
|
||||
godot_vector3 GDAPI godot_basis_xform(const godot_basis *p_self, const godot_vector3 *p_v);
|
||||
|
||||
godot_vector3 GDAPI godot_basis_xform_inv(const godot_basis *p_self, const godot_vector3 *p_v);
|
||||
|
||||
godot_int GDAPI godot_basis_get_orthogonal_index(const godot_basis *p_self);
|
||||
|
||||
void GDAPI godot_basis_new(godot_basis *r_dest);
|
||||
|
||||
// p_elements is a pointer to an array of 3 (!!) vector3
|
||||
void GDAPI godot_basis_get_elements(const godot_basis *p_self, godot_vector3 *p_elements);
|
||||
|
||||
godot_vector3 GDAPI godot_basis_get_axis(const godot_basis *p_self, const godot_int p_axis);
|
||||
|
||||
void GDAPI godot_basis_set_axis(godot_basis *p_self, const godot_int p_axis, const godot_vector3 *p_value);
|
||||
|
||||
godot_vector3 GDAPI godot_basis_get_row(const godot_basis *p_self, const godot_int p_row);
|
||||
|
||||
void GDAPI godot_basis_set_row(godot_basis *p_self, const godot_int p_row, const godot_vector3 *p_value);
|
||||
|
||||
godot_bool GDAPI godot_basis_operator_equal(const godot_basis *p_self, const godot_basis *p_b);
|
||||
|
||||
godot_basis GDAPI godot_basis_operator_add(const godot_basis *p_self, const godot_basis *p_b);
|
||||
|
||||
godot_basis GDAPI godot_basis_operator_subtract(const godot_basis *p_self, const godot_basis *p_b);
|
||||
|
||||
godot_basis GDAPI godot_basis_operator_multiply_vector(const godot_basis *p_self, const godot_basis *p_b);
|
||||
|
||||
godot_basis GDAPI godot_basis_operator_multiply_scalar(const godot_basis *p_self, const godot_real p_b);
|
||||
|
||||
godot_basis GDAPI godot_basis_slerp(const godot_basis *p_self, const godot_basis *p_b, const godot_real p_t);
|
||||
void GDAPI godot_basis_new(godot_basis *p_self);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -46,79 +46,11 @@ typedef struct {
|
|||
} godot_callable;
|
||||
#endif
|
||||
|
||||
#define GODOT_SIGNAL_SIZE (16)
|
||||
|
||||
#ifndef GODOT_CORE_API_GODOT_SIGNAL_TYPE_DEFINED
|
||||
#define GODOT_CORE_API_GODOT_SIGNAL_TYPE_DEFINED
|
||||
typedef struct {
|
||||
uint8_t _dont_touch_that[GODOT_SIGNAL_SIZE];
|
||||
} godot_signal;
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <gdnative/gdnative.h>
|
||||
#include <gdnative/string_name.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Callable
|
||||
|
||||
void GDAPI godot_callable_new_with_object(godot_callable *r_dest, const godot_object *p_object, const godot_string_name *p_method);
|
||||
void GDAPI godot_callable_new_with_object_id(godot_callable *r_dest, uint64_t p_objectid, const godot_string_name *p_method);
|
||||
void GDAPI godot_callable_new_copy(godot_callable *r_dest, const godot_callable *p_src);
|
||||
|
||||
void GDAPI godot_callable_new(godot_callable *p_self);
|
||||
void GDAPI godot_callable_destroy(godot_callable *p_self);
|
||||
|
||||
godot_int GDAPI godot_callable_call(const godot_callable *p_self, const godot_variant **p_arguments, godot_int p_argcount, godot_variant *r_return_value);
|
||||
void GDAPI godot_callable_call_deferred(const godot_callable *p_self, const godot_variant **p_arguments, godot_int p_argcount);
|
||||
|
||||
godot_bool GDAPI godot_callable_is_null(const godot_callable *p_self);
|
||||
godot_bool GDAPI godot_callable_is_custom(const godot_callable *p_self);
|
||||
godot_bool GDAPI godot_callable_is_standard(const godot_callable *p_self);
|
||||
|
||||
godot_object GDAPI *godot_callable_get_object(const godot_callable *p_self);
|
||||
uint64_t GDAPI godot_callable_get_object_id(const godot_callable *p_self);
|
||||
godot_string_name GDAPI godot_callable_get_method(const godot_callable *p_self);
|
||||
|
||||
uint32_t GDAPI godot_callable_hash(const godot_callable *p_self);
|
||||
|
||||
godot_string GDAPI godot_callable_as_string(const godot_callable *p_self);
|
||||
|
||||
godot_bool GDAPI godot_callable_operator_equal(const godot_callable *p_self, const godot_callable *p_other);
|
||||
godot_bool GDAPI godot_callable_operator_less(const godot_callable *p_self, const godot_callable *p_other);
|
||||
|
||||
// Signal
|
||||
|
||||
void GDAPI godot_signal_new_with_object(godot_signal *r_dest, const godot_object *p_object, const godot_string_name *p_name);
|
||||
void GDAPI godot_signal_new_with_object_id(godot_signal *r_dest, uint64_t p_objectid, const godot_string_name *p_name);
|
||||
void GDAPI godot_signal_new_copy(godot_signal *r_dest, const godot_signal *p_src);
|
||||
|
||||
void GDAPI godot_signal_destroy(godot_signal *p_self);
|
||||
|
||||
godot_int GDAPI godot_signal_emit(const godot_signal *p_self, const godot_variant **p_arguments, godot_int p_argcount);
|
||||
|
||||
godot_int GDAPI godot_signal_connect(godot_signal *p_self, const godot_callable *p_callable, const godot_array *p_binds, uint32_t p_flags);
|
||||
void GDAPI godot_signal_disconnect(godot_signal *p_self, const godot_callable *p_callable);
|
||||
|
||||
godot_bool GDAPI godot_signal_is_null(const godot_signal *p_self);
|
||||
godot_bool GDAPI godot_signal_is_connected(const godot_signal *p_self, const godot_callable *p_callable);
|
||||
|
||||
godot_array GDAPI godot_signal_get_connections(const godot_signal *p_self);
|
||||
|
||||
godot_object GDAPI *godot_signal_get_object(const godot_signal *p_self);
|
||||
uint64_t GDAPI godot_signal_get_object_id(const godot_signal *p_self);
|
||||
godot_string_name GDAPI godot_signal_get_name(const godot_signal *p_self);
|
||||
|
||||
godot_string GDAPI godot_signal_as_string(const godot_signal *p_self);
|
||||
|
||||
godot_bool GDAPI godot_signal_operator_equal(const godot_signal *p_self, const godot_signal *p_other);
|
||||
godot_bool GDAPI godot_signal_operator_less(const godot_signal *p_self, const godot_signal *p_other);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -46,68 +46,9 @@ typedef struct {
|
|||
} godot_color;
|
||||
#endif
|
||||
|
||||
// reduce extern "C" nesting for VS2013
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <gdnative/gdnative.h>
|
||||
#include <gdnative/string.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GDAPI godot_color_new_rgba(godot_color *r_dest, const godot_real p_r, const godot_real p_g, const godot_real p_b, const godot_real p_a);
|
||||
void GDAPI godot_color_new_rgb(godot_color *r_dest, const godot_real p_r, const godot_real p_g, const godot_real p_b);
|
||||
|
||||
godot_real godot_color_get_r(const godot_color *p_self);
|
||||
void godot_color_set_r(godot_color *p_self, const godot_real r);
|
||||
|
||||
godot_real godot_color_get_g(const godot_color *p_self);
|
||||
void godot_color_set_g(godot_color *p_self, const godot_real g);
|
||||
|
||||
godot_real godot_color_get_b(const godot_color *p_self);
|
||||
void godot_color_set_b(godot_color *p_self, const godot_real b);
|
||||
|
||||
godot_real godot_color_get_a(const godot_color *p_self);
|
||||
void godot_color_set_a(godot_color *p_self, const godot_real a);
|
||||
|
||||
godot_real godot_color_get_h(const godot_color *p_self);
|
||||
godot_real godot_color_get_s(const godot_color *p_self);
|
||||
godot_real godot_color_get_v(const godot_color *p_self);
|
||||
|
||||
godot_string GDAPI godot_color_as_string(const godot_color *p_self);
|
||||
|
||||
godot_int GDAPI godot_color_to_rgba32(const godot_color *p_self);
|
||||
|
||||
godot_int GDAPI godot_color_to_abgr32(const godot_color *p_self);
|
||||
|
||||
godot_int GDAPI godot_color_to_abgr64(const godot_color *p_self);
|
||||
|
||||
godot_int GDAPI godot_color_to_argb64(const godot_color *p_self);
|
||||
|
||||
godot_int GDAPI godot_color_to_rgba64(const godot_color *p_self);
|
||||
|
||||
godot_int GDAPI godot_color_to_argb32(const godot_color *p_self);
|
||||
|
||||
godot_color GDAPI godot_color_inverted(const godot_color *p_self);
|
||||
|
||||
godot_color GDAPI godot_color_lerp(const godot_color *p_self, const godot_color *p_b, const godot_real p_t);
|
||||
|
||||
godot_color GDAPI godot_color_blend(const godot_color *p_self, const godot_color *p_over);
|
||||
|
||||
godot_color GDAPI godot_color_darkened(const godot_color *p_self, const godot_real p_amount);
|
||||
|
||||
godot_color GDAPI godot_color_from_hsv(const godot_color *p_self, const godot_real p_h, const godot_real p_s, const godot_real p_v, const godot_real p_a);
|
||||
|
||||
godot_color GDAPI godot_color_lightened(const godot_color *p_self, const godot_real p_amount);
|
||||
|
||||
godot_string GDAPI godot_color_to_html(const godot_color *p_self, const godot_bool p_with_alpha);
|
||||
|
||||
godot_bool GDAPI godot_color_operator_equal(const godot_color *p_self, const godot_color *p_b);
|
||||
|
||||
godot_bool GDAPI godot_color_operator_less(const godot_color *p_self, const godot_color *p_b);
|
||||
void GDAPI godot_color_new(godot_color *p_self);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -46,62 +46,11 @@ typedef struct {
|
|||
} godot_dictionary;
|
||||
#endif
|
||||
|
||||
// reduce extern "C" nesting for VS2013
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <gdnative/array.h>
|
||||
#include <gdnative/gdnative.h>
|
||||
#include <gdnative/variant.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GDAPI godot_dictionary_new(godot_dictionary *r_dest);
|
||||
void GDAPI godot_dictionary_new_copy(godot_dictionary *r_dest, const godot_dictionary *p_src);
|
||||
void GDAPI godot_dictionary_new(godot_dictionary *p_self);
|
||||
void GDAPI godot_dictionary_destroy(godot_dictionary *p_self);
|
||||
|
||||
godot_dictionary GDAPI godot_dictionary_duplicate(const godot_dictionary *p_self, const godot_bool p_deep);
|
||||
|
||||
godot_int GDAPI godot_dictionary_size(const godot_dictionary *p_self);
|
||||
|
||||
godot_bool GDAPI godot_dictionary_is_empty(const godot_dictionary *p_self);
|
||||
|
||||
void GDAPI godot_dictionary_clear(godot_dictionary *p_self);
|
||||
|
||||
godot_bool GDAPI godot_dictionary_has(const godot_dictionary *p_self, const godot_variant *p_key);
|
||||
|
||||
godot_bool GDAPI godot_dictionary_has_all(const godot_dictionary *p_self, const godot_array *p_keys);
|
||||
|
||||
void GDAPI godot_dictionary_erase(godot_dictionary *p_self, const godot_variant *p_key);
|
||||
|
||||
godot_int GDAPI godot_dictionary_hash(const godot_dictionary *p_self);
|
||||
|
||||
godot_array GDAPI godot_dictionary_keys(const godot_dictionary *p_self);
|
||||
|
||||
godot_array GDAPI godot_dictionary_values(const godot_dictionary *p_self);
|
||||
|
||||
godot_variant GDAPI godot_dictionary_get(const godot_dictionary *p_self, const godot_variant *p_key);
|
||||
void GDAPI godot_dictionary_set(godot_dictionary *p_self, const godot_variant *p_key, const godot_variant *p_value);
|
||||
|
||||
godot_variant GDAPI *godot_dictionary_operator_index(godot_dictionary *p_self, const godot_variant *p_key);
|
||||
|
||||
const godot_variant GDAPI *godot_dictionary_operator_index_const(const godot_dictionary *p_self, const godot_variant *p_key);
|
||||
|
||||
godot_variant GDAPI *godot_dictionary_next(const godot_dictionary *p_self, const godot_variant *p_key);
|
||||
|
||||
godot_bool GDAPI godot_dictionary_operator_equal(const godot_dictionary *p_self, const godot_dictionary *p_b);
|
||||
|
||||
godot_string GDAPI godot_dictionary_to_json(const godot_dictionary *p_self);
|
||||
|
||||
// GDNative core 1.1
|
||||
|
||||
godot_bool GDAPI godot_dictionary_erase_with_return(godot_dictionary *p_self, const godot_variant *p_key);
|
||||
|
||||
godot_variant GDAPI godot_dictionary_get_with_default(const godot_dictionary *p_self, const godot_variant *p_key, const godot_variant *p_default);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -118,21 +118,6 @@ typedef enum {
|
|||
GODOT_ERR_PRINTER_ON_FIRE, /// the parallel port printer is engulfed in flames
|
||||
} godot_error;
|
||||
|
||||
////// bool
|
||||
|
||||
typedef bool godot_bool;
|
||||
|
||||
#define GODOT_TRUE 1
|
||||
#define GODOT_FALSE 0
|
||||
|
||||
/////// int
|
||||
|
||||
typedef int64_t godot_int;
|
||||
|
||||
/////// real
|
||||
|
||||
typedef float godot_real;
|
||||
|
||||
/////// Object (forward declared)
|
||||
typedef void godot_object;
|
||||
|
||||
|
@ -215,7 +200,7 @@ void GDAPI godot_object_destroy(godot_object *p_o);
|
|||
|
||||
////// Singleton API
|
||||
|
||||
godot_object GDAPI *godot_global_get_singleton(char *p_name); // result shouldn't be freed
|
||||
godot_object GDAPI *godot_global_get_singleton(char *p_name); // Result shouldn't be freed.
|
||||
|
||||
////// MethodBind API
|
||||
|
||||
|
@ -301,4 +286,4 @@ uint64_t GDAPI godot_object_get_instance_id(const godot_object *p_object);
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif // GODOT_C_H
|
||||
#endif // GODOT_GDNATIVE_H
|
||||
|
|
|
@ -46,42 +46,11 @@ typedef struct {
|
|||
} godot_node_path;
|
||||
#endif
|
||||
|
||||
// reduce extern "C" nesting for VS2013
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <gdnative/gdnative.h>
|
||||
#include <gdnative/string.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GDAPI godot_node_path_new(godot_node_path *r_dest, const godot_string *p_from);
|
||||
void GDAPI godot_node_path_new_copy(godot_node_path *r_dest, const godot_node_path *p_src);
|
||||
void GDAPI godot_node_path_new(godot_node_path *p_self);
|
||||
void GDAPI godot_node_path_destroy(godot_node_path *p_self);
|
||||
|
||||
godot_string GDAPI godot_node_path_as_string(const godot_node_path *p_self);
|
||||
|
||||
godot_bool GDAPI godot_node_path_is_absolute(const godot_node_path *p_self);
|
||||
|
||||
godot_int GDAPI godot_node_path_get_name_count(const godot_node_path *p_self);
|
||||
|
||||
godot_string GDAPI godot_node_path_get_name(const godot_node_path *p_self, const godot_int p_idx);
|
||||
|
||||
godot_int GDAPI godot_node_path_get_subname_count(const godot_node_path *p_self);
|
||||
|
||||
godot_string GDAPI godot_node_path_get_subname(const godot_node_path *p_self, const godot_int p_idx);
|
||||
|
||||
godot_string GDAPI godot_node_path_get_concatenated_subnames(const godot_node_path *p_self);
|
||||
|
||||
godot_bool GDAPI godot_node_path_is_empty(const godot_node_path *p_self);
|
||||
|
||||
godot_bool GDAPI godot_node_path_operator_equal(const godot_node_path *p_self, const godot_node_path *p_b);
|
||||
|
||||
godot_node_path godot_node_path_get_as_property_path(const godot_node_path *p_self);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -136,6 +136,17 @@ typedef struct {
|
|||
} godot_packed_vector3_array;
|
||||
#endif
|
||||
|
||||
/////// PackedVector3iArray
|
||||
|
||||
#define GODOT_PACKED_VECTOR3I_ARRAY_SIZE (2 * sizeof(void *))
|
||||
|
||||
#ifndef GODOT_CORE_API_GODOT_PACKED_VECTOR3I_ARRAY_TYPE_DEFINED
|
||||
#define GODOT_CORE_API_GODOT_PACKED_VECTOR3I_ARRAY_TYPE_DEFINED
|
||||
typedef struct {
|
||||
uint8_t _dont_touch_that[GODOT_PACKED_VECTOR3I_ARRAY_SIZE];
|
||||
} godot_packed_vector3i_array;
|
||||
#endif
|
||||
|
||||
/////// PackedColorArray
|
||||
|
||||
#define GODOT_PACKED_COLOR_ARRAY_SIZE (2 * sizeof(void *))
|
||||
|
@ -147,380 +158,56 @@ typedef struct {
|
|||
} godot_packed_color_array;
|
||||
#endif
|
||||
|
||||
// reduce extern "C" nesting for VS2013
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <gdnative/array.h>
|
||||
#include <gdnative/color.h>
|
||||
#include <gdnative/vector2.h>
|
||||
#include <gdnative/vector3.h>
|
||||
|
||||
#include <gdnative/gdnative.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// byte
|
||||
|
||||
void GDAPI godot_packed_byte_array_new(godot_packed_byte_array *r_dest);
|
||||
void GDAPI godot_packed_byte_array_new_copy(godot_packed_byte_array *r_dest, const godot_packed_byte_array *p_src);
|
||||
void GDAPI godot_packed_byte_array_new_with_array(godot_packed_byte_array *r_dest, const godot_array *p_a);
|
||||
|
||||
const uint8_t GDAPI *godot_packed_byte_array_ptr(const godot_packed_byte_array *p_self);
|
||||
uint8_t GDAPI *godot_packed_byte_array_ptrw(godot_packed_byte_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_byte_array_append(godot_packed_byte_array *p_self, const uint8_t p_data);
|
||||
|
||||
void GDAPI godot_packed_byte_array_append_array(godot_packed_byte_array *p_self, const godot_packed_byte_array *p_array);
|
||||
|
||||
godot_error GDAPI godot_packed_byte_array_insert(godot_packed_byte_array *p_self, const godot_int p_idx, const uint8_t p_data);
|
||||
|
||||
godot_bool GDAPI godot_packed_byte_array_has(godot_packed_byte_array *p_self, const uint8_t p_value);
|
||||
|
||||
void GDAPI godot_packed_byte_array_sort(godot_packed_byte_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_byte_array_invert(godot_packed_byte_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_byte_array_push_back(godot_packed_byte_array *p_self, const uint8_t p_data);
|
||||
|
||||
void GDAPI godot_packed_byte_array_remove(godot_packed_byte_array *p_self, const godot_int p_idx);
|
||||
|
||||
void GDAPI godot_packed_byte_array_resize(godot_packed_byte_array *p_self, const godot_int p_size);
|
||||
|
||||
void GDAPI godot_packed_byte_array_set(godot_packed_byte_array *p_self, const godot_int p_idx, const uint8_t p_data);
|
||||
uint8_t GDAPI godot_packed_byte_array_get(const godot_packed_byte_array *p_self, const godot_int p_idx);
|
||||
|
||||
godot_int GDAPI godot_packed_byte_array_size(const godot_packed_byte_array *p_self);
|
||||
|
||||
godot_bool GDAPI godot_packed_byte_array_is_empty(const godot_packed_byte_array *p_self);
|
||||
// Byte.
|
||||
|
||||
void GDAPI godot_packed_byte_array_new(godot_packed_byte_array *p_self);
|
||||
void GDAPI godot_packed_byte_array_destroy(godot_packed_byte_array *p_self);
|
||||
|
||||
// int32
|
||||
|
||||
void GDAPI godot_packed_int32_array_new(godot_packed_int32_array *r_dest);
|
||||
void GDAPI godot_packed_int32_array_new_copy(godot_packed_int32_array *r_dest, const godot_packed_int32_array *p_src);
|
||||
void GDAPI godot_packed_int32_array_new_with_array(godot_packed_int32_array *r_dest, const godot_array *p_a);
|
||||
|
||||
const int32_t GDAPI *godot_packed_int32_array_ptr(const godot_packed_int32_array *p_self);
|
||||
int32_t GDAPI *godot_packed_int32_array_ptrw(godot_packed_int32_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_int32_array_append(godot_packed_int32_array *p_self, const int32_t p_data);
|
||||
|
||||
void GDAPI godot_packed_int32_array_append_array(godot_packed_int32_array *p_self, const godot_packed_int32_array *p_array);
|
||||
|
||||
godot_error GDAPI godot_packed_int32_array_insert(godot_packed_int32_array *p_self, const godot_int p_idx, const int32_t p_data);
|
||||
|
||||
godot_bool GDAPI godot_packed_int32_array_has(godot_packed_int32_array *p_self, const int32_t p_value);
|
||||
|
||||
void GDAPI godot_packed_int32_array_sort(godot_packed_int32_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_int32_array_invert(godot_packed_int32_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_int32_array_push_back(godot_packed_int32_array *p_self, const int32_t p_data);
|
||||
|
||||
void GDAPI godot_packed_int32_array_remove(godot_packed_int32_array *p_self, const godot_int p_idx);
|
||||
|
||||
void GDAPI godot_packed_int32_array_resize(godot_packed_int32_array *p_self, const godot_int p_size);
|
||||
|
||||
void GDAPI godot_packed_int32_array_set(godot_packed_int32_array *p_self, const godot_int p_idx, const int32_t p_data);
|
||||
int32_t GDAPI godot_packed_int32_array_get(const godot_packed_int32_array *p_self, const godot_int p_idx);
|
||||
|
||||
godot_int GDAPI godot_packed_int32_array_size(const godot_packed_int32_array *p_self);
|
||||
|
||||
godot_bool GDAPI godot_packed_int32_array_is_empty(const godot_packed_int32_array *p_self);
|
||||
// Int32.
|
||||
|
||||
void GDAPI godot_packed_int32_array_new(godot_packed_int32_array *p_self);
|
||||
void GDAPI godot_packed_int32_array_destroy(godot_packed_int32_array *p_self);
|
||||
|
||||
// int64
|
||||
|
||||
void GDAPI godot_packed_int64_array_new(godot_packed_int64_array *r_dest);
|
||||
void GDAPI godot_packed_int64_array_new_copy(godot_packed_int64_array *r_dest, const godot_packed_int64_array *p_src);
|
||||
void GDAPI godot_packed_int64_array_new_with_array(godot_packed_int64_array *r_dest, const godot_array *p_a);
|
||||
|
||||
const int64_t GDAPI *godot_packed_int64_array_ptr(const godot_packed_int64_array *p_self);
|
||||
int64_t GDAPI *godot_packed_int64_array_ptrw(godot_packed_int64_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_int64_array_append(godot_packed_int64_array *p_self, const int64_t p_data);
|
||||
|
||||
void GDAPI godot_packed_int64_array_append_array(godot_packed_int64_array *p_self, const godot_packed_int64_array *p_array);
|
||||
|
||||
godot_error GDAPI godot_packed_int64_array_insert(godot_packed_int64_array *p_self, const godot_int p_idx, const int64_t p_data);
|
||||
|
||||
godot_bool GDAPI godot_packed_int64_array_has(godot_packed_int64_array *p_self, const int64_t p_value);
|
||||
|
||||
void GDAPI godot_packed_int64_array_sort(godot_packed_int64_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_int64_array_invert(godot_packed_int64_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_int64_array_push_back(godot_packed_int64_array *p_self, const int64_t p_data);
|
||||
|
||||
void GDAPI godot_packed_int64_array_remove(godot_packed_int64_array *p_self, const godot_int p_idx);
|
||||
|
||||
void GDAPI godot_packed_int64_array_resize(godot_packed_int64_array *p_self, const godot_int p_size);
|
||||
|
||||
void GDAPI godot_packed_int64_array_set(godot_packed_int64_array *p_self, const godot_int p_idx, const int64_t p_data);
|
||||
int64_t GDAPI godot_packed_int64_array_get(const godot_packed_int64_array *p_self, const godot_int p_idx);
|
||||
|
||||
godot_int GDAPI godot_packed_int64_array_size(const godot_packed_int64_array *p_self);
|
||||
|
||||
godot_bool GDAPI godot_packed_int64_array_is_empty(const godot_packed_int64_array *p_self);
|
||||
// Int64.
|
||||
|
||||
void GDAPI godot_packed_int64_array_new(godot_packed_int64_array *p_self);
|
||||
void GDAPI godot_packed_int64_array_destroy(godot_packed_int64_array *p_self);
|
||||
|
||||
// float32
|
||||
|
||||
void GDAPI godot_packed_float32_array_new(godot_packed_float32_array *r_dest);
|
||||
void GDAPI godot_packed_float32_array_new_copy(godot_packed_float32_array *r_dest, const godot_packed_float32_array *p_src);
|
||||
void GDAPI godot_packed_float32_array_new_with_array(godot_packed_float32_array *r_dest, const godot_array *p_a);
|
||||
|
||||
const float GDAPI *godot_packed_float32_array_ptr(const godot_packed_float32_array *p_self);
|
||||
float GDAPI *godot_packed_float32_array_ptrw(godot_packed_float32_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_float32_array_append(godot_packed_float32_array *p_self, const float p_data);
|
||||
|
||||
void GDAPI godot_packed_float32_array_append_array(godot_packed_float32_array *p_self, const godot_packed_float32_array *p_array);
|
||||
|
||||
godot_error GDAPI godot_packed_float32_array_insert(godot_packed_float32_array *p_self, const godot_int p_idx, const float p_data);
|
||||
|
||||
godot_bool GDAPI godot_packed_float32_array_has(godot_packed_float32_array *p_self, const float p_value);
|
||||
|
||||
void GDAPI godot_packed_float32_array_sort(godot_packed_float32_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_float32_array_invert(godot_packed_float32_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_float32_array_push_back(godot_packed_float32_array *p_self, const float p_data);
|
||||
|
||||
void GDAPI godot_packed_float32_array_remove(godot_packed_float32_array *p_self, const godot_int p_idx);
|
||||
|
||||
void GDAPI godot_packed_float32_array_resize(godot_packed_float32_array *p_self, const godot_int p_size);
|
||||
|
||||
void GDAPI godot_packed_float32_array_set(godot_packed_float32_array *p_self, const godot_int p_idx, const float p_data);
|
||||
float GDAPI godot_packed_float32_array_get(const godot_packed_float32_array *p_self, const godot_int p_idx);
|
||||
|
||||
godot_int GDAPI godot_packed_float32_array_size(const godot_packed_float32_array *p_self);
|
||||
|
||||
godot_bool GDAPI godot_packed_float32_array_is_empty(const godot_packed_float32_array *p_self);
|
||||
// Float32.
|
||||
|
||||
void GDAPI godot_packed_float32_array_new(godot_packed_float32_array *p_self);
|
||||
void GDAPI godot_packed_float32_array_destroy(godot_packed_float32_array *p_self);
|
||||
|
||||
// float64
|
||||
|
||||
void GDAPI godot_packed_float64_array_new(godot_packed_float64_array *r_dest);
|
||||
void GDAPI godot_packed_float64_array_new_copy(godot_packed_float64_array *r_dest, const godot_packed_float64_array *p_src);
|
||||
void GDAPI godot_packed_float64_array_new_with_array(godot_packed_float64_array *r_dest, const godot_array *p_a);
|
||||
|
||||
const double GDAPI *godot_packed_float64_array_ptr(const godot_packed_float64_array *p_self);
|
||||
double GDAPI *godot_packed_float64_array_ptrw(godot_packed_float64_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_float64_array_append(godot_packed_float64_array *p_self, const double p_data);
|
||||
|
||||
void GDAPI godot_packed_float64_array_append_array(godot_packed_float64_array *p_self, const godot_packed_float64_array *p_array);
|
||||
|
||||
godot_error GDAPI godot_packed_float64_array_insert(godot_packed_float64_array *p_self, const godot_int p_idx, const double p_data);
|
||||
|
||||
godot_bool GDAPI godot_packed_float64_array_has(godot_packed_float64_array *p_self, const double p_value);
|
||||
|
||||
void GDAPI godot_packed_float64_array_sort(godot_packed_float64_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_float64_array_invert(godot_packed_float64_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_float64_array_push_back(godot_packed_float64_array *p_self, const double p_data);
|
||||
|
||||
void GDAPI godot_packed_float64_array_remove(godot_packed_float64_array *p_self, const godot_int p_idx);
|
||||
|
||||
void GDAPI godot_packed_float64_array_resize(godot_packed_float64_array *p_self, const godot_int p_size);
|
||||
|
||||
void GDAPI godot_packed_float64_array_set(godot_packed_float64_array *p_self, const godot_int p_idx, const double p_data);
|
||||
double GDAPI godot_packed_float64_array_get(const godot_packed_float64_array *p_self, const godot_int p_idx);
|
||||
|
||||
godot_int GDAPI godot_packed_float64_array_size(const godot_packed_float64_array *p_self);
|
||||
|
||||
godot_bool GDAPI godot_packed_float64_array_is_empty(const godot_packed_float64_array *p_self);
|
||||
// Float64.
|
||||
|
||||
void GDAPI godot_packed_float64_array_new(godot_packed_float64_array *p_self);
|
||||
void GDAPI godot_packed_float64_array_destroy(godot_packed_float64_array *p_self);
|
||||
|
||||
// string
|
||||
|
||||
void GDAPI godot_packed_string_array_new(godot_packed_string_array *r_dest);
|
||||
void GDAPI godot_packed_string_array_new_copy(godot_packed_string_array *r_dest, const godot_packed_string_array *p_src);
|
||||
void GDAPI godot_packed_string_array_new_with_array(godot_packed_string_array *r_dest, const godot_array *p_a);
|
||||
|
||||
const godot_string GDAPI *godot_packed_string_array_ptr(const godot_packed_string_array *p_self);
|
||||
godot_string GDAPI *godot_packed_string_array_ptrw(godot_packed_string_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_string_array_append(godot_packed_string_array *p_self, const godot_string *p_data);
|
||||
|
||||
void GDAPI godot_packed_string_array_append_array(godot_packed_string_array *p_self, const godot_packed_string_array *p_array);
|
||||
|
||||
godot_error GDAPI godot_packed_string_array_insert(godot_packed_string_array *p_self, const godot_int p_idx, const godot_string *p_data);
|
||||
|
||||
godot_bool GDAPI godot_packed_string_array_has(godot_packed_string_array *p_self, const godot_string *p_value);
|
||||
|
||||
void GDAPI godot_packed_string_array_sort(godot_packed_string_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_string_array_invert(godot_packed_string_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_string_array_push_back(godot_packed_string_array *p_self, const godot_string *p_data);
|
||||
|
||||
void GDAPI godot_packed_string_array_remove(godot_packed_string_array *p_self, const godot_int p_idx);
|
||||
|
||||
void GDAPI godot_packed_string_array_resize(godot_packed_string_array *p_self, const godot_int p_size);
|
||||
|
||||
void GDAPI godot_packed_string_array_set(godot_packed_string_array *p_self, const godot_int p_idx, const godot_string *p_data);
|
||||
godot_string GDAPI godot_packed_string_array_get(const godot_packed_string_array *p_self, const godot_int p_idx);
|
||||
|
||||
godot_int GDAPI godot_packed_string_array_size(const godot_packed_string_array *p_self);
|
||||
|
||||
godot_bool GDAPI godot_packed_string_array_is_empty(const godot_packed_string_array *p_self);
|
||||
// String.
|
||||
|
||||
void GDAPI godot_packed_string_array_new(godot_packed_string_array *p_self);
|
||||
void GDAPI godot_packed_string_array_destroy(godot_packed_string_array *p_self);
|
||||
|
||||
// vector2
|
||||
|
||||
void GDAPI godot_packed_vector2_array_new(godot_packed_vector2_array *r_dest);
|
||||
void GDAPI godot_packed_vector2_array_new_copy(godot_packed_vector2_array *r_dest, const godot_packed_vector2_array *p_src);
|
||||
void GDAPI godot_packed_vector2_array_new_with_array(godot_packed_vector2_array *r_dest, const godot_array *p_a);
|
||||
|
||||
const godot_vector2 GDAPI *godot_packed_vector2_array_ptr(const godot_packed_vector2_array *p_self);
|
||||
godot_vector2 GDAPI *godot_packed_vector2_array_ptrw(godot_packed_vector2_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_vector2_array_append(godot_packed_vector2_array *p_self, const godot_vector2 *p_data);
|
||||
|
||||
void GDAPI godot_packed_vector2_array_append_array(godot_packed_vector2_array *p_self, const godot_packed_vector2_array *p_array);
|
||||
|
||||
godot_error GDAPI godot_packed_vector2_array_insert(godot_packed_vector2_array *p_self, const godot_int p_idx, const godot_vector2 *p_data);
|
||||
|
||||
godot_bool GDAPI godot_packed_vector2_array_has(godot_packed_vector2_array *p_self, const godot_vector2 *p_value);
|
||||
|
||||
void GDAPI godot_packed_vector2_array_sort(godot_packed_vector2_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_vector2_array_invert(godot_packed_vector2_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_vector2_array_push_back(godot_packed_vector2_array *p_self, const godot_vector2 *p_data);
|
||||
|
||||
void GDAPI godot_packed_vector2_array_remove(godot_packed_vector2_array *p_self, const godot_int p_idx);
|
||||
|
||||
void GDAPI godot_packed_vector2_array_resize(godot_packed_vector2_array *p_self, const godot_int p_size);
|
||||
|
||||
void GDAPI godot_packed_vector2_array_set(godot_packed_vector2_array *p_self, const godot_int p_idx, const godot_vector2 *p_data);
|
||||
godot_vector2 GDAPI godot_packed_vector2_array_get(const godot_packed_vector2_array *p_self, const godot_int p_idx);
|
||||
|
||||
godot_int GDAPI godot_packed_vector2_array_size(const godot_packed_vector2_array *p_self);
|
||||
|
||||
godot_bool GDAPI godot_packed_vector2_array_is_empty(const godot_packed_vector2_array *p_self);
|
||||
// Vector2.
|
||||
|
||||
void GDAPI godot_packed_vector2_array_new(godot_packed_vector2_array *p_self);
|
||||
void GDAPI godot_packed_vector2_array_destroy(godot_packed_vector2_array *p_self);
|
||||
|
||||
// vector2i
|
||||
|
||||
void GDAPI godot_packed_vector2i_array_new(godot_packed_vector2i_array *r_dest);
|
||||
void GDAPI godot_packed_vector2i_array_new_copy(godot_packed_vector2i_array *r_dest, const godot_packed_vector2i_array *p_src);
|
||||
void GDAPI godot_packed_vector2i_array_new_with_array(godot_packed_vector2i_array *r_dest, const godot_array *p_a);
|
||||
|
||||
const godot_vector2i GDAPI *godot_packed_vector2i_array_ptr(const godot_packed_vector2i_array *p_self);
|
||||
godot_vector2i GDAPI *godot_packed_vector2i_array_ptrw(godot_packed_vector2i_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_vector2i_array_append(godot_packed_vector2i_array *p_self, const godot_vector2i *p_data);
|
||||
|
||||
void GDAPI godot_packed_vector2i_array_append_array(godot_packed_vector2i_array *p_self, const godot_packed_vector2i_array *p_array);
|
||||
|
||||
godot_error GDAPI godot_packed_vector2i_array_insert(godot_packed_vector2i_array *p_self, const godot_int p_idx, const godot_vector2i *p_data);
|
||||
|
||||
godot_bool GDAPI godot_packed_vector2i_array_has(godot_packed_vector2i_array *p_self, const godot_vector2i *p_value);
|
||||
|
||||
void GDAPI godot_packed_vector2i_array_sort(godot_packed_vector2i_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_vector2i_array_invert(godot_packed_vector2i_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_vector2i_array_push_back(godot_packed_vector2i_array *p_self, const godot_vector2i *p_data);
|
||||
|
||||
void GDAPI godot_packed_vector2i_array_remove(godot_packed_vector2i_array *p_self, const godot_int p_idx);
|
||||
|
||||
void GDAPI godot_packed_vector2i_array_resize(godot_packed_vector2i_array *p_self, const godot_int p_size);
|
||||
|
||||
void GDAPI godot_packed_vector2i_array_set(godot_packed_vector2i_array *p_self, const godot_int p_idx, const godot_vector2i *p_data);
|
||||
godot_vector2i GDAPI godot_packed_vector2i_array_get(const godot_packed_vector2i_array *p_self, const godot_int p_idx);
|
||||
|
||||
godot_int GDAPI godot_packed_vector2i_array_size(const godot_packed_vector2i_array *p_self);
|
||||
|
||||
godot_bool GDAPI godot_packed_vector2i_array_is_empty(const godot_packed_vector2i_array *p_self);
|
||||
// Vector2i.
|
||||
|
||||
void GDAPI godot_packed_vector2i_array_new(godot_packed_vector2i_array *p_self);
|
||||
void GDAPI godot_packed_vector2i_array_destroy(godot_packed_vector2i_array *p_self);
|
||||
|
||||
// vector3
|
||||
|
||||
void GDAPI godot_packed_vector3_array_new(godot_packed_vector3_array *r_dest);
|
||||
void GDAPI godot_packed_vector3_array_new_copy(godot_packed_vector3_array *r_dest, const godot_packed_vector3_array *p_src);
|
||||
void GDAPI godot_packed_vector3_array_new_with_array(godot_packed_vector3_array *r_dest, const godot_array *p_a);
|
||||
|
||||
const godot_vector3 GDAPI *godot_packed_vector3_array_ptr(const godot_packed_vector3_array *p_self);
|
||||
godot_vector3 GDAPI *godot_packed_vector3_array_ptrw(godot_packed_vector3_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_vector3_array_append(godot_packed_vector3_array *p_self, const godot_vector3 *p_data);
|
||||
|
||||
void GDAPI godot_packed_vector3_array_append_array(godot_packed_vector3_array *p_self, const godot_packed_vector3_array *p_array);
|
||||
|
||||
godot_error GDAPI godot_packed_vector3_array_insert(godot_packed_vector3_array *p_self, const godot_int p_idx, const godot_vector3 *p_data);
|
||||
|
||||
godot_bool GDAPI godot_packed_vector3_array_has(godot_packed_vector3_array *p_self, const godot_vector3 *p_value);
|
||||
|
||||
void GDAPI godot_packed_vector3_array_sort(godot_packed_vector3_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_vector3_array_invert(godot_packed_vector3_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_vector3_array_push_back(godot_packed_vector3_array *p_self, const godot_vector3 *p_data);
|
||||
|
||||
void GDAPI godot_packed_vector3_array_remove(godot_packed_vector3_array *p_self, const godot_int p_idx);
|
||||
|
||||
void GDAPI godot_packed_vector3_array_resize(godot_packed_vector3_array *p_self, const godot_int p_size);
|
||||
|
||||
void GDAPI godot_packed_vector3_array_set(godot_packed_vector3_array *p_self, const godot_int p_idx, const godot_vector3 *p_data);
|
||||
godot_vector3 GDAPI godot_packed_vector3_array_get(const godot_packed_vector3_array *p_self, const godot_int p_idx);
|
||||
|
||||
godot_int GDAPI godot_packed_vector3_array_size(const godot_packed_vector3_array *p_self);
|
||||
|
||||
godot_bool GDAPI godot_packed_vector3_array_is_empty(const godot_packed_vector3_array *p_self);
|
||||
// Vector3.
|
||||
|
||||
void GDAPI godot_packed_vector3_array_new(godot_packed_vector3_array *p_self);
|
||||
void GDAPI godot_packed_vector3_array_destroy(godot_packed_vector3_array *p_self);
|
||||
|
||||
// color
|
||||
|
||||
void GDAPI godot_packed_color_array_new(godot_packed_color_array *r_dest);
|
||||
void GDAPI godot_packed_color_array_new_copy(godot_packed_color_array *r_dest, const godot_packed_color_array *p_src);
|
||||
void GDAPI godot_packed_color_array_new_with_array(godot_packed_color_array *r_dest, const godot_array *p_a);
|
||||
|
||||
const godot_color GDAPI *godot_packed_color_array_ptr(const godot_packed_color_array *p_self);
|
||||
godot_color GDAPI *godot_packed_color_array_ptrw(godot_packed_color_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_color_array_append(godot_packed_color_array *p_self, const godot_color *p_data);
|
||||
|
||||
void GDAPI godot_packed_color_array_append_array(godot_packed_color_array *p_self, const godot_packed_color_array *p_array);
|
||||
|
||||
godot_error GDAPI godot_packed_color_array_insert(godot_packed_color_array *p_self, const godot_int p_idx, const godot_color *p_data);
|
||||
|
||||
godot_bool GDAPI godot_packed_color_array_has(godot_packed_color_array *p_self, const godot_color *p_value);
|
||||
|
||||
void GDAPI godot_packed_color_array_sort(godot_packed_color_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_color_array_invert(godot_packed_color_array *p_self);
|
||||
|
||||
void GDAPI godot_packed_color_array_push_back(godot_packed_color_array *p_self, const godot_color *p_data);
|
||||
|
||||
void GDAPI godot_packed_color_array_remove(godot_packed_color_array *p_self, const godot_int p_idx);
|
||||
|
||||
void GDAPI godot_packed_color_array_resize(godot_packed_color_array *p_self, const godot_int p_size);
|
||||
|
||||
void GDAPI godot_packed_color_array_set(godot_packed_color_array *p_self, const godot_int p_idx, const godot_color *p_data);
|
||||
godot_color GDAPI godot_packed_color_array_get(const godot_packed_color_array *p_self, const godot_int p_idx);
|
||||
|
||||
godot_int GDAPI godot_packed_color_array_size(const godot_packed_color_array *p_self);
|
||||
|
||||
godot_bool GDAPI godot_packed_color_array_is_empty(const godot_packed_color_array *p_self);
|
||||
// Color.
|
||||
|
||||
void GDAPI godot_packed_color_array_new(godot_packed_color_array *p_self);
|
||||
void GDAPI godot_packed_color_array_destroy(godot_packed_color_array *p_self);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -46,53 +46,9 @@ typedef struct {
|
|||
} godot_plane;
|
||||
#endif
|
||||
|
||||
// reduce extern "C" nesting for VS2013
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <gdnative/gdnative.h>
|
||||
#include <gdnative/vector3.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GDAPI godot_plane_new_with_reals(godot_plane *r_dest, const godot_real p_a, const godot_real p_b, const godot_real p_c, const godot_real p_d);
|
||||
void GDAPI godot_plane_new_with_vectors(godot_plane *r_dest, const godot_vector3 *p_v1, const godot_vector3 *p_v2, const godot_vector3 *p_v3);
|
||||
void GDAPI godot_plane_new_with_normal(godot_plane *r_dest, const godot_vector3 *p_normal, const godot_real p_d);
|
||||
|
||||
godot_string GDAPI godot_plane_as_string(const godot_plane *p_self);
|
||||
|
||||
godot_plane GDAPI godot_plane_normalized(const godot_plane *p_self);
|
||||
|
||||
godot_vector3 GDAPI godot_plane_center(const godot_plane *p_self);
|
||||
|
||||
godot_bool GDAPI godot_plane_is_point_over(const godot_plane *p_self, const godot_vector3 *p_point);
|
||||
|
||||
godot_real GDAPI godot_plane_distance_to(const godot_plane *p_self, const godot_vector3 *p_point);
|
||||
|
||||
godot_bool GDAPI godot_plane_has_point(const godot_plane *p_self, const godot_vector3 *p_point, const godot_real p_epsilon);
|
||||
|
||||
godot_vector3 GDAPI godot_plane_project(const godot_plane *p_self, const godot_vector3 *p_point);
|
||||
|
||||
godot_bool GDAPI godot_plane_intersect_3(const godot_plane *p_self, godot_vector3 *r_dest, const godot_plane *p_b, const godot_plane *p_c);
|
||||
|
||||
godot_bool GDAPI godot_plane_intersects_ray(const godot_plane *p_self, godot_vector3 *r_dest, const godot_vector3 *p_from, const godot_vector3 *p_dir);
|
||||
|
||||
godot_bool GDAPI godot_plane_intersects_segment(const godot_plane *p_self, godot_vector3 *r_dest, const godot_vector3 *p_begin, const godot_vector3 *p_end);
|
||||
|
||||
godot_plane GDAPI godot_plane_operator_neg(const godot_plane *p_self);
|
||||
|
||||
godot_bool GDAPI godot_plane_operator_equal(const godot_plane *p_self, const godot_plane *p_b);
|
||||
|
||||
void GDAPI godot_plane_set_normal(godot_plane *p_self, const godot_vector3 *p_normal);
|
||||
|
||||
godot_vector3 GDAPI godot_plane_get_normal(const godot_plane *p_self);
|
||||
|
||||
godot_real GDAPI godot_plane_get_d(const godot_plane *p_self);
|
||||
|
||||
void GDAPI godot_plane_set_d(godot_plane *p_self, const godot_real p_d);
|
||||
void GDAPI godot_plane_new(godot_plane *p_self);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -46,70 +46,9 @@ typedef struct {
|
|||
} godot_quat;
|
||||
#endif
|
||||
|
||||
// reduce extern "C" nesting for VS2013
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <gdnative/gdnative.h>
|
||||
#include <gdnative/vector3.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GDAPI godot_quat_new(godot_quat *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_z, const godot_real p_w);
|
||||
void GDAPI godot_quat_new_with_axis_angle(godot_quat *r_dest, const godot_vector3 *p_axis, const godot_real p_angle);
|
||||
void GDAPI godot_quat_new_with_basis(godot_quat *r_dest, const godot_basis *p_basis);
|
||||
void GDAPI godot_quat_new_with_euler(godot_quat *r_dest, const godot_vector3 *p_euler);
|
||||
|
||||
godot_real GDAPI godot_quat_get_x(const godot_quat *p_self);
|
||||
void GDAPI godot_quat_set_x(godot_quat *p_self, const godot_real val);
|
||||
|
||||
godot_real GDAPI godot_quat_get_y(const godot_quat *p_self);
|
||||
void GDAPI godot_quat_set_y(godot_quat *p_self, const godot_real val);
|
||||
|
||||
godot_real GDAPI godot_quat_get_z(const godot_quat *p_self);
|
||||
void GDAPI godot_quat_set_z(godot_quat *p_self, const godot_real val);
|
||||
|
||||
godot_real GDAPI godot_quat_get_w(const godot_quat *p_self);
|
||||
void GDAPI godot_quat_set_w(godot_quat *p_self, const godot_real val);
|
||||
|
||||
godot_string GDAPI godot_quat_as_string(const godot_quat *p_self);
|
||||
|
||||
godot_real GDAPI godot_quat_length(const godot_quat *p_self);
|
||||
|
||||
godot_real GDAPI godot_quat_length_squared(const godot_quat *p_self);
|
||||
|
||||
godot_quat GDAPI godot_quat_normalized(const godot_quat *p_self);
|
||||
|
||||
godot_bool GDAPI godot_quat_is_normalized(const godot_quat *p_self);
|
||||
|
||||
godot_quat GDAPI godot_quat_inverse(const godot_quat *p_self);
|
||||
|
||||
godot_real GDAPI godot_quat_dot(const godot_quat *p_self, const godot_quat *p_b);
|
||||
|
||||
godot_vector3 GDAPI godot_quat_xform(const godot_quat *p_self, const godot_vector3 *p_v);
|
||||
|
||||
godot_quat GDAPI godot_quat_slerp(const godot_quat *p_self, const godot_quat *p_b, const godot_real p_t);
|
||||
|
||||
godot_quat GDAPI godot_quat_slerpni(const godot_quat *p_self, const godot_quat *p_b, const godot_real p_t);
|
||||
|
||||
godot_quat GDAPI godot_quat_cubic_slerp(const godot_quat *p_self, const godot_quat *p_b, const godot_quat *p_pre_a, const godot_quat *p_post_b, const godot_real p_t);
|
||||
|
||||
godot_quat GDAPI godot_quat_operator_multiply(const godot_quat *p_self, const godot_real p_b);
|
||||
|
||||
godot_quat GDAPI godot_quat_operator_add(const godot_quat *p_self, const godot_quat *p_b);
|
||||
|
||||
godot_quat GDAPI godot_quat_operator_subtract(const godot_quat *p_self, const godot_quat *p_b);
|
||||
|
||||
godot_quat GDAPI godot_quat_operator_divide(const godot_quat *p_self, const godot_real p_b);
|
||||
|
||||
godot_bool GDAPI godot_quat_operator_equal(const godot_quat *p_self, const godot_quat *p_b);
|
||||
|
||||
godot_quat GDAPI godot_quat_operator_neg(const godot_quat *p_self);
|
||||
|
||||
void GDAPI godot_quat_set_axis_angle(godot_quat *p_self, const godot_vector3 *p_axis, const godot_real p_angle);
|
||||
void GDAPI godot_quat_new(godot_quat *p_self);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -51,103 +51,10 @@ typedef struct godot_rect2i {
|
|||
} godot_rect2i;
|
||||
#endif
|
||||
|
||||
// reduce extern "C" nesting for VS2013
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <gdnative/gdnative.h>
|
||||
#include <gdnative/vector2.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Rect2
|
||||
|
||||
void GDAPI godot_rect2_new_with_position_and_size(godot_rect2 *r_dest, const godot_vector2 *p_pos, const godot_vector2 *p_size);
|
||||
void GDAPI godot_rect2_new(godot_rect2 *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_width, const godot_real p_height);
|
||||
|
||||
godot_string GDAPI godot_rect2_as_string(const godot_rect2 *p_self);
|
||||
|
||||
godot_rect2i GDAPI godot_rect2_as_rect2i(const godot_rect2 *p_self);
|
||||
|
||||
godot_real GDAPI godot_rect2_get_area(const godot_rect2 *p_self);
|
||||
|
||||
godot_bool GDAPI godot_rect2_intersects(const godot_rect2 *p_self, const godot_rect2 *p_b);
|
||||
|
||||
godot_bool GDAPI godot_rect2_encloses(const godot_rect2 *p_self, const godot_rect2 *p_b);
|
||||
|
||||
godot_bool GDAPI godot_rect2_has_no_area(const godot_rect2 *p_self);
|
||||
|
||||
godot_rect2 GDAPI godot_rect2_intersection(const godot_rect2 *p_self, const godot_rect2 *p_b);
|
||||
|
||||
godot_rect2 GDAPI godot_rect2_merge(const godot_rect2 *p_self, const godot_rect2 *p_b);
|
||||
|
||||
godot_bool GDAPI godot_rect2_has_point(const godot_rect2 *p_self, const godot_vector2 *p_point);
|
||||
|
||||
godot_rect2 GDAPI godot_rect2_grow(const godot_rect2 *p_self, const godot_real p_by);
|
||||
|
||||
godot_rect2 GDAPI godot_rect2_grow_individual(const godot_rect2 *p_self, const godot_real p_left, const godot_real p_top, const godot_real p_right, const godot_real p_bottom);
|
||||
|
||||
godot_rect2 GDAPI godot_rect2_grow_side(const godot_rect2 *p_self, const godot_int p_margin, const godot_real p_by);
|
||||
|
||||
godot_rect2 GDAPI godot_rect2_abs(const godot_rect2 *p_self);
|
||||
|
||||
godot_rect2 GDAPI godot_rect2_expand(const godot_rect2 *p_self, const godot_vector2 *p_to);
|
||||
|
||||
godot_bool GDAPI godot_rect2_operator_equal(const godot_rect2 *p_self, const godot_rect2 *p_b);
|
||||
|
||||
godot_vector2 GDAPI godot_rect2_get_position(const godot_rect2 *p_self);
|
||||
|
||||
godot_vector2 GDAPI godot_rect2_get_size(const godot_rect2 *p_self);
|
||||
|
||||
void GDAPI godot_rect2_set_position(godot_rect2 *p_self, const godot_vector2 *p_pos);
|
||||
|
||||
void GDAPI godot_rect2_set_size(godot_rect2 *p_self, const godot_vector2 *p_size);
|
||||
|
||||
// Rect2I
|
||||
|
||||
void GDAPI godot_rect2i_new_with_position_and_size(godot_rect2i *r_dest, const godot_vector2i *p_pos, const godot_vector2i *p_size);
|
||||
void GDAPI godot_rect2i_new(godot_rect2i *r_dest, const godot_int p_x, const godot_int p_y, const godot_int p_width, const godot_int p_height);
|
||||
|
||||
godot_string GDAPI godot_rect2i_as_string(const godot_rect2i *p_self);
|
||||
|
||||
godot_rect2 GDAPI godot_rect2i_as_rect2(const godot_rect2i *p_self);
|
||||
|
||||
godot_int GDAPI godot_rect2i_get_area(const godot_rect2i *p_self);
|
||||
|
||||
godot_bool GDAPI godot_rect2i_intersects(const godot_rect2i *p_self, const godot_rect2i *p_b);
|
||||
|
||||
godot_bool GDAPI godot_rect2i_encloses(const godot_rect2i *p_self, const godot_rect2i *p_b);
|
||||
|
||||
godot_bool GDAPI godot_rect2i_has_no_area(const godot_rect2i *p_self);
|
||||
|
||||
godot_rect2i GDAPI godot_rect2i_intersection(const godot_rect2i *p_self, const godot_rect2i *p_b);
|
||||
|
||||
godot_rect2i GDAPI godot_rect2i_merge(const godot_rect2i *p_self, const godot_rect2i *p_b);
|
||||
|
||||
godot_bool GDAPI godot_rect2i_has_point(const godot_rect2i *p_self, const godot_vector2i *p_point);
|
||||
|
||||
godot_rect2i GDAPI godot_rect2i_grow(const godot_rect2i *p_self, const godot_int p_by);
|
||||
|
||||
godot_rect2i GDAPI godot_rect2i_grow_individual(const godot_rect2i *p_self, const godot_int p_left, const godot_int p_top, const godot_int p_right, const godot_int p_bottom);
|
||||
|
||||
godot_rect2i GDAPI godot_rect2i_grow_side(const godot_rect2i *p_self, const godot_int p_margin, const godot_int p_by);
|
||||
|
||||
godot_rect2i GDAPI godot_rect2i_abs(const godot_rect2i *p_self);
|
||||
|
||||
godot_rect2i GDAPI godot_rect2i_expand(const godot_rect2i *p_self, const godot_vector2i *p_to);
|
||||
|
||||
godot_bool GDAPI godot_rect2i_operator_equal(const godot_rect2i *p_self, const godot_rect2i *p_b);
|
||||
|
||||
godot_vector2i GDAPI godot_rect2i_get_position(const godot_rect2i *p_self);
|
||||
|
||||
godot_vector2i GDAPI godot_rect2i_get_size(const godot_rect2i *p_self);
|
||||
|
||||
void GDAPI godot_rect2i_set_position(godot_rect2i *p_self, const godot_vector2i *p_pos);
|
||||
|
||||
void GDAPI godot_rect2i_set_size(godot_rect2i *p_self, const godot_vector2i *p_size);
|
||||
void GDAPI godot_rect2_new(godot_rect2 *p_self);
|
||||
void GDAPI godot_rect2i_new(godot_rect2i *p_self);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -46,26 +46,9 @@ typedef struct {
|
|||
} godot_rid;
|
||||
#endif
|
||||
|
||||
// reduce extern "C" nesting for VS2013
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <gdnative/gdnative.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GDAPI godot_rid_new(godot_rid *r_dest);
|
||||
|
||||
godot_int GDAPI godot_rid_get_id(const godot_rid *p_self);
|
||||
|
||||
void GDAPI godot_rid_new_with_resource(godot_rid *r_dest, const godot_object *p_from);
|
||||
|
||||
godot_bool GDAPI godot_rid_operator_equal(const godot_rid *p_self, const godot_rid *p_b);
|
||||
|
||||
godot_bool GDAPI godot_rid_operator_less(const godot_rid *p_self, const godot_rid *p_b);
|
||||
void GDAPI godot_rid_new(godot_rid *p_self);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
/*************************************************************************/
|
||||
/* signal.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
/* "Software"), to deal in the Software without restriction, including */
|
||||
/* without limitation the rights to use, copy, modify, merge, publish, */
|
||||
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
||||
/* permit persons to whom the Software is furnished to do so, subject to */
|
||||
/* the following conditions: */
|
||||
/* */
|
||||
/* The above copyright notice and this permission notice shall be */
|
||||
/* included in all copies or substantial portions of the Software. */
|
||||
/* */
|
||||
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
||||
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
||||
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
||||
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
||||
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
||||
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/*************************************************************************/
|
||||
|
||||
#ifndef GODOT_SIGNAL_H
|
||||
#define GODOT_SIGNAL_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define GODOT_SIGNAL_SIZE (16)
|
||||
|
||||
#ifndef GODOT_CORE_API_GODOT_SIGNAL_TYPE_DEFINED
|
||||
#define GODOT_CORE_API_GODOT_SIGNAL_TYPE_DEFINED
|
||||
typedef struct {
|
||||
uint8_t _dont_touch_that[GODOT_SIGNAL_SIZE];
|
||||
} godot_signal;
|
||||
#endif
|
||||
|
||||
#include <gdnative/gdnative.h>
|
||||
|
||||
void GDAPI godot_signal_new(godot_signal *p_self);
|
||||
void GDAPI godot_signal_destroy(godot_signal *p_self);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -39,61 +39,26 @@ extern "C" {
|
|||
#include <stdint.h>
|
||||
|
||||
#ifndef __cplusplus
|
||||
typedef uint32_t char32_t;
|
||||
typedef uint16_t char16_t;
|
||||
typedef uint32_t char32_t;
|
||||
#endif
|
||||
|
||||
typedef char32_t godot_char_type;
|
||||
|
||||
#define GODOT_STRING_SIZE sizeof(void *)
|
||||
#define GODOT_CHAR_STRING_SIZE sizeof(void *)
|
||||
#define GODOT_CHAR16_STRING_SIZE sizeof(void *)
|
||||
|
||||
#ifndef GODOT_CORE_API_GODOT_STRING_TYPE_DEFINED
|
||||
#define GODOT_CORE_API_GODOT_STRING_TYPE_DEFINED
|
||||
typedef struct {
|
||||
uint8_t _dont_touch_that[GODOT_STRING_SIZE];
|
||||
} godot_string;
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef GODOT_CORE_API_GODOT_CHAR_STRING_TYPE_DEFINED
|
||||
#define GODOT_CORE_API_GODOT_CHAR_STRING_TYPE_DEFINED
|
||||
typedef struct {
|
||||
uint8_t _dont_touch_that[GODOT_CHAR_STRING_SIZE];
|
||||
} godot_char_string;
|
||||
#endif
|
||||
|
||||
#ifndef GODOT_CORE_API_GODOT_CHAR16_STRING_TYPE_DEFINED
|
||||
#define GODOT_CORE_API_GODOT_CHAR16_STRING_TYPE_DEFINED
|
||||
typedef struct {
|
||||
uint8_t _dont_touch_that[GODOT_CHAR16_STRING_SIZE];
|
||||
} godot_char16_string;
|
||||
#endif
|
||||
|
||||
// reduce extern "C" nesting for VS2013
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <gdnative/array.h>
|
||||
#include <gdnative/gdnative.h>
|
||||
#include <gdnative/variant.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
godot_int GDAPI godot_char_string_length(const godot_char_string *p_cs);
|
||||
const char GDAPI *godot_char_string_get_data(const godot_char_string *p_cs);
|
||||
void GDAPI godot_char_string_destroy(godot_char_string *p_cs);
|
||||
|
||||
godot_int GDAPI godot_char16_string_length(const godot_char16_string *p_cs);
|
||||
const char16_t GDAPI *godot_char16_string_get_data(const godot_char16_string *p_cs);
|
||||
void GDAPI godot_char16_string_destroy(godot_char16_string *p_cs);
|
||||
|
||||
void GDAPI godot_string_new(godot_string *r_dest);
|
||||
void GDAPI godot_string_new_copy(godot_string *r_dest, const godot_string *p_src);
|
||||
void GDAPI godot_string_destroy(godot_string *p_self);
|
||||
|
||||
void GDAPI godot_string_new_with_latin1_chars(godot_string *r_dest, const char *p_contents);
|
||||
void GDAPI godot_string_new_with_utf8_chars(godot_string *r_dest, const char *p_contents);
|
||||
|
@ -107,198 +72,6 @@ void GDAPI godot_string_new_with_utf16_chars_and_len(godot_string *r_dest, const
|
|||
void GDAPI godot_string_new_with_utf32_chars_and_len(godot_string *r_dest, const char32_t *p_contents, const int p_size);
|
||||
void GDAPI godot_string_new_with_wide_chars_and_len(godot_string *r_dest, const wchar_t *p_contents, const int p_size);
|
||||
|
||||
const godot_char_type GDAPI *godot_string_operator_index(godot_string *p_self, const godot_int p_idx);
|
||||
godot_char_type GDAPI godot_string_operator_index_const(const godot_string *p_self, const godot_int p_idx);
|
||||
const godot_char_type GDAPI *godot_string_get_data(const godot_string *p_self);
|
||||
|
||||
godot_bool GDAPI godot_string_operator_equal(const godot_string *p_self, const godot_string *p_b);
|
||||
godot_bool GDAPI godot_string_operator_less(const godot_string *p_self, const godot_string *p_b);
|
||||
godot_string GDAPI godot_string_operator_plus(const godot_string *p_self, const godot_string *p_b);
|
||||
|
||||
/* Standard size stuff */
|
||||
|
||||
/*+++*/ godot_int GDAPI godot_string_length(const godot_string *p_self);
|
||||
|
||||
/* Helpers */
|
||||
|
||||
signed char GDAPI godot_string_casecmp_to(const godot_string *p_self, const godot_string *p_str);
|
||||
signed char GDAPI godot_string_nocasecmp_to(const godot_string *p_self, const godot_string *p_str);
|
||||
signed char GDAPI godot_string_naturalnocasecmp_to(const godot_string *p_self, const godot_string *p_str);
|
||||
|
||||
godot_bool GDAPI godot_string_begins_with(const godot_string *p_self, const godot_string *p_string);
|
||||
godot_bool GDAPI godot_string_begins_with_char_array(const godot_string *p_self, const char *p_char_array);
|
||||
godot_packed_string_array GDAPI godot_string_bigrams(const godot_string *p_self);
|
||||
godot_string GDAPI godot_string_chr(godot_char_type p_character);
|
||||
godot_bool GDAPI godot_string_ends_with(const godot_string *p_self, const godot_string *p_string);
|
||||
godot_bool GDAPI godot_string_ends_with_char_array(const godot_string *p_self, const char *p_char_array);
|
||||
godot_int GDAPI godot_string_count(const godot_string *p_self, const godot_string *p_what, godot_int p_from, godot_int p_to);
|
||||
godot_int GDAPI godot_string_countn(const godot_string *p_self, const godot_string *p_what, godot_int p_from, godot_int p_to);
|
||||
godot_int GDAPI godot_string_find(const godot_string *p_self, const godot_string *p_what);
|
||||
godot_int GDAPI godot_string_find_from(const godot_string *p_self, const godot_string *p_what, godot_int p_from);
|
||||
godot_int GDAPI godot_string_findmk(const godot_string *p_self, const godot_packed_string_array *p_keys);
|
||||
godot_int GDAPI godot_string_findmk_from(const godot_string *p_self, const godot_packed_string_array *p_keys, godot_int p_from);
|
||||
godot_int GDAPI godot_string_findmk_from_in_place(const godot_string *p_self, const godot_packed_string_array *p_keys, godot_int p_from, godot_int *r_key);
|
||||
godot_int GDAPI godot_string_findn(const godot_string *p_self, const godot_string *p_what);
|
||||
godot_int GDAPI godot_string_findn_from(const godot_string *p_self, const godot_string *p_what, godot_int p_from);
|
||||
godot_string GDAPI godot_string_format(const godot_string *p_self, const godot_variant *p_values);
|
||||
godot_string GDAPI godot_string_format_with_custom_placeholder(const godot_string *p_self, const godot_variant *p_values, const char *p_placeholder);
|
||||
godot_string GDAPI godot_string_hex_encode_buffer(const uint8_t *p_buffer, godot_int p_len);
|
||||
godot_int GDAPI godot_string_hex_to_int(const godot_string *p_self);
|
||||
godot_int GDAPI godot_string_hex_to_int_with_prefix(const godot_string *p_self);
|
||||
godot_string GDAPI godot_string_insert(const godot_string *p_self, godot_int p_at_pos, const godot_string *p_string);
|
||||
godot_bool GDAPI godot_string_is_numeric(const godot_string *p_self);
|
||||
godot_bool GDAPI godot_string_is_subsequence_of(const godot_string *p_self, const godot_string *p_string);
|
||||
godot_bool GDAPI godot_string_is_subsequence_ofi(const godot_string *p_self, const godot_string *p_string);
|
||||
godot_string GDAPI godot_string_lpad(const godot_string *p_self, godot_int p_min_length);
|
||||
godot_string GDAPI godot_string_lpad_with_custom_character(const godot_string *p_self, godot_int p_min_length, const godot_string *p_character);
|
||||
godot_bool GDAPI godot_string_match(const godot_string *p_self, const godot_string *p_wildcard);
|
||||
godot_bool GDAPI godot_string_matchn(const godot_string *p_self, const godot_string *p_wildcard);
|
||||
godot_string GDAPI godot_string_md5(const uint8_t *p_md5);
|
||||
godot_string GDAPI godot_string_num(double p_num);
|
||||
godot_string GDAPI godot_string_num_int64(int64_t p_num, godot_int p_base);
|
||||
godot_string GDAPI godot_string_num_int64_capitalized(int64_t p_num, godot_int p_base, godot_bool p_capitalize_hex);
|
||||
godot_string GDAPI godot_string_num_real(double p_num);
|
||||
godot_string GDAPI godot_string_num_scientific(double p_num);
|
||||
godot_string GDAPI godot_string_num_with_decimals(double p_num, godot_int p_decimals);
|
||||
godot_string GDAPI godot_string_pad_decimals(const godot_string *p_self, godot_int p_digits);
|
||||
godot_string GDAPI godot_string_pad_zeros(const godot_string *p_self, godot_int p_digits);
|
||||
godot_string GDAPI godot_string_replace_first(const godot_string *p_self, const godot_string *p_key, const godot_string *p_with);
|
||||
godot_string GDAPI godot_string_replace(const godot_string *p_self, const godot_string *p_key, const godot_string *p_with);
|
||||
godot_string GDAPI godot_string_replacen(const godot_string *p_self, const godot_string *p_key, const godot_string *p_with);
|
||||
godot_int GDAPI godot_string_rfind(const godot_string *p_self, const godot_string *p_what);
|
||||
godot_int GDAPI godot_string_rfindn(const godot_string *p_self, const godot_string *p_what);
|
||||
godot_int GDAPI godot_string_rfind_from(const godot_string *p_self, const godot_string *p_what, godot_int p_from);
|
||||
godot_int GDAPI godot_string_rfindn_from(const godot_string *p_self, const godot_string *p_what, godot_int p_from);
|
||||
godot_string GDAPI godot_string_rpad(const godot_string *p_self, godot_int p_min_length);
|
||||
godot_string GDAPI godot_string_rpad_with_custom_character(const godot_string *p_self, godot_int p_min_length, const godot_string *p_character);
|
||||
godot_real GDAPI godot_string_similarity(const godot_string *p_self, const godot_string *p_string);
|
||||
godot_string GDAPI godot_string_sprintf(const godot_string *p_self, const godot_array *p_values, godot_bool *p_error);
|
||||
godot_string GDAPI godot_string_substr(const godot_string *p_self, godot_int p_from, godot_int p_chars);
|
||||
double GDAPI godot_string_to_float(const godot_string *p_self);
|
||||
godot_int GDAPI godot_string_to_int(const godot_string *p_self);
|
||||
|
||||
godot_string GDAPI godot_string_camelcase_to_underscore(const godot_string *p_self);
|
||||
godot_string GDAPI godot_string_camelcase_to_underscore_lowercased(const godot_string *p_self);
|
||||
godot_string GDAPI godot_string_capitalize(const godot_string *p_self);
|
||||
|
||||
double GDAPI godot_string_char_to_float(const char *p_what);
|
||||
double GDAPI godot_string_wchar_to_float(const wchar_t *p_str, const wchar_t **r_end);
|
||||
|
||||
godot_int GDAPI godot_string_char_to_int(const char *p_what);
|
||||
godot_int GDAPI godot_string_wchar_to_int(const wchar_t *p_str);
|
||||
|
||||
godot_int GDAPI godot_string_char_to_int_with_len(const char *p_what, godot_int p_len);
|
||||
godot_int GDAPI godot_string_wchar_to_int_with_len(const wchar_t *p_str, int p_len);
|
||||
|
||||
godot_int GDAPI godot_string_get_slice_count(const godot_string *p_self, const godot_string *p_splitter);
|
||||
godot_string GDAPI godot_string_get_slice(const godot_string *p_self, const godot_string *p_splitter, godot_int p_slice);
|
||||
godot_string GDAPI godot_string_get_slicec(const godot_string *p_self, godot_char_type p_splitter, godot_int p_slice);
|
||||
|
||||
godot_packed_string_array GDAPI godot_string_split(const godot_string *p_self, const godot_string *p_splitter);
|
||||
godot_packed_string_array GDAPI godot_string_split_allow_empty(const godot_string *p_self, const godot_string *p_splitter);
|
||||
godot_packed_string_array GDAPI godot_string_split_with_maxsplit(const godot_string *p_self, const godot_string *p_splitter, const godot_bool p_allow_empty, const godot_int p_maxsplit);
|
||||
|
||||
godot_packed_string_array GDAPI godot_string_rsplit(const godot_string *p_self, const godot_string *p_splitter);
|
||||
godot_packed_string_array GDAPI godot_string_rsplit_allow_empty(const godot_string *p_self, const godot_string *p_splitter);
|
||||
godot_packed_string_array GDAPI godot_string_rsplit_with_maxsplit(const godot_string *p_self, const godot_string *p_splitter, const godot_bool p_allow_empty, const godot_int p_maxsplit);
|
||||
|
||||
godot_packed_float32_array GDAPI godot_string_split_floats(const godot_string *p_self, const godot_string *p_splitter);
|
||||
godot_packed_float32_array GDAPI godot_string_split_floats_allow_empty(const godot_string *p_self, const godot_string *p_splitter);
|
||||
godot_packed_float32_array GDAPI godot_string_split_floats_mk(const godot_string *p_self, const godot_packed_string_array *p_splitters);
|
||||
godot_packed_float32_array GDAPI godot_string_split_floats_mk_allow_empty(const godot_string *p_self, const godot_packed_string_array *p_splitters);
|
||||
godot_packed_int32_array GDAPI godot_string_split_ints(const godot_string *p_self, const godot_string *p_splitter);
|
||||
godot_packed_int32_array GDAPI godot_string_split_ints_allow_empty(const godot_string *p_self, const godot_string *p_splitter);
|
||||
godot_packed_int32_array GDAPI godot_string_split_ints_mk(const godot_string *p_self, const godot_packed_string_array *p_splitters);
|
||||
godot_packed_int32_array GDAPI godot_string_split_ints_mk_allow_empty(const godot_string *p_self, const godot_packed_string_array *p_splitters);
|
||||
|
||||
godot_packed_string_array GDAPI godot_string_split_spaces(const godot_string *p_self);
|
||||
|
||||
godot_char_type GDAPI godot_string_char_lowercase(godot_char_type p_char);
|
||||
godot_char_type GDAPI godot_string_char_uppercase(godot_char_type p_char);
|
||||
godot_string GDAPI godot_string_to_lower(const godot_string *p_self);
|
||||
godot_string GDAPI godot_string_to_upper(const godot_string *p_self);
|
||||
|
||||
godot_string GDAPI godot_string_get_basename(const godot_string *p_self);
|
||||
godot_string GDAPI godot_string_get_extension(const godot_string *p_self);
|
||||
godot_string GDAPI godot_string_left(const godot_string *p_self, godot_int p_pos);
|
||||
godot_char_type GDAPI godot_string_ord_at(const godot_string *p_self, godot_int p_idx);
|
||||
godot_string GDAPI godot_string_plus_file(const godot_string *p_self, const godot_string *p_file);
|
||||
godot_string GDAPI godot_string_right(const godot_string *p_self, godot_int p_pos);
|
||||
godot_string GDAPI godot_string_repeat(const godot_string *p_self, godot_int p_count);
|
||||
godot_string GDAPI godot_string_strip_edges(const godot_string *p_self, godot_bool p_left, godot_bool p_right);
|
||||
godot_string GDAPI godot_string_strip_escapes(const godot_string *p_self);
|
||||
|
||||
void GDAPI godot_string_erase(godot_string *p_self, godot_int p_pos, godot_int p_chars);
|
||||
|
||||
godot_char_string GDAPI godot_string_ascii(const godot_string *p_self);
|
||||
godot_char_string GDAPI godot_string_latin1(const godot_string *p_self);
|
||||
|
||||
godot_char_string GDAPI godot_string_utf8(const godot_string *p_self);
|
||||
godot_bool GDAPI godot_string_parse_utf8(godot_string *p_self, const char *p_utf8);
|
||||
godot_bool GDAPI godot_string_parse_utf8_with_len(godot_string *p_self, const char *p_utf8, godot_int p_len);
|
||||
|
||||
godot_char16_string GDAPI godot_string_utf16(const godot_string *p_self);
|
||||
godot_bool GDAPI godot_string_parse_utf16(godot_string *p_self, const char16_t *p_utf16);
|
||||
godot_bool GDAPI godot_string_parse_utf16_with_len(godot_string *p_self, const char16_t *p_utf16, godot_int p_len);
|
||||
|
||||
uint32_t GDAPI godot_string_hash(const godot_string *p_self);
|
||||
uint64_t GDAPI godot_string_hash64(const godot_string *p_self);
|
||||
|
||||
uint32_t GDAPI godot_string_hash_chars(const char *p_cstr);
|
||||
uint32_t GDAPI godot_string_hash_chars_with_len(const char *p_cstr, godot_int p_len);
|
||||
uint32_t GDAPI godot_string_hash_wide_chars(const wchar_t *p_str);
|
||||
uint32_t GDAPI godot_string_hash_wide_chars_with_len(const wchar_t *p_str, godot_int p_len);
|
||||
|
||||
godot_packed_byte_array GDAPI godot_string_md5_buffer(const godot_string *p_self);
|
||||
godot_string GDAPI godot_string_md5_text(const godot_string *p_self);
|
||||
godot_packed_byte_array GDAPI godot_string_sha1_buffer(const godot_string *p_self);
|
||||
godot_string GDAPI godot_string_sha1_text(const godot_string *p_self);
|
||||
godot_packed_byte_array GDAPI godot_string_sha256_buffer(const godot_string *p_self);
|
||||
godot_string GDAPI godot_string_sha256_text(const godot_string *p_self);
|
||||
|
||||
godot_bool godot_string_is_empty(const godot_string *p_self);
|
||||
|
||||
// path functions
|
||||
godot_string GDAPI godot_string_get_base_dir(const godot_string *p_self);
|
||||
godot_string GDAPI godot_string_get_file(const godot_string *p_self);
|
||||
godot_string GDAPI godot_string_humanize_size(uint64_t p_size);
|
||||
godot_bool GDAPI godot_string_is_abs_path(const godot_string *p_self);
|
||||
godot_bool GDAPI godot_string_is_rel_path(const godot_string *p_self);
|
||||
godot_bool GDAPI godot_string_is_resource_file(const godot_string *p_self);
|
||||
godot_string GDAPI godot_string_path_to(const godot_string *p_self, const godot_string *p_path);
|
||||
godot_string GDAPI godot_string_path_to_file(const godot_string *p_self, const godot_string *p_path);
|
||||
godot_string GDAPI godot_string_simplify_path(const godot_string *p_self);
|
||||
|
||||
godot_string GDAPI godot_string_c_escape(const godot_string *p_self);
|
||||
godot_string GDAPI godot_string_c_escape_multiline(const godot_string *p_self);
|
||||
godot_string GDAPI godot_string_c_unescape(const godot_string *p_self);
|
||||
godot_string GDAPI godot_string_http_escape(const godot_string *p_self);
|
||||
godot_string GDAPI godot_string_http_unescape(const godot_string *p_self);
|
||||
godot_string GDAPI godot_string_json_escape(const godot_string *p_self);
|
||||
godot_string GDAPI godot_string_xml_escape(const godot_string *p_self);
|
||||
godot_string GDAPI godot_string_xml_escape_with_quotes(const godot_string *p_self);
|
||||
godot_string GDAPI godot_string_xml_unescape(const godot_string *p_self);
|
||||
|
||||
godot_string GDAPI godot_string_percent_decode(const godot_string *p_self);
|
||||
godot_string GDAPI godot_string_percent_encode(const godot_string *p_self);
|
||||
godot_string GDAPI godot_string_join(const godot_string *p_self, const godot_packed_string_array *p_parts);
|
||||
|
||||
godot_bool GDAPI godot_string_is_valid_filename(const godot_string *p_self);
|
||||
godot_bool GDAPI godot_string_is_valid_float(const godot_string *p_self);
|
||||
godot_bool GDAPI godot_string_is_valid_hex_number(const godot_string *p_self, godot_bool p_with_prefix);
|
||||
godot_bool GDAPI godot_string_is_valid_html_color(const godot_string *p_self);
|
||||
godot_bool GDAPI godot_string_is_valid_identifier(const godot_string *p_self);
|
||||
godot_bool GDAPI godot_string_is_valid_integer(const godot_string *p_self);
|
||||
godot_bool GDAPI godot_string_is_valid_ip_address(const godot_string *p_self);
|
||||
|
||||
godot_string GDAPI godot_string_dedent(const godot_string *p_self);
|
||||
godot_string GDAPI godot_string_trim_prefix(const godot_string *p_self, const godot_string *p_prefix);
|
||||
godot_string GDAPI godot_string_trim_suffix(const godot_string *p_self, const godot_string *p_suffix);
|
||||
godot_string GDAPI godot_string_lstrip(const godot_string *p_self, const godot_string *p_chars);
|
||||
godot_string GDAPI godot_string_rstrip(const godot_string *p_self, const godot_string *p_chars);
|
||||
|
||||
void GDAPI godot_string_destroy(godot_string *p_self);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -47,30 +47,14 @@ typedef struct {
|
|||
} godot_string_name;
|
||||
#endif
|
||||
|
||||
// reduce extern "C" nesting for VS2013
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <gdnative/gdnative.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GDAPI godot_string_name_new(godot_string_name *r_dest, const godot_string *p_name);
|
||||
void GDAPI godot_string_name_new_data(godot_string_name *r_dest, const char *p_name);
|
||||
|
||||
godot_string GDAPI godot_string_name_get_name(const godot_string_name *p_self);
|
||||
|
||||
uint32_t GDAPI godot_string_name_get_hash(const godot_string_name *p_self);
|
||||
const void GDAPI *godot_string_name_get_data_unique_pointer(const godot_string_name *p_self);
|
||||
|
||||
godot_bool GDAPI godot_string_name_operator_equal(const godot_string_name *p_self, const godot_string_name *p_other);
|
||||
godot_bool GDAPI godot_string_name_operator_less(const godot_string_name *p_self, const godot_string_name *p_other);
|
||||
|
||||
void GDAPI godot_string_name_new(godot_string_name *r_dest);
|
||||
void GDAPI godot_string_name_new_copy(godot_string_name *r_dest, const godot_string_name *p_src);
|
||||
void GDAPI godot_string_name_destroy(godot_string_name *p_self);
|
||||
|
||||
void GDAPI godot_string_name_new_with_latin1_chars(godot_string_name *r_dest, const char *p_contents);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -46,63 +46,9 @@ typedef struct {
|
|||
} godot_transform;
|
||||
#endif
|
||||
|
||||
// reduce extern "C" nesting for VS2013
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <gdnative/basis.h>
|
||||
#include <gdnative/gdnative.h>
|
||||
#include <gdnative/variant.h>
|
||||
#include <gdnative/vector3.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GDAPI godot_transform_new_with_axis_origin(godot_transform *r_dest, const godot_vector3 *p_x_axis, const godot_vector3 *p_y_axis, const godot_vector3 *p_z_axis, const godot_vector3 *p_origin);
|
||||
void GDAPI godot_transform_new(godot_transform *r_dest, const godot_basis *p_basis, const godot_vector3 *p_origin);
|
||||
void GDAPI godot_transform_new_with_quat(godot_transform *r_dest, const godot_quat *p_quat);
|
||||
|
||||
godot_basis GDAPI godot_transform_get_basis(const godot_transform *p_self);
|
||||
void GDAPI godot_transform_set_basis(godot_transform *p_self, const godot_basis *p_v);
|
||||
|
||||
godot_vector3 GDAPI godot_transform_get_origin(const godot_transform *p_self);
|
||||
void GDAPI godot_transform_set_origin(godot_transform *p_self, const godot_vector3 *p_v);
|
||||
|
||||
godot_string GDAPI godot_transform_as_string(const godot_transform *p_self);
|
||||
|
||||
godot_transform GDAPI godot_transform_inverse(const godot_transform *p_self);
|
||||
|
||||
godot_transform GDAPI godot_transform_affine_inverse(const godot_transform *p_self);
|
||||
|
||||
godot_transform GDAPI godot_transform_orthonormalized(const godot_transform *p_self);
|
||||
|
||||
godot_transform GDAPI godot_transform_rotated(const godot_transform *p_self, const godot_vector3 *p_axis, const godot_real p_phi);
|
||||
|
||||
godot_transform GDAPI godot_transform_scaled(const godot_transform *p_self, const godot_vector3 *p_scale);
|
||||
|
||||
godot_transform GDAPI godot_transform_translated(const godot_transform *p_self, const godot_vector3 *p_ofs);
|
||||
|
||||
godot_transform GDAPI godot_transform_looking_at(const godot_transform *p_self, const godot_vector3 *p_target, const godot_vector3 *p_up);
|
||||
|
||||
godot_plane GDAPI godot_transform_xform_plane(const godot_transform *p_self, const godot_plane *p_v);
|
||||
|
||||
godot_plane GDAPI godot_transform_xform_inv_plane(const godot_transform *p_self, const godot_plane *p_v);
|
||||
|
||||
void GDAPI godot_transform_new_identity(godot_transform *r_dest);
|
||||
|
||||
godot_bool GDAPI godot_transform_operator_equal(const godot_transform *p_self, const godot_transform *p_b);
|
||||
|
||||
godot_transform GDAPI godot_transform_operator_multiply(const godot_transform *p_self, const godot_transform *p_b);
|
||||
|
||||
godot_vector3 GDAPI godot_transform_xform_vector3(const godot_transform *p_self, const godot_vector3 *p_v);
|
||||
|
||||
godot_vector3 GDAPI godot_transform_xform_inv_vector3(const godot_transform *p_self, const godot_vector3 *p_v);
|
||||
|
||||
godot_aabb GDAPI godot_transform_xform_aabb(const godot_transform *p_self, const godot_aabb *p_v);
|
||||
|
||||
godot_aabb GDAPI godot_transform_xform_inv_aabb(const godot_transform *p_self, const godot_aabb *p_v);
|
||||
void GDAPI godot_transform_new(godot_transform *p_self);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -46,61 +46,9 @@ typedef struct {
|
|||
} godot_transform2d;
|
||||
#endif
|
||||
|
||||
// reduce extern "C" nesting for VS2013
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <gdnative/gdnative.h>
|
||||
#include <gdnative/variant.h>
|
||||
#include <gdnative/vector2.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GDAPI godot_transform2d_new(godot_transform2d *r_dest, const godot_real p_rot, const godot_vector2 *p_pos);
|
||||
void GDAPI godot_transform2d_new_axis_origin(godot_transform2d *r_dest, const godot_vector2 *p_x_axis, const godot_vector2 *p_y_axis, const godot_vector2 *p_origin);
|
||||
|
||||
godot_string GDAPI godot_transform2d_as_string(const godot_transform2d *p_self);
|
||||
|
||||
godot_transform2d GDAPI godot_transform2d_inverse(const godot_transform2d *p_self);
|
||||
|
||||
godot_transform2d GDAPI godot_transform2d_affine_inverse(const godot_transform2d *p_self);
|
||||
|
||||
godot_real GDAPI godot_transform2d_get_rotation(const godot_transform2d *p_self);
|
||||
|
||||
godot_vector2 GDAPI godot_transform2d_get_origin(const godot_transform2d *p_self);
|
||||
|
||||
godot_vector2 GDAPI godot_transform2d_get_scale(const godot_transform2d *p_self);
|
||||
|
||||
godot_transform2d GDAPI godot_transform2d_orthonormalized(const godot_transform2d *p_self);
|
||||
|
||||
godot_transform2d GDAPI godot_transform2d_rotated(const godot_transform2d *p_self, const godot_real p_phi);
|
||||
|
||||
godot_transform2d GDAPI godot_transform2d_scaled(const godot_transform2d *p_self, const godot_vector2 *p_scale);
|
||||
|
||||
godot_transform2d GDAPI godot_transform2d_translated(const godot_transform2d *p_self, const godot_vector2 *p_offset);
|
||||
|
||||
godot_vector2 GDAPI godot_transform2d_xform_vector2(const godot_transform2d *p_self, const godot_vector2 *p_v);
|
||||
|
||||
godot_vector2 GDAPI godot_transform2d_xform_inv_vector2(const godot_transform2d *p_self, const godot_vector2 *p_v);
|
||||
|
||||
godot_vector2 GDAPI godot_transform2d_basis_xform_vector2(const godot_transform2d *p_self, const godot_vector2 *p_v);
|
||||
|
||||
godot_vector2 GDAPI godot_transform2d_basis_xform_inv_vector2(const godot_transform2d *p_self, const godot_vector2 *p_v);
|
||||
|
||||
godot_transform2d GDAPI godot_transform2d_interpolate_with(const godot_transform2d *p_self, const godot_transform2d *p_m, const godot_real p_c);
|
||||
|
||||
godot_bool GDAPI godot_transform2d_operator_equal(const godot_transform2d *p_self, const godot_transform2d *p_b);
|
||||
|
||||
godot_transform2d GDAPI godot_transform2d_operator_multiply(const godot_transform2d *p_self, const godot_transform2d *p_b);
|
||||
|
||||
void GDAPI godot_transform2d_new_identity(godot_transform2d *r_dest);
|
||||
|
||||
godot_rect2 GDAPI godot_transform2d_xform_rect2(const godot_transform2d *p_self, const godot_rect2 *p_v);
|
||||
|
||||
godot_rect2 GDAPI godot_transform2d_xform_inv_rect2(const godot_transform2d *p_self, const godot_rect2 *p_v);
|
||||
void GDAPI godot_transform2d_new(godot_transform2d *p_self);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -37,6 +37,21 @@ extern "C" {
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
////// bool
|
||||
|
||||
typedef bool godot_bool;
|
||||
|
||||
#define GODOT_TRUE 1
|
||||
#define GODOT_FALSE 0
|
||||
|
||||
/////// int
|
||||
|
||||
typedef int64_t godot_int;
|
||||
|
||||
/////// float
|
||||
|
||||
typedef double godot_float;
|
||||
|
||||
#define GODOT_VARIANT_SIZE (16 + sizeof(int64_t))
|
||||
|
||||
#ifndef GODOT_CORE_API_GODOT_VARIANT_TYPE_DEFINED
|
||||
|
@ -146,10 +161,35 @@ typedef enum godot_variant_operator {
|
|||
GODOT_VARIANT_OP_MAX,
|
||||
} godot_variant_operator;
|
||||
|
||||
// reduce extern "C" nesting for VS2013
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
typedef enum godot_variant_utility_function_type {
|
||||
GODOT_UTILITY_FUNC_TYPE_MATH,
|
||||
GODOT_UTILITY_FUNC_TYPE_RANDOM,
|
||||
GODOT_UTILITY_FUNC_TYPE_GENERAL,
|
||||
} godot_variant_utility_function_type;
|
||||
|
||||
// Types for function pointers.
|
||||
typedef void (*godot_validated_operator_evaluator)(const godot_variant *p_left, const godot_variant *p_right, godot_variant *r_result);
|
||||
typedef void (*godot_ptr_operator_evaluator)(const void *p_left, const void *p_right, void *r_result);
|
||||
typedef void (*godot_validated_builtin_method)(godot_variant *p_base, const godot_variant **p_args, int p_argument_count, godot_variant *r_return);
|
||||
typedef void (*godot_ptr_builtin_method)(void *p_base, const void **p_args, void *r_return, int p_argument_count);
|
||||
typedef void (*godot_validated_constructor)(godot_variant *p_base, const godot_variant **p_args);
|
||||
typedef void (*godot_ptr_constructor)(void *p_base, const void **p_args);
|
||||
typedef void (*godot_validated_setter)(godot_variant *p_base, const godot_variant *p_value);
|
||||
typedef void (*godot_validated_getter)(const godot_variant *p_base, godot_variant *r_value);
|
||||
typedef void (*godot_ptr_setter)(void *p_base, const void *p_value);
|
||||
typedef void (*godot_ptr_getter)(const void *p_base, void *r_value);
|
||||
typedef void (*godot_validated_indexed_setter)(godot_variant *p_base, godot_int p_index, const godot_variant *p_value, bool *r_oob);
|
||||
typedef void (*godot_validated_indexed_getter)(const godot_variant *p_base, godot_int p_index, godot_variant *r_value, bool *r_oob);
|
||||
typedef void (*godot_ptr_indexed_setter)(void *p_base, godot_int p_index, const void *p_value);
|
||||
typedef void (*godot_ptr_indexed_getter)(const void *p_base, godot_int p_index, void *r_value);
|
||||
typedef void (*godot_validated_keyed_setter)(godot_variant *p_base, const godot_variant *p_key, const godot_variant *p_value, bool *r_valid);
|
||||
typedef void (*godot_validated_keyed_getter)(const godot_variant *p_base, const godot_variant *p_key, godot_variant *r_value, bool *r_valid);
|
||||
typedef bool (*godot_validated_keyed_checker)(const godot_variant *p_base, const godot_variant *p_key, bool *r_valid);
|
||||
typedef void (*godot_ptr_keyed_setter)(void *p_base, const void *p_key, const void *p_value);
|
||||
typedef void (*godot_ptr_keyed_getter)(const void *p_base, const void *p_key, void *r_value);
|
||||
typedef bool (*godot_ptr_keyed_checker)(const godot_variant *p_base, const godot_variant *p_key);
|
||||
typedef void (*godot_validated_utility_function)(godot_variant *r_return, const godot_variant **p_arguments, int p_argument_count);
|
||||
typedef void (*godot_ptr_utility_function)(void *r_return, const void **p_arguments, int p_argument_count);
|
||||
|
||||
#include <gdnative/aabb.h>
|
||||
#include <gdnative/array.h>
|
||||
|
@ -163,6 +203,7 @@ typedef enum godot_variant_operator {
|
|||
#include <gdnative/quat.h>
|
||||
#include <gdnative/rect2.h>
|
||||
#include <gdnative/rid.h>
|
||||
#include <gdnative/signal.h>
|
||||
#include <gdnative/string.h>
|
||||
#include <gdnative/string_name.h>
|
||||
#include <gdnative/transform.h>
|
||||
|
@ -173,22 +214,15 @@ typedef enum godot_variant_operator {
|
|||
|
||||
#include <gdnative/gdnative.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
godot_variant_type GDAPI godot_variant_get_type(const godot_variant *p_v);
|
||||
// Memory.
|
||||
|
||||
void GDAPI godot_variant_new_copy(godot_variant *r_dest, const godot_variant *p_src);
|
||||
|
||||
void GDAPI godot_variant_new_nil(godot_variant *r_dest);
|
||||
|
||||
void GDAPI godot_variant_new_bool(godot_variant *r_dest, const godot_bool p_b);
|
||||
void GDAPI godot_variant_new_uint(godot_variant *r_dest, const uint64_t p_i);
|
||||
void GDAPI godot_variant_new_int(godot_variant *r_dest, const int64_t p_i);
|
||||
void GDAPI godot_variant_new_real(godot_variant *r_dest, const double p_r);
|
||||
void GDAPI godot_variant_new_int(godot_variant *r_dest, const godot_int p_i);
|
||||
void GDAPI godot_variant_new_float(godot_variant *r_dest, const godot_float p_f);
|
||||
void GDAPI godot_variant_new_string(godot_variant *r_dest, const godot_string *p_s);
|
||||
void GDAPI godot_variant_new_string_name(godot_variant *r_dest, const godot_string_name *p_s);
|
||||
void GDAPI godot_variant_new_vector2(godot_variant *r_dest, const godot_vector2 *p_v2);
|
||||
void GDAPI godot_variant_new_vector2i(godot_variant *r_dest, const godot_vector2i *p_v2);
|
||||
void GDAPI godot_variant_new_rect2(godot_variant *r_dest, const godot_rect2 *p_rect2);
|
||||
|
@ -202,11 +236,12 @@ void GDAPI godot_variant_new_aabb(godot_variant *r_dest, const godot_aabb *p_aab
|
|||
void GDAPI godot_variant_new_basis(godot_variant *r_dest, const godot_basis *p_basis);
|
||||
void GDAPI godot_variant_new_transform(godot_variant *r_dest, const godot_transform *p_trans);
|
||||
void GDAPI godot_variant_new_color(godot_variant *r_dest, const godot_color *p_color);
|
||||
void GDAPI godot_variant_new_string_name(godot_variant *r_dest, const godot_string_name *p_s);
|
||||
void GDAPI godot_variant_new_node_path(godot_variant *r_dest, const godot_node_path *p_np);
|
||||
void GDAPI godot_variant_new_rid(godot_variant *r_dest, const godot_rid *p_rid);
|
||||
void GDAPI godot_variant_new_object(godot_variant *r_dest, const godot_object *p_obj);
|
||||
void GDAPI godot_variant_new_callable(godot_variant *r_dest, const godot_callable *p_callable);
|
||||
void GDAPI godot_variant_new_signal(godot_variant *r_dest, const godot_signal *p_signal);
|
||||
void GDAPI godot_variant_new_object(godot_variant *r_dest, const godot_object *p_obj);
|
||||
void GDAPI godot_variant_new_dictionary(godot_variant *r_dest, const godot_dictionary *p_dict);
|
||||
void GDAPI godot_variant_new_array(godot_variant *r_dest, const godot_array *p_arr);
|
||||
void GDAPI godot_variant_new_packed_byte_array(godot_variant *r_dest, const godot_packed_byte_array *p_pba);
|
||||
|
@ -220,11 +255,9 @@ void GDAPI godot_variant_new_packed_vector3_array(godot_variant *r_dest, const g
|
|||
void GDAPI godot_variant_new_packed_color_array(godot_variant *r_dest, const godot_packed_color_array *p_pca);
|
||||
|
||||
godot_bool GDAPI godot_variant_as_bool(const godot_variant *p_self);
|
||||
uint64_t GDAPI godot_variant_as_uint(const godot_variant *p_self);
|
||||
int64_t GDAPI godot_variant_as_int(const godot_variant *p_self);
|
||||
double GDAPI godot_variant_as_real(const godot_variant *p_self);
|
||||
godot_int GDAPI godot_variant_as_int(const godot_variant *p_self);
|
||||
godot_float GDAPI godot_variant_as_float(const godot_variant *p_self);
|
||||
godot_string GDAPI godot_variant_as_string(const godot_variant *p_self);
|
||||
godot_string_name GDAPI godot_variant_as_string_name(const godot_variant *p_self);
|
||||
godot_vector2 GDAPI godot_variant_as_vector2(const godot_variant *p_self);
|
||||
godot_vector2i GDAPI godot_variant_as_vector2i(const godot_variant *p_self);
|
||||
godot_rect2 GDAPI godot_variant_as_rect2(const godot_variant *p_self);
|
||||
|
@ -238,11 +271,12 @@ godot_aabb GDAPI godot_variant_as_aabb(const godot_variant *p_self);
|
|||
godot_basis GDAPI godot_variant_as_basis(const godot_variant *p_self);
|
||||
godot_transform GDAPI godot_variant_as_transform(const godot_variant *p_self);
|
||||
godot_color GDAPI godot_variant_as_color(const godot_variant *p_self);
|
||||
godot_string_name GDAPI godot_variant_as_string_name(const godot_variant *p_self);
|
||||
godot_node_path GDAPI godot_variant_as_node_path(const godot_variant *p_self);
|
||||
godot_rid GDAPI godot_variant_as_rid(const godot_variant *p_self);
|
||||
godot_object GDAPI *godot_variant_as_object(const godot_variant *p_self);
|
||||
godot_callable GDAPI godot_variant_as_callable(const godot_variant *p_self);
|
||||
godot_signal GDAPI godot_variant_as_signal(const godot_variant *p_self);
|
||||
godot_object GDAPI *godot_variant_as_object(const godot_variant *p_self);
|
||||
godot_dictionary GDAPI godot_variant_as_dictionary(const godot_variant *p_self);
|
||||
godot_array GDAPI godot_variant_as_array(const godot_variant *p_self);
|
||||
godot_packed_byte_array GDAPI godot_variant_as_packed_byte_array(const godot_variant *p_self);
|
||||
|
@ -255,24 +289,149 @@ godot_packed_vector2_array GDAPI godot_variant_as_packed_vector2_array(const god
|
|||
godot_packed_vector3_array GDAPI godot_variant_as_packed_vector3_array(const godot_variant *p_self);
|
||||
godot_packed_color_array GDAPI godot_variant_as_packed_color_array(const godot_variant *p_self);
|
||||
|
||||
godot_variant GDAPI godot_variant_call(godot_variant *p_self, const godot_string *p_method, const godot_variant **p_args, const godot_int p_argcount, godot_variant_call_error *r_error);
|
||||
|
||||
godot_bool GDAPI godot_variant_has_method(const godot_variant *p_self, const godot_string *p_method);
|
||||
|
||||
godot_bool GDAPI godot_variant_operator_equal(const godot_variant *p_self, const godot_variant *p_other);
|
||||
godot_bool GDAPI godot_variant_operator_less(const godot_variant *p_self, const godot_variant *p_other);
|
||||
|
||||
uint32_t GDAPI godot_variant_hash(const godot_variant *p_self);
|
||||
godot_bool GDAPI godot_variant_hash_compare(const godot_variant *p_self, const godot_variant *p_other);
|
||||
|
||||
godot_bool GDAPI godot_variant_booleanize(const godot_variant *p_self);
|
||||
|
||||
void GDAPI godot_variant_destroy(godot_variant *p_self);
|
||||
|
||||
// GDNative core 1.1
|
||||
// Dynamic interaction.
|
||||
|
||||
godot_string GDAPI godot_variant_get_operator_name(godot_variant_operator p_op);
|
||||
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);
|
||||
void GDAPI godot_variant_call(godot_variant *p_self, const godot_string_name *p_method, const godot_variant **p_args, const godot_int p_argument_count, godot_variant *r_return, godot_variant_call_error *r_error);
|
||||
void GDAPI godot_variant_call_with_cstring(godot_variant *p_self, const char *p_method, const godot_variant **p_args, const godot_int p_argument_count, godot_variant *r_return, godot_variant_call_error *r_error);
|
||||
void GDAPI godot_variant_evaluate(godot_variant_operator p_op, const godot_variant *p_a, const godot_variant *p_b, godot_variant *r_return, bool *r_valid);
|
||||
void GDAPI godot_variant_set(godot_variant *p_self, const godot_variant *p_key, const godot_variant *p_value, bool *r_valid);
|
||||
void GDAPI godot_variant_set_named(godot_variant *p_self, const godot_string_name *p_name, const godot_variant *p_value, bool *r_valid);
|
||||
void GDAPI godot_variant_set_named_with_cstring(godot_variant *p_self, const char *p_name, const godot_variant *p_value, bool *r_valid);
|
||||
void GDAPI godot_variant_set_keyed(godot_variant *p_self, const godot_variant *p_key, const godot_variant *p_value, bool *r_valid);
|
||||
void GDAPI godot_variant_set_indexed(godot_variant *p_self, godot_int p_index, const godot_variant *p_value, bool *r_valid, bool *r_oob);
|
||||
godot_variant GDAPI godot_variant_get(const godot_variant *p_self, const godot_variant *p_key, bool *r_valid);
|
||||
godot_variant GDAPI godot_variant_get_named(const godot_variant *p_self, const godot_string_name *p_key, bool *r_valid);
|
||||
godot_variant GDAPI godot_variant_get_named_with_cstring(const godot_variant *p_self, const char *p_key, bool *r_valid);
|
||||
godot_variant GDAPI godot_variant_get_keyed(const godot_variant *p_self, const godot_variant *p_key, bool *r_valid);
|
||||
godot_variant GDAPI godot_variant_get_indexed(const godot_variant *p_self, godot_int p_index, bool *r_valid, bool *r_oob);
|
||||
/// Iteration.
|
||||
bool GDAPI godot_variant_iter_init(const godot_variant *p_self, godot_variant *r_iter, bool *r_valid);
|
||||
bool GDAPI godot_variant_iter_next(const godot_variant *p_self, godot_variant *r_iter, bool *r_valid);
|
||||
godot_variant GDAPI godot_variant_iter_get(const godot_variant *p_self, godot_variant *r_iter, bool *r_valid);
|
||||
|
||||
/// Variant functions.
|
||||
godot_bool GDAPI godot_variant_hash_compare(const godot_variant *p_self, const godot_variant *p_other);
|
||||
godot_bool GDAPI godot_variant_booleanize(const godot_variant *p_self);
|
||||
void GDAPI godot_variant_blend(const godot_variant *p_a, const godot_variant *p_b, float p_c, godot_variant *r_dst);
|
||||
void GDAPI godot_variant_interpolate(const godot_variant *p_a, const godot_variant *p_b, float p_c, godot_variant *r_dst);
|
||||
godot_variant GDAPI godot_variant_duplicate(const godot_variant *p_self, godot_bool p_deep);
|
||||
godot_string GDAPI godot_variant_stringify(const godot_variant *p_self);
|
||||
|
||||
// Discovery API.
|
||||
|
||||
/// Operators.
|
||||
godot_validated_operator_evaluator GDAPI godot_variant_get_validated_operator_evaluator(godot_variant_operator p_operator, godot_variant_type p_type_a, godot_variant_type p_type_b);
|
||||
godot_ptr_operator_evaluator GDAPI godot_variant_get_ptr_operator_evaluator(godot_variant_operator p_operator, godot_variant_type p_type_a, godot_variant_type p_type_b);
|
||||
godot_variant_type GDAPI godot_variant_get_operator_return_type(godot_variant_operator p_operator, godot_variant_type p_type_a, godot_variant_type p_type_b);
|
||||
godot_string GDAPI godot_variant_get_operator_name(godot_variant_operator p_operator);
|
||||
|
||||
/// Built-in methods.
|
||||
bool GDAPI godot_variant_has_builtin_method(godot_variant_type p_type, const godot_string_name *p_method);
|
||||
bool GDAPI godot_variant_has_builtin_method_with_cstring(godot_variant_type p_type, const char *p_method);
|
||||
godot_validated_builtin_method GDAPI godot_variant_get_validated_builtin_method(godot_variant_type p_type, const godot_string_name *p_method);
|
||||
godot_validated_builtin_method GDAPI godot_variant_get_validated_builtin_method_with_cstring(godot_variant_type p_type, const char *p_method);
|
||||
godot_ptr_builtin_method GDAPI godot_variant_get_ptr_builtin_method(godot_variant_type p_type, const godot_string_name *p_method);
|
||||
godot_ptr_builtin_method GDAPI godot_variant_get_ptr_builtin_method_with_cstring(godot_variant_type p_type, const char *p_method);
|
||||
int GDAPI godot_variant_get_builtin_method_argument_count(godot_variant_type p_type, const godot_string_name *p_method);
|
||||
int GDAPI godot_variant_get_builtin_method_argument_count_with_cstring(godot_variant_type p_type, const char *p_method);
|
||||
godot_variant_type GDAPI godot_variant_get_builtin_method_argument_type(godot_variant_type p_type, const godot_string_name *p_method, int p_argument);
|
||||
godot_variant_type GDAPI godot_variant_get_builtin_method_argument_type_with_cstring(godot_variant_type p_type, const char *p_method, int p_argument);
|
||||
godot_string GDAPI godot_variant_get_builtin_method_argument_name(godot_variant_type p_type, const godot_string_name *p_method, int p_argument);
|
||||
godot_string GDAPI godot_variant_get_builtin_method_argument_name_with_cstring(godot_variant_type p_type, const char *p_method, int p_argument);
|
||||
bool GDAPI godot_variant_has_builtin_method_return_value(godot_variant_type p_type, const godot_string_name *p_method);
|
||||
bool GDAPI godot_variant_has_builtin_method_return_value_with_cstring(godot_variant_type p_type, const char *p_method);
|
||||
godot_variant_type GDAPI godot_variant_get_builtin_method_return_type(godot_variant_type p_type, const godot_string_name *p_method);
|
||||
godot_variant_type GDAPI godot_variant_get_builtin_method_return_type_with_cstring(godot_variant_type p_type, const char *p_method);
|
||||
bool GDAPI godot_variant_is_builtin_method_const(godot_variant_type p_type, const godot_string_name *p_method);
|
||||
bool GDAPI godot_variant_is_builtin_method_const_with_cstring(godot_variant_type p_type, const char *p_method);
|
||||
bool GDAPI godot_variant_is_builtin_method_vararg(godot_variant_type p_type, const godot_string_name *p_method);
|
||||
bool GDAPI godot_variant_is_builtin_method_vararg_with_cstring(godot_variant_type p_type, const char *p_method);
|
||||
int GDAPI godot_variant_get_builtin_method_count(godot_variant_type p_type);
|
||||
void GDAPI godot_variant_get_builtin_method_list(godot_variant_type p_type, godot_string_name *r_list);
|
||||
|
||||
/// Constructors.
|
||||
int GDAPI godot_variant_get_constructor_count(godot_variant_type p_type);
|
||||
godot_validated_constructor GDAPI godot_variant_get_validated_constructor(godot_variant_type p_type, int p_constructor);
|
||||
godot_ptr_constructor GDAPI godot_variant_get_ptr_constructor(godot_variant_type p_type, int p_constructor);
|
||||
int GDAPI godot_variant_get_constructor_argument_count(godot_variant_type p_type, int p_constructor);
|
||||
godot_variant_type GDAPI godot_variant_get_constructor_argument_type(godot_variant_type p_type, int p_constructor, int p_argument);
|
||||
godot_string GDAPI godot_variant_get_constructor_argument_name(godot_variant_type p_type, int p_constructor, int p_argument);
|
||||
void GDAPI godot_variant_construct(godot_variant_type p_type, godot_variant *p_base, const godot_variant **p_args, int p_argument_count, godot_variant_call_error *r_error);
|
||||
|
||||
/// Properties.
|
||||
godot_variant_type GDAPI godot_variant_get_member_type(godot_variant_type p_type, const godot_string_name *p_member);
|
||||
godot_variant_type GDAPI godot_variant_get_member_type_with_cstring(godot_variant_type p_type, const char *p_member);
|
||||
int GDAPI godot_variant_get_member_count(godot_variant_type p_type);
|
||||
void GDAPI godot_variant_get_member_list(godot_variant_type p_type, godot_string_name *r_list);
|
||||
godot_validated_setter GDAPI godot_variant_get_validated_setter(godot_variant_type p_type, const godot_string_name *p_member);
|
||||
godot_validated_setter GDAPI godot_variant_get_validated_setter_with_cstring(godot_variant_type p_type, const char *p_member);
|
||||
godot_validated_getter GDAPI godot_variant_get_validated_getter(godot_variant_type p_type, const godot_string_name *p_member);
|
||||
godot_validated_getter GDAPI godot_variant_get_validated_getter_with_cstring(godot_variant_type p_type, const char *p_member);
|
||||
godot_ptr_setter GDAPI godot_variant_get_ptr_setter(godot_variant_type p_type, const godot_string_name *p_member);
|
||||
godot_ptr_setter GDAPI godot_variant_get_ptr_setter_with_cstring(godot_variant_type p_type, const char *p_member);
|
||||
godot_ptr_getter GDAPI godot_variant_get_ptr_getter(godot_variant_type p_type, const godot_string_name *p_member);
|
||||
godot_ptr_getter GDAPI godot_variant_get_ptr_getter_with_cstring(godot_variant_type p_type, const char *p_member);
|
||||
|
||||
/// Indexing.
|
||||
bool GDAPI godot_variant_has_indexing(godot_variant_type p_type);
|
||||
godot_variant_type GDAPI godot_variant_get_indexed_element_type(godot_variant_type p_type);
|
||||
godot_validated_indexed_setter GDAPI godot_variant_get_validated_indexed_setter(godot_variant_type p_type);
|
||||
godot_validated_indexed_getter GDAPI godot_variant_get_validated_indexed_getter(godot_variant_type p_type);
|
||||
godot_ptr_indexed_setter GDAPI godot_variant_get_ptr_indexed_setter(godot_variant_type p_type);
|
||||
godot_ptr_indexed_getter GDAPI godot_variant_get_ptr_indexed_getter(godot_variant_type p_type);
|
||||
uint64_t GDAPI godot_variant_get_indexed_size(const godot_variant *p_self);
|
||||
|
||||
/// Keying.
|
||||
bool GDAPI godot_variant_is_keyed(godot_variant_type p_type);
|
||||
godot_validated_keyed_setter GDAPI godot_variant_get_validated_keyed_setter(godot_variant_type p_type);
|
||||
godot_validated_keyed_getter GDAPI godot_variant_get_validated_keyed_getter(godot_variant_type p_type);
|
||||
godot_validated_keyed_checker GDAPI godot_variant_get_validated_keyed_checker(godot_variant_type p_type);
|
||||
godot_ptr_keyed_setter GDAPI godot_variant_get_ptr_keyed_setter(godot_variant_type p_type);
|
||||
godot_ptr_keyed_getter GDAPI godot_variant_get_ptr_keyed_getter(godot_variant_type p_type);
|
||||
godot_ptr_keyed_checker GDAPI godot_variant_get_ptr_keyed_checker(godot_variant_type p_type);
|
||||
|
||||
/// Constants.
|
||||
int GDAPI godot_variant_get_constants_count(godot_variant_type p_type);
|
||||
void GDAPI godot_variant_get_constants_list(godot_variant_type p_type, godot_string_name *r_list);
|
||||
bool GDAPI godot_variant_has_constant(godot_variant_type p_type, const godot_string_name *p_constant);
|
||||
bool GDAPI godot_variant_has_constant_with_cstring(godot_variant_type p_type, const char *p_constant);
|
||||
godot_variant GDAPI godot_variant_get_constant_value(godot_variant_type p_type, const godot_string_name *p_constant);
|
||||
godot_variant GDAPI godot_variant_get_constant_value_with_cstring(godot_variant_type p_type, const char *p_constant);
|
||||
|
||||
/// Utilities.
|
||||
bool GDAPI godot_variant_has_utility_function(const godot_string_name *p_function);
|
||||
bool GDAPI godot_variant_has_utility_function_with_cstring(const char *p_function);
|
||||
void GDAPI godot_variant_call_utility_function(const godot_string_name *p_function, godot_variant *r_ret, const godot_variant **p_args, int p_argument_count, godot_variant_call_error *r_error);
|
||||
void GDAPI godot_variant_call_utility_function_with_cstring(const char *p_function, godot_variant *r_ret, const godot_variant **p_args, int p_argument_count, godot_variant_call_error *r_error);
|
||||
godot_variant_utility_function_type GDAPI godot_variant_get_utility_function_type(const godot_string_name *p_function);
|
||||
godot_variant_utility_function_type GDAPI godot_variant_get_utility_function_type_with_cstring(const char *p_function);
|
||||
int GDAPI godot_variant_get_utility_function_argument_count(const godot_string_name *p_function);
|
||||
int GDAPI godot_variant_get_utility_function_argument_count_with_cstring(const char *p_function);
|
||||
godot_variant_type GDAPI godot_variant_get_utility_function_argument_type(const godot_string_name *p_function, int p_argument);
|
||||
godot_variant_type GDAPI godot_variant_get_utility_function_argument_type_with_cstring(const char *p_function, int p_argument);
|
||||
godot_string GDAPI godot_variant_get_utility_function_argument_name(const godot_string_name *p_function, int p_argument);
|
||||
godot_string GDAPI godot_variant_get_utility_function_argument_name_with_cstring(const char *p_function, int p_argument);
|
||||
bool GDAPI godot_variant_has_utility_function_return_value(const godot_string_name *p_function);
|
||||
bool GDAPI godot_variant_has_utility_function_return_value_with_cstring(const char *p_function);
|
||||
godot_variant_type GDAPI godot_variant_get_utility_function_return_type(const godot_string_name *p_function);
|
||||
godot_variant_type GDAPI godot_variant_get_utility_function_return_type_with_cstring(const char *p_function);
|
||||
bool GDAPI godot_variant_is_utility_function_vararg(const godot_string_name *p_function);
|
||||
bool GDAPI godot_variant_is_utility_function_vararg_with_cstring(const char *p_function);
|
||||
int GDAPI godot_variant_get_utility_function_count();
|
||||
void GDAPI godot_variant_get_utility_function_list(godot_string_name *r_functions);
|
||||
|
||||
// Introspection.
|
||||
|
||||
godot_variant_type GDAPI godot_variant_get_type(const godot_variant *p_self);
|
||||
bool GDAPI godot_variant_has_method(const godot_variant *p_self, const godot_string_name *p_method);
|
||||
bool GDAPI godot_variant_has_member(godot_variant_type p_type, const godot_string_name *p_member);
|
||||
bool GDAPI godot_variant_has_key(const godot_variant *p_self, const godot_variant *p_key, bool *r_valid);
|
||||
|
||||
godot_string GDAPI godot_variant_get_type_name(godot_variant_type p_type);
|
||||
bool GDAPI godot_variant_can_convert(godot_variant_type p_from, godot_variant_type p_to);
|
||||
bool GDAPI godot_variant_can_convert_strict(godot_variant_type p_from, godot_variant_type p_to);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -55,140 +55,10 @@ typedef struct {
|
|||
} godot_vector2i;
|
||||
#endif
|
||||
|
||||
// reduce extern "C" nesting for VS2013
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <gdnative/gdnative.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Vector2
|
||||
|
||||
void GDAPI godot_vector2_new(godot_vector2 *r_dest, const godot_real p_x, const godot_real p_y);
|
||||
|
||||
godot_string GDAPI godot_vector2_as_string(const godot_vector2 *p_self);
|
||||
|
||||
godot_vector2i GDAPI godot_vector2_as_vector2i(const godot_vector2 *p_self);
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_normalized(const godot_vector2 *p_self);
|
||||
|
||||
godot_real GDAPI godot_vector2_length(const godot_vector2 *p_self);
|
||||
|
||||
godot_real GDAPI godot_vector2_angle(const godot_vector2 *p_self);
|
||||
|
||||
godot_real GDAPI godot_vector2_length_squared(const godot_vector2 *p_self);
|
||||
|
||||
godot_bool GDAPI godot_vector2_is_normalized(const godot_vector2 *p_self);
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_direction_to(const godot_vector2 *p_self, const godot_vector2 *p_b);
|
||||
|
||||
godot_real GDAPI godot_vector2_distance_to(const godot_vector2 *p_self, const godot_vector2 *p_to);
|
||||
|
||||
godot_real GDAPI godot_vector2_distance_squared_to(const godot_vector2 *p_self, const godot_vector2 *p_to);
|
||||
|
||||
godot_real GDAPI godot_vector2_angle_to(const godot_vector2 *p_self, const godot_vector2 *p_to);
|
||||
|
||||
godot_real GDAPI godot_vector2_angle_to_point(const godot_vector2 *p_self, const godot_vector2 *p_to);
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_lerp(const godot_vector2 *p_self, const godot_vector2 *p_b, const godot_real p_t);
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_cubic_interpolate(const godot_vector2 *p_self, const godot_vector2 *p_b, const godot_vector2 *p_pre_a, const godot_vector2 *p_post_b, const godot_real p_t);
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_move_toward(const godot_vector2 *p_self, const godot_vector2 *p_to, const godot_real p_delta);
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_rotated(const godot_vector2 *p_self, const godot_real p_phi);
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_orthogonal(const godot_vector2 *p_self);
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_floor(const godot_vector2 *p_self);
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_sign(const godot_vector2 *p_self);
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_snapped(const godot_vector2 *p_self, const godot_vector2 *p_by);
|
||||
|
||||
godot_real GDAPI godot_vector2_aspect(const godot_vector2 *p_self);
|
||||
|
||||
godot_real GDAPI godot_vector2_dot(const godot_vector2 *p_self, const godot_vector2 *p_with);
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_slide(const godot_vector2 *p_self, const godot_vector2 *p_n);
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_bounce(const godot_vector2 *p_self, const godot_vector2 *p_n);
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_reflect(const godot_vector2 *p_self, const godot_vector2 *p_n);
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_abs(const godot_vector2 *p_self);
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_clamped(const godot_vector2 *p_self, const godot_real p_length);
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_operator_add(const godot_vector2 *p_self, const godot_vector2 *p_b);
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_operator_subtract(const godot_vector2 *p_self, const godot_vector2 *p_b);
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_operator_multiply_vector(const godot_vector2 *p_self, const godot_vector2 *p_b);
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_operator_multiply_scalar(const godot_vector2 *p_self, const godot_real p_b);
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_operator_divide_vector(const godot_vector2 *p_self, const godot_vector2 *p_b);
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_operator_divide_scalar(const godot_vector2 *p_self, const godot_real p_b);
|
||||
|
||||
godot_bool GDAPI godot_vector2_operator_equal(const godot_vector2 *p_self, const godot_vector2 *p_b);
|
||||
|
||||
godot_bool GDAPI godot_vector2_operator_less(const godot_vector2 *p_self, const godot_vector2 *p_b);
|
||||
|
||||
godot_vector2 GDAPI godot_vector2_operator_neg(const godot_vector2 *p_self);
|
||||
|
||||
void GDAPI godot_vector2_set_x(godot_vector2 *p_self, const godot_real p_x);
|
||||
|
||||
void GDAPI godot_vector2_set_y(godot_vector2 *p_self, const godot_real p_y);
|
||||
|
||||
godot_real GDAPI godot_vector2_get_x(const godot_vector2 *p_self);
|
||||
|
||||
godot_real GDAPI godot_vector2_get_y(const godot_vector2 *p_self);
|
||||
|
||||
// Vector2i
|
||||
|
||||
void GDAPI godot_vector2i_new(godot_vector2i *r_dest, const godot_int p_x, const godot_int p_y);
|
||||
|
||||
godot_string GDAPI godot_vector2i_as_string(const godot_vector2i *p_self);
|
||||
|
||||
godot_vector2 GDAPI godot_vector2i_as_vector2(const godot_vector2i *p_self);
|
||||
|
||||
godot_real GDAPI godot_vector2i_aspect(const godot_vector2i *p_self);
|
||||
|
||||
godot_vector2i GDAPI godot_vector2i_abs(const godot_vector2i *p_self);
|
||||
|
||||
godot_vector2i GDAPI godot_vector2i_sign(const godot_vector2i *p_self);
|
||||
|
||||
godot_vector2i GDAPI godot_vector2i_operator_add(const godot_vector2i *p_self, const godot_vector2i *p_b);
|
||||
|
||||
godot_vector2i GDAPI godot_vector2i_operator_subtract(const godot_vector2i *p_self, const godot_vector2i *p_b);
|
||||
|
||||
godot_vector2i GDAPI godot_vector2i_operator_multiply_vector(const godot_vector2i *p_self, const godot_vector2i *p_b);
|
||||
|
||||
godot_vector2i GDAPI godot_vector2i_operator_multiply_scalar(const godot_vector2i *p_self, const godot_int p_b);
|
||||
|
||||
godot_vector2i GDAPI godot_vector2i_operator_divide_vector(const godot_vector2i *p_self, const godot_vector2i *p_b);
|
||||
|
||||
godot_vector2i GDAPI godot_vector2i_operator_divide_scalar(const godot_vector2i *p_self, const godot_int p_b);
|
||||
|
||||
godot_bool GDAPI godot_vector2i_operator_equal(const godot_vector2i *p_self, const godot_vector2i *p_b);
|
||||
|
||||
godot_bool GDAPI godot_vector2i_operator_less(const godot_vector2i *p_self, const godot_vector2i *p_b);
|
||||
|
||||
godot_vector2i GDAPI godot_vector2i_operator_neg(const godot_vector2i *p_self);
|
||||
|
||||
void GDAPI godot_vector2i_set_x(godot_vector2i *p_self, const godot_int p_x);
|
||||
|
||||
void GDAPI godot_vector2i_set_y(godot_vector2i *p_self, const godot_int p_y);
|
||||
|
||||
godot_int GDAPI godot_vector2i_get_x(const godot_vector2i *p_self);
|
||||
|
||||
godot_int GDAPI godot_vector2i_get_y(const godot_vector2i *p_self);
|
||||
void GDAPI godot_vector2_new(godot_vector2 *p_self);
|
||||
void GDAPI godot_vector2i_new(godot_vector2i *p_self);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -55,145 +55,10 @@ typedef struct {
|
|||
} godot_vector3i;
|
||||
#endif
|
||||
|
||||
// reduce extern "C" nesting for VS2013
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <gdnative/basis.h>
|
||||
#include <gdnative/gdnative.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
GODOT_VECTOR3_AXIS_X,
|
||||
GODOT_VECTOR3_AXIS_Y,
|
||||
GODOT_VECTOR3_AXIS_Z,
|
||||
} godot_vector3_axis;
|
||||
|
||||
// Vector3
|
||||
|
||||
void GDAPI godot_vector3_new(godot_vector3 *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_z);
|
||||
|
||||
godot_string GDAPI godot_vector3_as_string(const godot_vector3 *p_self);
|
||||
|
||||
godot_vector3i GDAPI godot_vector3_as_vector3i(const godot_vector3 *p_self);
|
||||
|
||||
godot_int GDAPI godot_vector3_min_axis(const godot_vector3 *p_self);
|
||||
|
||||
godot_int GDAPI godot_vector3_max_axis(const godot_vector3 *p_self);
|
||||
|
||||
godot_real GDAPI godot_vector3_length(const godot_vector3 *p_self);
|
||||
|
||||
godot_real GDAPI godot_vector3_length_squared(const godot_vector3 *p_self);
|
||||
|
||||
godot_bool GDAPI godot_vector3_is_normalized(const godot_vector3 *p_self);
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_normalized(const godot_vector3 *p_self);
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_inverse(const godot_vector3 *p_self);
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_snapped(const godot_vector3 *p_self, const godot_vector3 *p_by);
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_rotated(const godot_vector3 *p_self, const godot_vector3 *p_axis, const godot_real p_phi);
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_lerp(const godot_vector3 *p_self, const godot_vector3 *p_b, const godot_real p_t);
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_cubic_interpolate(const godot_vector3 *p_self, const godot_vector3 *p_b, const godot_vector3 *p_pre_a, const godot_vector3 *p_post_b, const godot_real p_t);
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_move_toward(const godot_vector3 *p_self, const godot_vector3 *p_to, const godot_real p_delta);
|
||||
|
||||
godot_real GDAPI godot_vector3_dot(const godot_vector3 *p_self, const godot_vector3 *p_b);
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_cross(const godot_vector3 *p_self, const godot_vector3 *p_b);
|
||||
|
||||
godot_basis GDAPI godot_vector3_outer(const godot_vector3 *p_self, const godot_vector3 *p_b);
|
||||
|
||||
godot_basis GDAPI godot_vector3_to_diagonal_matrix(const godot_vector3 *p_self);
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_abs(const godot_vector3 *p_self);
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_sign(const godot_vector3 *p_self);
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_floor(const godot_vector3 *p_self);
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_ceil(const godot_vector3 *p_self);
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_direction_to(const godot_vector3 *p_self, const godot_vector3 *p_b);
|
||||
|
||||
godot_real GDAPI godot_vector3_distance_to(const godot_vector3 *p_self, const godot_vector3 *p_b);
|
||||
|
||||
godot_real GDAPI godot_vector3_distance_squared_to(const godot_vector3 *p_self, const godot_vector3 *p_b);
|
||||
|
||||
godot_real GDAPI godot_vector3_angle_to(const godot_vector3 *p_self, const godot_vector3 *p_to);
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_slide(const godot_vector3 *p_self, const godot_vector3 *p_n);
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_bounce(const godot_vector3 *p_self, const godot_vector3 *p_n);
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_reflect(const godot_vector3 *p_self, const godot_vector3 *p_n);
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_operator_add(const godot_vector3 *p_self, const godot_vector3 *p_b);
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_operator_subtract(const godot_vector3 *p_self, const godot_vector3 *p_b);
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_operator_multiply_vector(const godot_vector3 *p_self, const godot_vector3 *p_b);
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_operator_multiply_scalar(const godot_vector3 *p_self, const godot_real p_b);
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_operator_divide_vector(const godot_vector3 *p_self, const godot_vector3 *p_b);
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_operator_divide_scalar(const godot_vector3 *p_self, const godot_real p_b);
|
||||
|
||||
godot_bool GDAPI godot_vector3_operator_equal(const godot_vector3 *p_self, const godot_vector3 *p_b);
|
||||
|
||||
godot_bool GDAPI godot_vector3_operator_less(const godot_vector3 *p_self, const godot_vector3 *p_b);
|
||||
|
||||
godot_vector3 GDAPI godot_vector3_operator_neg(const godot_vector3 *p_self);
|
||||
|
||||
void GDAPI godot_vector3_set_axis(godot_vector3 *p_self, const godot_vector3_axis p_axis, const godot_real p_val);
|
||||
|
||||
godot_real GDAPI godot_vector3_get_axis(const godot_vector3 *p_self, const godot_vector3_axis p_axis);
|
||||
|
||||
// Vector3i
|
||||
|
||||
void GDAPI godot_vector3i_new(godot_vector3i *r_dest, const godot_int p_x, const godot_int p_y, const godot_int p_z);
|
||||
|
||||
godot_string GDAPI godot_vector3i_as_string(const godot_vector3i *p_self);
|
||||
|
||||
godot_vector3 GDAPI godot_vector3i_as_vector3(const godot_vector3i *p_self);
|
||||
|
||||
godot_int GDAPI godot_vector3i_min_axis(const godot_vector3i *p_self);
|
||||
|
||||
godot_int GDAPI godot_vector3i_max_axis(const godot_vector3i *p_self);
|
||||
|
||||
godot_vector3i GDAPI godot_vector3i_abs(const godot_vector3i *p_self);
|
||||
|
||||
godot_vector3i GDAPI godot_vector3i_sign(const godot_vector3i *p_self);
|
||||
|
||||
godot_vector3i GDAPI godot_vector3i_operator_add(const godot_vector3i *p_self, const godot_vector3i *p_b);
|
||||
|
||||
godot_vector3i GDAPI godot_vector3i_operator_subtract(const godot_vector3i *p_self, const godot_vector3i *p_b);
|
||||
|
||||
godot_vector3i GDAPI godot_vector3i_operator_multiply_vector(const godot_vector3i *p_self, const godot_vector3i *p_b);
|
||||
|
||||
godot_vector3i GDAPI godot_vector3i_operator_multiply_scalar(const godot_vector3i *p_self, const godot_int p_b);
|
||||
|
||||
godot_vector3i GDAPI godot_vector3i_operator_divide_vector(const godot_vector3i *p_self, const godot_vector3i *p_b);
|
||||
|
||||
godot_vector3i GDAPI godot_vector3i_operator_divide_scalar(const godot_vector3i *p_self, const godot_int p_b);
|
||||
|
||||
godot_bool GDAPI godot_vector3i_operator_equal(const godot_vector3i *p_self, const godot_vector3i *p_b);
|
||||
|
||||
godot_bool GDAPI godot_vector3i_operator_less(const godot_vector3i *p_self, const godot_vector3i *p_b);
|
||||
|
||||
godot_vector3i GDAPI godot_vector3i_operator_neg(const godot_vector3i *p_self);
|
||||
|
||||
void GDAPI godot_vector3i_set_axis(godot_vector3i *p_self, const godot_vector3_axis p_axis, const godot_int p_val);
|
||||
|
||||
godot_int GDAPI godot_vector3i_get_axis(const godot_vector3i *p_self, const godot_vector3_axis p_axis);
|
||||
void GDAPI godot_vector3_new(godot_vector3 *p_self);
|
||||
void GDAPI godot_vector3i_new(godot_vector3i *p_self);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -175,8 +175,8 @@ void GDAPI godot_glyph_set_flags(godot_glyph *p_self, godot_int p_flags);
|
|||
godot_vector2 GDAPI godot_glyph_get_offset(const godot_glyph *p_self);
|
||||
void GDAPI godot_glyph_set_offset(godot_glyph *p_self, const godot_vector2 *p_offset);
|
||||
|
||||
godot_real GDAPI godot_glyph_get_advance(const godot_glyph *p_self);
|
||||
void GDAPI godot_glyph_set_advance(godot_glyph *p_self, godot_real p_advance);
|
||||
godot_float GDAPI godot_glyph_get_advance(const godot_glyph *p_self);
|
||||
void GDAPI godot_glyph_set_advance(godot_glyph *p_self, godot_float p_advance);
|
||||
|
||||
godot_rid GDAPI godot_glyph_get_font(const godot_glyph *p_self);
|
||||
void GDAPI godot_glyph_set_font(godot_glyph *p_self, godot_rid *p_font);
|
||||
|
|
|
@ -49,11 +49,11 @@ typedef struct
|
|||
const char *(*get_plugin_name)();
|
||||
const char **(*get_supported_extensions)(int *count);
|
||||
godot_bool (*open_file)(void *, void *); // data struct, and a FileAccess pointer
|
||||
godot_real (*get_length)(const void *);
|
||||
godot_real (*get_playback_position)(const void *);
|
||||
void (*seek)(void *, godot_real);
|
||||
godot_float (*get_length)(const void *);
|
||||
godot_float (*get_playback_position)(const void *);
|
||||
void (*seek)(void *, godot_float);
|
||||
void (*set_audio_track)(void *, godot_int);
|
||||
void (*update)(void *, godot_real);
|
||||
void (*update)(void *, godot_float);
|
||||
godot_packed_byte_array *(*get_videoframe)(void *);
|
||||
godot_int (*get_audioframe)(void *, float *, int);
|
||||
godot_int (*get_channels)(const void *);
|
||||
|
|
|
@ -58,7 +58,7 @@ typedef struct {
|
|||
void (*uninitialize)(void *);
|
||||
godot_vector2 (*get_render_targetsize)(const void *);
|
||||
godot_transform (*get_transform_for_eye)(void *, godot_int, godot_transform *);
|
||||
void (*fill_projection_for_eye)(void *, godot_real *, godot_int, godot_real, godot_real, godot_real);
|
||||
void (*fill_projection_for_eye)(void *, godot_float *, godot_int, godot_float, godot_float, godot_float);
|
||||
void (*commit_for_eye)(void *, godot_int, godot_rid *, godot_rect2 *);
|
||||
void (*process)(void *);
|
||||
godot_int (*get_external_texture_for_eye)(void *, godot_int);
|
||||
|
@ -69,7 +69,7 @@ typedef struct {
|
|||
void GDAPI godot_xr_register_interface(const godot_xr_interface_gdnative *p_interface);
|
||||
|
||||
// helper functions to access XRServer data
|
||||
godot_real GDAPI godot_xr_get_worldscale();
|
||||
godot_float GDAPI godot_xr_get_worldscale();
|
||||
godot_transform GDAPI godot_xr_get_reference_frame();
|
||||
|
||||
// helper functions for rendering
|
||||
|
@ -81,8 +81,8 @@ godot_int GDAPI godot_xr_add_controller(char *p_device_name, godot_int p_hand, g
|
|||
void GDAPI godot_xr_remove_controller(godot_int p_controller_id);
|
||||
void GDAPI godot_xr_set_controller_transform(godot_int p_controller_id, godot_transform *p_transform, godot_bool p_tracks_orientation, godot_bool p_tracks_position);
|
||||
void GDAPI godot_xr_set_controller_button(godot_int p_controller_id, godot_int p_button, godot_bool p_is_pressed);
|
||||
void GDAPI godot_xr_set_controller_axis(godot_int p_controller_id, godot_int p_axis, godot_real p_value, godot_bool p_can_be_negative);
|
||||
godot_real GDAPI godot_xr_get_controller_rumble(godot_int p_controller_id);
|
||||
void GDAPI godot_xr_set_controller_axis(godot_int p_controller_id, godot_int p_axis, godot_float p_value, godot_bool p_can_be_negative);
|
||||
godot_float GDAPI godot_xr_get_controller_rumble(godot_int p_controller_id);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,204 @@
|
|||
/*************************************************************************/
|
||||
/* test_variant.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
/* "Software"), to deal in the Software without restriction, including */
|
||||
/* without limitation the rights to use, copy, modify, merge, publish, */
|
||||
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
||||
/* permit persons to whom the Software is furnished to do so, subject to */
|
||||
/* the following conditions: */
|
||||
/* */
|
||||
/* The above copyright notice and this permission notice shall be */
|
||||
/* included in all copies or substantial portions of the Software. */
|
||||
/* */
|
||||
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
||||
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
||||
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
||||
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
||||
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
||||
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/*************************************************************************/
|
||||
|
||||
#ifndef TEST_GDNATIVE_VARIANT_H
|
||||
#define TEST_GDNATIVE_VARIANT_H
|
||||
|
||||
#include <gdnative/gdnative.h>
|
||||
#include <gdnative/variant.h>
|
||||
|
||||
#include "tests/test_macros.h"
|
||||
|
||||
namespace TestGDNativeVariant {
|
||||
|
||||
TEST_CASE("[GDNative Variant] New Variant with copy") {
|
||||
godot_variant src;
|
||||
godot_variant_new_int(&src, 42);
|
||||
|
||||
godot_variant copy;
|
||||
godot_variant_new_copy(©, &src);
|
||||
|
||||
CHECK(godot_variant_as_int(©) == 42);
|
||||
CHECK(godot_variant_get_type(©) == GODOT_VARIANT_TYPE_INT);
|
||||
|
||||
godot_variant_destroy(&src);
|
||||
godot_variant_destroy(©);
|
||||
}
|
||||
|
||||
TEST_CASE("[GDNative Variant] New Variant with Nil") {
|
||||
godot_variant val;
|
||||
godot_variant_new_nil(&val);
|
||||
|
||||
CHECK(godot_variant_get_type(&val) == GODOT_VARIANT_TYPE_NIL);
|
||||
|
||||
godot_variant_destroy(&val);
|
||||
}
|
||||
|
||||
TEST_CASE("[GDNative Variant] New Variant with bool") {
|
||||
godot_variant val;
|
||||
godot_variant_new_bool(&val, true);
|
||||
|
||||
CHECK(godot_variant_as_bool(&val));
|
||||
CHECK(godot_variant_get_type(&val) == GODOT_VARIANT_TYPE_BOOL);
|
||||
|
||||
godot_variant_destroy(&val);
|
||||
}
|
||||
|
||||
TEST_CASE("[GDNative Variant] New Variant with float") {
|
||||
godot_variant val;
|
||||
godot_variant_new_float(&val, 4.2);
|
||||
|
||||
CHECK(godot_variant_as_float(&val) == 4.2);
|
||||
CHECK(godot_variant_get_type(&val) == GODOT_VARIANT_TYPE_FLOAT);
|
||||
|
||||
godot_variant_destroy(&val);
|
||||
}
|
||||
|
||||
TEST_CASE("[GDNative Variant] New Variant with String") {
|
||||
String str = "something";
|
||||
|
||||
godot_variant val;
|
||||
godot_variant_new_string(&val, (godot_string *)&str);
|
||||
godot_string gd_str = godot_variant_as_string(&val);
|
||||
String *result = (String *)&gd_str;
|
||||
|
||||
CHECK(*result == String("something"));
|
||||
CHECK(godot_variant_get_type(&val) == GODOT_VARIANT_TYPE_STRING);
|
||||
|
||||
godot_variant_destroy(&val);
|
||||
godot_string_destroy(&gd_str);
|
||||
}
|
||||
|
||||
TEST_CASE("[GDNative Variant] Variant call") {
|
||||
String str("something");
|
||||
godot_variant self;
|
||||
godot_variant_new_string(&self, (godot_string *)&str);
|
||||
|
||||
godot_variant ret;
|
||||
|
||||
godot_string_name method;
|
||||
godot_string_name_new_with_latin1_chars(&method, "is_valid_identifier");
|
||||
|
||||
godot_variant_call_error error;
|
||||
godot_variant_call(&self, &method, NULL, 0, &ret, &error);
|
||||
|
||||
CHECK(godot_variant_get_type(&ret) == GODOT_VARIANT_TYPE_BOOL);
|
||||
CHECK(godot_variant_as_bool(&ret));
|
||||
|
||||
godot_variant_destroy(&ret);
|
||||
godot_variant_destroy(&self);
|
||||
godot_string_name_destroy(&method);
|
||||
}
|
||||
|
||||
TEST_CASE("[GDNative Variant] Variant evaluate") {
|
||||
godot_variant one;
|
||||
godot_variant_new_int(&one, 1);
|
||||
godot_variant two;
|
||||
godot_variant_new_int(&two, 2);
|
||||
|
||||
godot_variant three;
|
||||
bool valid = false;
|
||||
|
||||
godot_variant_evaluate(GODOT_VARIANT_OP_ADD, &one, &two, &three, &valid);
|
||||
|
||||
CHECK(godot_variant_get_type(&three) == GODOT_VARIANT_TYPE_INT);
|
||||
CHECK(godot_variant_as_int(&three) == 3);
|
||||
CHECK(valid);
|
||||
|
||||
godot_variant_destroy(&one);
|
||||
godot_variant_destroy(&two);
|
||||
godot_variant_destroy(&three);
|
||||
}
|
||||
|
||||
TEST_CASE("[GDNative Variant] Variant set/get named") {
|
||||
godot_string_name x;
|
||||
godot_string_name_new_with_latin1_chars(&x, "x");
|
||||
|
||||
Vector2 vec(0, 0);
|
||||
godot_variant self;
|
||||
godot_variant_new_vector2(&self, (godot_vector2 *)&vec);
|
||||
|
||||
godot_variant set;
|
||||
godot_variant_new_float(&set, 1.0);
|
||||
|
||||
bool set_valid = false;
|
||||
godot_variant_set_named(&self, &x, &set, &set_valid);
|
||||
|
||||
bool get_valid = false;
|
||||
godot_variant get = godot_variant_get_named(&self, &x, &get_valid);
|
||||
|
||||
CHECK(get_valid);
|
||||
CHECK(set_valid);
|
||||
CHECK(godot_variant_get_type(&get) == GODOT_VARIANT_TYPE_FLOAT);
|
||||
CHECK(godot_variant_as_float(&get) == 1.0);
|
||||
|
||||
godot_string_name_destroy(&x);
|
||||
godot_variant_destroy(&self);
|
||||
godot_variant_destroy(&set);
|
||||
godot_variant_destroy(&get);
|
||||
}
|
||||
|
||||
TEST_CASE("[GDNative Variant] Get utility function argument name") {
|
||||
godot_string_name function;
|
||||
godot_string_name_new_with_latin1_chars(&function, "pow");
|
||||
|
||||
godot_string arg_name = godot_variant_get_utility_function_argument_name(&function, 0);
|
||||
|
||||
String *arg_name_str = (String *)&arg_name;
|
||||
|
||||
CHECK(*arg_name_str == "base");
|
||||
|
||||
godot_string_destroy(&arg_name);
|
||||
godot_string_name_destroy(&function);
|
||||
}
|
||||
|
||||
TEST_CASE("[GDNative Variant] Get utility function list") {
|
||||
int count = godot_variant_get_utility_function_count();
|
||||
|
||||
godot_string_name *c_list = (godot_string_name *)godot_alloc(count * sizeof(godot_string_name));
|
||||
godot_variant_get_utility_function_list(c_list);
|
||||
|
||||
List<StringName> cpp_list;
|
||||
Variant::get_utility_function_list(&cpp_list);
|
||||
|
||||
godot_string_name *cur = c_list;
|
||||
|
||||
for (const List<StringName>::Element *E = cpp_list.front(); E; E = E->next()) {
|
||||
const StringName &cpp_name = E->get();
|
||||
StringName *c_name = (StringName *)cur++;
|
||||
|
||||
CHECK(*c_name == cpp_name);
|
||||
}
|
||||
|
||||
godot_free(c_list);
|
||||
}
|
||||
} // namespace TestGDNativeVariant
|
||||
|
||||
#endif // TEST_GDNATIVE_VARIANT_H
|
|
@ -703,12 +703,12 @@ void GDAPI godot_glyph_set_offset(godot_glyph *p_self, const godot_vector2 *p_of
|
|||
self->y_off = offset->y;
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_glyph_get_advance(const godot_glyph *p_self) {
|
||||
godot_float GDAPI godot_glyph_get_advance(const godot_glyph *p_self) {
|
||||
const TextServer::Glyph *self = (const TextServer::Glyph *)p_self;
|
||||
return self->advance;
|
||||
}
|
||||
|
||||
void GDAPI godot_glyph_set_advance(godot_glyph *p_self, godot_real p_advance) {
|
||||
void GDAPI godot_glyph_set_advance(godot_glyph *p_self, godot_float p_advance) {
|
||||
TextServer::Glyph *self = (TextServer::Glyph *)p_self;
|
||||
self->advance = p_advance;
|
||||
}
|
||||
|
|
|
@ -190,7 +190,7 @@ CameraMatrix XRInterfaceGDNative::get_projection_for_eye(XRInterface::Eyes p_eye
|
|||
|
||||
ERR_FAIL_COND_V(interface == nullptr, CameraMatrix());
|
||||
|
||||
interface->fill_projection_for_eye(data, (godot_real *)cm.matrix, (godot_int)p_eye, p_aspect, p_z_near, p_z_far);
|
||||
interface->fill_projection_for_eye(data, (godot_float *)cm.matrix, (godot_int)p_eye, p_aspect, p_z_near, p_z_far);
|
||||
|
||||
return cm;
|
||||
}
|
||||
|
@ -234,7 +234,7 @@ void GDAPI godot_xr_register_interface(const godot_xr_interface_gdnative *p_inte
|
|||
XRServer::get_singleton()->add_interface(new_interface);
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_xr_get_worldscale() {
|
||||
godot_float GDAPI godot_xr_get_worldscale() {
|
||||
XRServer *xr_server = XRServer::get_singleton();
|
||||
ERR_FAIL_NULL_V(xr_server, 1.0);
|
||||
|
||||
|
@ -249,7 +249,7 @@ godot_transform GDAPI godot_xr_get_reference_frame() {
|
|||
if (xr_server != nullptr) {
|
||||
*reference_frame_ptr = xr_server->get_reference_frame();
|
||||
} else {
|
||||
godot_transform_new_identity(&reference_frame);
|
||||
memnew_placement(&reference_frame, Transform);
|
||||
}
|
||||
|
||||
return reference_frame;
|
||||
|
@ -387,7 +387,7 @@ void GDAPI godot_xr_set_controller_button(godot_int p_controller_id, godot_int p
|
|||
}
|
||||
}
|
||||
|
||||
void GDAPI godot_xr_set_controller_axis(godot_int p_controller_id, godot_int p_axis, godot_real p_value, godot_bool p_can_be_negative) {
|
||||
void GDAPI godot_xr_set_controller_axis(godot_int p_controller_id, godot_int p_axis, godot_float p_value, godot_bool p_can_be_negative) {
|
||||
XRServer *xr_server = XRServer::get_singleton();
|
||||
ERR_FAIL_NULL(xr_server);
|
||||
|
||||
|
@ -406,7 +406,7 @@ void GDAPI godot_xr_set_controller_axis(godot_int p_controller_id, godot_int p_a
|
|||
}
|
||||
}
|
||||
|
||||
godot_real GDAPI godot_xr_get_controller_rumble(godot_int p_controller_id) {
|
||||
godot_float GDAPI godot_xr_get_controller_rumble(godot_int p_controller_id) {
|
||||
XRServer *xr_server = XRServer::get_singleton();
|
||||
ERR_FAIL_NULL_V(xr_server, 0.0);
|
||||
|
||||
|
|
Loading…
Reference in New Issue