Update GDNantive API

Add missing Rect2 methods to GDNative API
Add missing Quat methods to GDNative API
Add missing NodePath methods to GDNative API
Add missing String methods to GDNative API
Add missing Array methods to GDNative API
Add missing Basis methods to GDNative API
Add missing Color methods to GDNative API
Update gdnative_api.json
This commit is contained in:
lupoDharkael 2018-10-25 16:13:51 +02:00
parent 7a42df3626
commit 2380f320e0
17 changed files with 395 additions and 2 deletions

View File

@ -468,7 +468,7 @@ String Color::to_html(bool p_alpha) const {
return txt;
}
Color Color::from_hsv(float p_h, float p_s, float p_v, float p_a) {
Color Color::from_hsv(float p_h, float p_s, float p_v, float p_a) const {
p_h = Math::fmod(p_h * 360.0f, 360.0f);
if (p_h < 0.0)

View File

@ -194,7 +194,7 @@ struct Color {
static bool html_is_valid(const String &p_color);
static Color named(const String &p_name);
String to_html(bool p_alpha = true) const;
Color from_hsv(float p_h, float p_s, float p_v, float p_a);
Color from_hsv(float p_h, float p_s, float p_v, float p_a) const;
static Color from_rgbe9995(uint32_t p_color);
_FORCE_INLINE_ bool operator<(const Color &p_color) const; //used in set keys

View File

@ -318,6 +318,38 @@ 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_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

View File

@ -282,6 +282,15 @@ godot_basis GDAPI godot_basis_operator_multiply_scalar(const godot_basis *p_self
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;
}
#ifdef __cplusplus
}
#endif

View File

@ -116,6 +116,26 @@ godot_int GDAPI godot_color_to_rgba32(const godot_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();
@ -156,6 +176,27 @@ godot_color GDAPI godot_color_blend(const godot_color *p_self, const godot_color
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;

View File

@ -110,6 +110,15 @@ godot_bool GDAPI godot_node_path_operator_equal(const godot_node_path *p_self, c
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

View File

@ -225,6 +225,12 @@ godot_quat GDAPI godot_quat_operator_neg(const godot_quat *p_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);
}
#ifdef __cplusplus
}
#endif

View File

@ -109,6 +109,27 @@ godot_rect2 GDAPI godot_rect2_grow(const godot_rect2 *p_self, const godot_real p
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_margin(const godot_rect2 *p_self, const godot_int p_margin, const godot_real p_by) {
godot_rect2 dest;
const Rect2 *self = (const Rect2 *)p_self;
*((Rect2 *)&dest) = self->grow_margin((Margin)p_margin, 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;

View File

@ -1285,6 +1285,64 @@ godot_bool GDAPI godot_string_is_valid_ip_address(const godot_string *p_self) {
return self->is_valid_ip_address();
}
godot_string GDAPI godot_string_dedent(const godot_string *p_self) {
const String *self = (const String *)p_self;
godot_string result;
String return_value = self->dedent();
memnew_placement(&result, String(return_value));
return result;
}
godot_string GDAPI godot_string_trim_prefix(const godot_string *p_self, const godot_string *p_prefix) {
const String *self = (const String *)p_self;
String *prefix = (String *)p_prefix;
godot_string result;
String return_value = self->trim_prefix(*prefix);
memnew_placement(&result, String(return_value));
return result;
}
godot_string GDAPI godot_string_trim_suffix(const godot_string *p_self, const godot_string *p_suffix) {
const String *self = (const String *)p_self;
String *suffix = (String *)p_suffix;
godot_string result;
String return_value = self->trim_suffix(*suffix);
memnew_placement(&result, String(return_value));
return result;
}
godot_string GDAPI godot_string_rstrip(const godot_string *p_self, const godot_string *p_chars) {
const String *self = (const String *)p_self;
String *chars = (String *)p_chars;
godot_string result;
String return_value = self->rstrip(*chars);
memnew_placement(&result, String(return_value));
return result;
}
godot_pool_string_array GDAPI godot_string_rsplit(const godot_string *p_self, const godot_string *p_divisor,
const godot_bool p_allow_empty, const godot_int p_maxsplit) {
const String *self = (const String *)p_self;
String *divisor = (String *)p_divisor;
godot_pool_string_array result;
memnew_placement(&result, PoolStringArray);
PoolStringArray *proxy = (PoolStringArray *)&result;
PoolStringArray::Write proxy_writer = proxy->write();
Vector<String> tmp_result = self->rsplit(*divisor, p_allow_empty, p_maxsplit);
proxy->resize(tmp_result.size());
for (int i = 0; i < tmp_result.size(); i++) {
proxy_writer[i] = tmp_result[i];
}
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -13,6 +13,183 @@
},
"next": null,
"api": [
{
"name": "godot_color_to_abgr32",
"return_type": "godot_int",
"arguments": [
["const godot_color *", "p_self"]
]
},
{
"name": "godot_color_to_abgr64",
"return_type": "godot_int",
"arguments": [
["const godot_color *", "p_self"]
]
},
{
"name": "godot_color_to_argb64",
"return_type": "godot_int",
"arguments": [
["const godot_color *", "p_self"]
]
},
{
"name": "godot_color_to_rgba64",
"return_type": "godot_int",
"arguments": [
["const godot_color *", "p_self"]
]
},
{
"name": "godot_color_darkened",
"return_type": "godot_color",
"arguments": [
["const godot_color *", "p_self"],
["const godot_real", "p_amount"]
]
},
{
"name": "godot_color_from_hsv",
"return_type": "godot_color",
"arguments": [
["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"]
]
},
{
"name": "godot_color_lightened",
"return_type": "godot_color",
"arguments": [
["const godot_color *", "p_self"],
["const godot_real", "p_amount"]
]
},
{
"name": "godot_array_duplicate",
"return_type": "godot_array",
"arguments": [
["const godot_array *", "p_self"],
["const godot_bool", "p_deep"]
]
},
{
"name": "godot_array_max",
"return_type": "godot_variant",
"arguments": [
["const godot_array *", "p_self"]
]
},
{
"name": "godot_array_min",
"return_type": "godot_variant",
"arguments": [
["const godot_array *", "p_self"]
]
},
{
"name": "godot_array_shuffle",
"return_type": "void",
"arguments": [
["godot_array *", "p_self"]
]
},
{
"name": "godot_basis_slerp",
"return_type": "godot_basis",
"arguments": [
["const godot_basis *", "p_self"],
["const godot_basis *", "p_b"],
["const godot_real", "p_t"]
]
},
{
"name": "godot_node_path_get_as_property_path",
"return_type": "godot_node_path",
"arguments": [
["const godot_node_path *", "p_self"]
]
},
{
"name": "godot_quat_set_axis_angle",
"return_type": "void",
"arguments": [
["godot_quat *", "p_self"],
["const godot_vector3 *", "p_axis"],
["const godot_real", "p_angle"]
]
},
{
"name": "godot_rect2_grow_individual",
"return_type": "godot_rect2",
"arguments": [
["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"]
]
},
{
"name": "godot_rect2_grow_margin",
"return_type": "godot_rect2",
"arguments": [
["const godot_rect2 *", "p_self"],
["const godot_int", "p_margin"],
["const godot_real", "p_by"]
]
},
{
"name": "godot_rect2_abs",
"return_type": "godot_rect2",
"arguments": [
["const godot_rect2 *", "p_self"]
]
},
{
"name": "godot_string_dedent",
"return_type": "godot_string",
"arguments": [
["const godot_string *", "p_self"]
]
},
{
"name": "godot_string_trim_prefix",
"return_type": "godot_string",
"arguments": [
["const godot_string *", "p_self"],
["const godot_string *", "p_prefix"]
]
},
{
"name": "godot_string_trim_suffix",
"return_type": "godot_string",
"arguments": [
["const godot_string *", "p_self"],
["const godot_string *", "p_suffix"]
]
},
{
"name": "godot_string_rstrip",
"return_type": "godot_string",
"arguments": [
["const godot_string *", "p_self"],
["const godot_string *", "p_chars"]
]
},
{
"name": "godot_string_rsplit",
"return_type": "godot_pool_string_array",
"arguments": [
["const godot_string *", "p_self"],
["const godot_string *", "p_divisor"],
["const godot_bool", "p_allow_empty"],
["const godot_int", "p_maxsplit"]
]
},
{
"name": "godot_basis_get_quat",
"return_type": "godot_quat",

View File

@ -130,6 +130,14 @@ godot_int GDAPI godot_array_bsearch_custom(godot_array *p_self, const godot_vari
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_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

View File

@ -127,6 +127,8 @@ godot_basis GDAPI godot_basis_operator_multiply_vector(const godot_basis *p_self
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);
#ifdef __cplusplus
}
#endif

View File

@ -81,6 +81,14 @@ 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_real GDAPI godot_color_gray(const godot_color *p_self);
@ -93,6 +101,12 @@ godot_color GDAPI godot_color_linear_interpolate(const godot_color *p_self, cons
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);

View File

@ -80,6 +80,8 @@ 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

View File

@ -109,6 +109,8 @@ godot_bool GDAPI godot_quat_operator_equal(const godot_quat *p_self, const godot
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);
#ifdef __cplusplus
}
#endif

View File

@ -77,6 +77,12 @@ godot_bool GDAPI godot_rect2_has_point(const godot_rect2 *p_self, const godot_ve
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_margin(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);

View File

@ -246,6 +246,12 @@ 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_rstrip(const godot_string *p_self, const godot_string *p_chars);
godot_pool_string_array GDAPI godot_string_rsplit(const godot_string *p_self, const godot_string *p_divisor, const godot_bool p_allow_empty, const godot_int p_maxsplit);
void GDAPI godot_string_destroy(godot_string *p_self);
#ifdef __cplusplus