diff --git a/modules/gdnative/gdnative/array.cpp b/modules/gdnative/gdnative/array.cpp index 51c023981fc..90bc4dc0314 100644 --- a/modules/gdnative/gdnative/array.cpp +++ b/modules/gdnative/gdnative/array.cpp @@ -158,6 +158,11 @@ godot_variant GDAPI *godot_array_operator_index(godot_array *p_self, const godot 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; diff --git a/modules/gdnative/gdnative/dictionary.cpp b/modules/gdnative/gdnative/dictionary.cpp index ed98cdbb00b..7f8320622d0 100644 --- a/modules/gdnative/gdnative/dictionary.cpp +++ b/modules/gdnative/gdnative/dictionary.cpp @@ -130,6 +130,12 @@ godot_variant GDAPI *godot_dictionary_operator_index(godot_dictionary *p_self, c 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; diff --git a/modules/gdnative/gdnative_api.json b/modules/gdnative/gdnative_api.json index ac0293172da..0bd9dbceb4b 100644 --- a/modules/gdnative/gdnative_api.json +++ b/modules/gdnative/gdnative_api.json @@ -2488,6 +2488,14 @@ ["const godot_int", "p_idx"] ] }, + { + "name": "godot_array_operator_index_const", + "return_type": "const godot_variant *", + "arguments": [ + ["const godot_array *", "p_self"], + ["const godot_int", "p_idx"] + ] + }, { "name": "godot_array_append", "return_type": "void", @@ -2786,6 +2794,14 @@ ["const godot_variant *", "p_key"] ] }, + { + "name": "godot_dictionary_operator_index_const", + "return_type": "const godot_variant *", + "arguments": [ + ["const godot_dictionary *", "p_self"], + ["const godot_variant *", "p_key"] + ] + }, { "name": "godot_dictionary_next", "return_type": "godot_variant *", @@ -5644,6 +5660,13 @@ ["godot_object *", "p_instance"] ] }, + { + "name": "godot_pluginscript_register_language", + "return_type": "void", + "arguments": [ + ["const godot_pluginscript_language_desc *", "language_desc"] + ] + }, { "name": "godot_arvr_register_interface", "return_type": "void", diff --git a/modules/gdnative/include/gdnative/array.h b/modules/gdnative/include/gdnative/array.h index d0639589b7f..01ae61e2800 100644 --- a/modules/gdnative/include/gdnative/array.h +++ b/modules/gdnative/include/gdnative/array.h @@ -76,6 +76,8 @@ godot_variant GDAPI godot_array_get(const godot_array *p_self, const godot_int p 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); diff --git a/modules/gdnative/include/gdnative/dictionary.h b/modules/gdnative/include/gdnative/dictionary.h index e68d0fdc290..6d1f4369212 100644 --- a/modules/gdnative/include/gdnative/dictionary.h +++ b/modules/gdnative/include/gdnative/dictionary.h @@ -85,6 +85,8 @@ void GDAPI godot_dictionary_set(godot_dictionary *p_self, const godot_variant *p 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);