Skip to content

Commit

Permalink
Merge pull request godotengine#12725 from karroffel/gdnative-api-fixes
Browse files Browse the repository at this point in the history
[GDNative] even more API fixes
  • Loading branch information
akien-mga authored Nov 8, 2017
2 parents 2cdfef5 + a2e09a5 commit 7734591
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/gdnative/gdnative/array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions modules/gdnative/gdnative/dictionary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
23 changes: 23 additions & 0 deletions modules/gdnative/gdnative_api.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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 *",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions modules/gdnative/include/gdnative/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions modules/gdnative/include/gdnative/dictionary.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7734591

Please sign in to comment.