diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdnative/gdnative/array.cpp | 11 | ||||
-rw-r--r-- | modules/gdnative/gdnative_api.json | 20 | ||||
-rw-r--r-- | modules/gdnative/include/gdnative/array.h | 4 |
3 files changed, 35 insertions, 0 deletions
diff --git a/modules/gdnative/gdnative/array.cpp b/modules/gdnative/gdnative/array.cpp index e0d9514985..8351c43574 100644 --- a/modules/gdnative/gdnative/array.cpp +++ b/modules/gdnative/gdnative/array.cpp @@ -302,6 +302,17 @@ void GDAPI godot_array_sort_custom(godot_array *p_self, godot_object *p_obj, con 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_destroy(godot_array *p_self) { ((Array *)p_self)->~Array(); } diff --git a/modules/gdnative/gdnative_api.json b/modules/gdnative/gdnative_api.json index 007c7955d4..0438a196cf 100644 --- a/modules/gdnative/gdnative_api.json +++ b/modules/gdnative/gdnative_api.json @@ -2680,6 +2680,26 @@ ] }, { + "name": "godot_array_bsearch", + "return_type": "godot_int", + "arguments": [ + ["godot_array *", "p_self"], + ["const godot_variant *", "p_value"], + ["const godot_bool", "p_before"] + ] + }, + { + "name": "godot_array_bsearch_custom", + "return_type": "godot_int", + "arguments": [ + ["godot_array *", "p_self"], + ["const godot_variant *", "p_value"], + ["godot_object *", "p_obj"], + ["const godot_string *", "p_func"], + ["const godot_bool", "p_before"] + ] + }, + { "name": "godot_array_destroy", "return_type": "void", "arguments": [ diff --git a/modules/gdnative/include/gdnative/array.h b/modules/gdnative/include/gdnative/array.h index 01ae61e280..484ffd10ba 100644 --- a/modules/gdnative/include/gdnative/array.h +++ b/modules/gdnative/include/gdnative/array.h @@ -124,6 +124,10 @@ 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_destroy(godot_array *p_self); #ifdef __cplusplus |