diff options
Diffstat (limited to 'modules/gdnative')
23 files changed, 121 insertions, 96 deletions
diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp index f397ee96c5..bb72dd69b8 100644 --- a/modules/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative.cpp @@ -286,7 +286,7 @@ bool GDNative::initialize() { } String lib_path = library->get_current_library_path(); - if (lib_path.empty()) { + if (lib_path.is_empty()) { ERR_PRINT("No library set for this platform"); return false; } diff --git a/modules/gdnative/gdnative/array.cpp b/modules/gdnative/gdnative/array.cpp index 863889acbc..403d651165 100644 --- a/modules/gdnative/gdnative/array.cpp +++ b/modules/gdnative/gdnative/array.cpp @@ -215,9 +215,9 @@ godot_int GDAPI godot_array_count(const godot_array *p_self, const godot_variant return self->count(*val); } -godot_bool GDAPI godot_array_empty(const godot_array *p_self) { +godot_bool GDAPI godot_array_is_empty(const godot_array *p_self) { const Array *self = (const Array *)p_self; - return self->empty(); + return self->is_empty(); } void GDAPI godot_array_erase(godot_array *p_self, const godot_variant *p_value) { diff --git a/modules/gdnative/gdnative/dictionary.cpp b/modules/gdnative/gdnative/dictionary.cpp index b6900b28bb..b34d73dc40 100644 --- a/modules/gdnative/gdnative/dictionary.cpp +++ b/modules/gdnative/gdnative/dictionary.cpp @@ -71,9 +71,9 @@ godot_int GDAPI godot_dictionary_size(const godot_dictionary *p_self) { return self->size(); } -godot_bool GDAPI godot_dictionary_empty(const godot_dictionary *p_self) { +godot_bool GDAPI godot_dictionary_is_empty(const godot_dictionary *p_self) { const Dictionary *self = (const Dictionary *)p_self; - return self->empty(); + return self->is_empty(); } void GDAPI godot_dictionary_clear(godot_dictionary *p_self) { diff --git a/modules/gdnative/gdnative/packed_arrays.cpp b/modules/gdnative/gdnative/packed_arrays.cpp index cc1e05b8a4..351c456a5d 100644 --- a/modules/gdnative/gdnative/packed_arrays.cpp +++ b/modules/gdnative/gdnative/packed_arrays.cpp @@ -150,9 +150,9 @@ godot_int GDAPI godot_packed_byte_array_size(const godot_packed_byte_array *p_se return self->size(); } -godot_bool GDAPI godot_packed_byte_array_empty(const godot_packed_byte_array *p_self) { +godot_bool GDAPI godot_packed_byte_array_is_empty(const godot_packed_byte_array *p_self) { const Vector<uint8_t> *self = (const Vector<uint8_t> *)p_self; - return self->empty(); + return self->is_empty(); } void GDAPI godot_packed_byte_array_destroy(godot_packed_byte_array *p_self) { @@ -254,9 +254,9 @@ godot_int GDAPI godot_packed_int32_array_size(const godot_packed_int32_array *p_ return self->size(); } -godot_bool GDAPI godot_packed_int32_array_empty(const godot_packed_int32_array *p_self) { +godot_bool GDAPI godot_packed_int32_array_is_empty(const godot_packed_int32_array *p_self) { const Vector<int32_t> *self = (const Vector<int32_t> *)p_self; - return self->empty(); + return self->is_empty(); } void GDAPI godot_packed_int32_array_destroy(godot_packed_int32_array *p_self) { @@ -358,9 +358,9 @@ godot_int GDAPI godot_packed_int64_array_size(const godot_packed_int64_array *p_ return self->size(); } -godot_bool GDAPI godot_packed_int64_array_empty(const godot_packed_int64_array *p_self) { +godot_bool GDAPI godot_packed_int64_array_is_empty(const godot_packed_int64_array *p_self) { const Vector<int64_t> *self = (const Vector<int64_t> *)p_self; - return self->empty(); + return self->is_empty(); } void GDAPI godot_packed_int64_array_destroy(godot_packed_int64_array *p_self) { @@ -462,9 +462,9 @@ godot_int GDAPI godot_packed_float32_array_size(const godot_packed_float32_array return self->size(); } -godot_bool GDAPI godot_packed_float32_array_empty(const godot_packed_float32_array *p_self) { +godot_bool GDAPI godot_packed_float32_array_is_empty(const godot_packed_float32_array *p_self) { const Vector<float> *self = (const Vector<float> *)p_self; - return self->empty(); + return self->is_empty(); } void GDAPI godot_packed_float32_array_destroy(godot_packed_float32_array *p_self) { @@ -566,9 +566,9 @@ godot_int GDAPI godot_packed_float64_array_size(const godot_packed_float64_array return self->size(); } -godot_bool GDAPI godot_packed_float64_array_empty(const godot_packed_float64_array *p_self) { +godot_bool GDAPI godot_packed_float64_array_is_empty(const godot_packed_float64_array *p_self) { const Vector<double> *self = (const Vector<double> *)p_self; - return self->empty(); + return self->is_empty(); } void GDAPI godot_packed_float64_array_destroy(godot_packed_float64_array *p_self) { @@ -679,9 +679,9 @@ godot_int GDAPI godot_packed_string_array_size(const godot_packed_string_array * return self->size(); } -godot_bool GDAPI godot_packed_string_array_empty(const godot_packed_string_array *p_self) { +godot_bool GDAPI godot_packed_string_array_is_empty(const godot_packed_string_array *p_self) { const Vector<String> *self = (const Vector<String> *)p_self; - return self->empty(); + return self->is_empty(); } void GDAPI godot_packed_string_array_destroy(godot_packed_string_array *p_self) { @@ -791,9 +791,9 @@ godot_int GDAPI godot_packed_vector2_array_size(const godot_packed_vector2_array return self->size(); } -godot_bool GDAPI godot_packed_vector2_array_empty(const godot_packed_vector2_array *p_self) { +godot_bool GDAPI godot_packed_vector2_array_is_empty(const godot_packed_vector2_array *p_self) { const Vector<Vector2> *self = (const Vector<Vector2> *)p_self; - return self->empty(); + return self->is_empty(); } void GDAPI godot_packed_vector2_array_destroy(godot_packed_vector2_array *p_self) { @@ -903,9 +903,9 @@ godot_int GDAPI godot_packed_vector2i_array_size(const godot_packed_vector2i_arr return self->size(); } -godot_bool GDAPI godot_packed_vector2i_array_empty(const godot_packed_vector2i_array *p_self) { +godot_bool GDAPI godot_packed_vector2i_array_is_empty(const godot_packed_vector2i_array *p_self) { const Vector<Vector2i> *self = (const Vector<Vector2i> *)p_self; - return self->empty(); + return self->is_empty(); } void GDAPI godot_packed_vector2i_array_destroy(godot_packed_vector2i_array *p_self) { @@ -1015,9 +1015,9 @@ godot_int GDAPI godot_packed_vector3_array_size(const godot_packed_vector3_array return self->size(); } -godot_bool GDAPI godot_packed_vector3_array_empty(const godot_packed_vector3_array *p_self) { +godot_bool GDAPI godot_packed_vector3_array_is_empty(const godot_packed_vector3_array *p_self) { const Vector<Vector3> *self = (const Vector<Vector3> *)p_self; - return self->empty(); + return self->is_empty(); } void GDAPI godot_packed_vector3_array_destroy(godot_packed_vector3_array *p_self) { @@ -1127,9 +1127,9 @@ godot_int GDAPI godot_packed_color_array_size(const godot_packed_color_array *p_ return self->size(); } -godot_bool GDAPI godot_packed_color_array_empty(const godot_packed_color_array *p_self) { +godot_bool GDAPI godot_packed_color_array_is_empty(const godot_packed_color_array *p_self) { const Vector<Color> *self = (const Vector<Color> *)p_self; - return self->empty(); + return self->is_empty(); } void GDAPI godot_packed_color_array_destroy(godot_packed_color_array *p_self) { diff --git a/modules/gdnative/gdnative/rect2.cpp b/modules/gdnative/gdnative/rect2.cpp index bacefced5d..aeb034a4c0 100644 --- a/modules/gdnative/gdnative/rect2.cpp +++ b/modules/gdnative/gdnative/rect2.cpp @@ -90,11 +90,11 @@ godot_bool GDAPI godot_rect2_has_no_area(const godot_rect2 *p_self) { return self->has_no_area(); } -godot_rect2 GDAPI godot_rect2_clip(const godot_rect2 *p_self, const godot_rect2 *p_b) { +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->clip(*b); + *((Rect2 *)&dest) = self->intersection(*b); return dest; } @@ -127,10 +127,10 @@ godot_rect2 GDAPI godot_rect2_grow_individual(const godot_rect2 *p_self, const g 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 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_margin((Margin)p_margin, p_by); + *((Rect2 *)&dest) = self->grow_side((Side)p_side, p_by); return dest; } @@ -233,11 +233,11 @@ godot_bool GDAPI godot_rect2i_has_no_area(const godot_rect2i *p_self) { return self->has_no_area(); } -godot_rect2i GDAPI godot_rect2i_clip(const godot_rect2i *p_self, const godot_rect2i *p_b) { +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->clip(*b); + *((Rect2i *)&dest) = self->intersection(*b); return dest; } @@ -270,10 +270,10 @@ godot_rect2i GDAPI godot_rect2i_grow_individual(const godot_rect2i *p_self, cons return dest; } -godot_rect2i GDAPI godot_rect2i_grow_margin(const godot_rect2i *p_self, const godot_int p_margin, const godot_int p_by) { +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_margin((Margin)p_margin, p_by); + *((Rect2i *)&dest) = self->grow_side((Side)p_side, p_by); return dest; } diff --git a/modules/gdnative/gdnative/string.cpp b/modules/gdnative/gdnative/string.cpp index 47c7f7b6e7..743c47c01a 100644 --- a/modules/gdnative/gdnative/string.cpp +++ b/modules/gdnative/gdnative/string.cpp @@ -1087,10 +1087,10 @@ godot_string GDAPI godot_string_sha256_text(const godot_string *p_self) { return result; } -godot_bool godot_string_empty(const godot_string *p_self) { +godot_bool godot_string_is_empty(const godot_string *p_self) { const String *self = (const String *)p_self; - return self->empty(); + return self->is_empty(); } // path functions diff --git a/modules/gdnative/gdnative/vector2.cpp b/modules/gdnative/gdnative/vector2.cpp index 1ba846d315..0c2a414c08 100644 --- a/modules/gdnative/gdnative/vector2.cpp +++ b/modules/gdnative/gdnative/vector2.cpp @@ -154,10 +154,10 @@ godot_vector2 GDAPI godot_vector2_rotated(const godot_vector2 *p_self, const god return dest; } -godot_vector2 GDAPI godot_vector2_tangent(const godot_vector2 *p_self) { +godot_vector2 GDAPI godot_vector2_orthogonal(const godot_vector2 *p_self) { godot_vector2 dest; const Vector2 *self = (const Vector2 *)p_self; - *((Vector2 *)&dest) = self->tangent(); + *((Vector2 *)&dest) = self->orthogonal(); return dest; } diff --git a/modules/gdnative/gdnative_api.json b/modules/gdnative/gdnative_api.json index 84b36b3745..e104c77eae 100644 --- a/modules/gdnative/gdnative_api.json +++ b/modules/gdnative/gdnative_api.json @@ -380,7 +380,7 @@ ] }, { - "name": "godot_array_empty", + "name": "godot_array_is_empty", "return_type": "godot_bool", "arguments": [ ["const godot_array *", "p_self"] @@ -1388,7 +1388,7 @@ ] }, { - "name": "godot_dictionary_empty", + "name": "godot_dictionary_is_empty", "return_type": "godot_bool", "arguments": [ ["const godot_dictionary *", "p_self"] @@ -1647,7 +1647,7 @@ ] }, { - "name": "godot_packed_byte_array_empty", + "name": "godot_packed_byte_array_is_empty", "return_type": "godot_bool", "arguments": [ ["const godot_packed_byte_array *", "p_self"] @@ -1793,7 +1793,7 @@ ] }, { - "name": "godot_packed_int32_array_empty", + "name": "godot_packed_int32_array_is_empty", "return_type": "godot_bool", "arguments": [ ["const godot_packed_int32_array *", "p_self"] @@ -1939,7 +1939,7 @@ ] }, { - "name": "godot_packed_int64_array_empty", + "name": "godot_packed_int64_array_is_empty", "return_type": "godot_bool", "arguments": [ ["const godot_packed_int64_array *", "p_self"] @@ -2085,7 +2085,7 @@ ] }, { - "name": "godot_packed_float32_array_empty", + "name": "godot_packed_float32_array_is_empty", "return_type": "godot_bool", "arguments": [ ["const godot_packed_float32_array *", "p_self"] @@ -2231,7 +2231,7 @@ ] }, { - "name": "godot_packed_float64_array_empty", + "name": "godot_packed_float64_array_is_empty", "return_type": "godot_bool", "arguments": [ ["const godot_packed_float64_array *", "p_self"] @@ -2377,7 +2377,7 @@ ] }, { - "name": "godot_packed_string_array_empty", + "name": "godot_packed_string_array_is_empty", "return_type": "godot_bool", "arguments": [ ["const godot_packed_string_array *", "p_self"] @@ -2523,7 +2523,7 @@ ] }, { - "name": "godot_packed_vector2_array_empty", + "name": "godot_packed_vector2_array_is_empty", "return_type": "godot_bool", "arguments": [ ["const godot_packed_vector2_array *", "p_self"] @@ -2669,7 +2669,7 @@ ] }, { - "name": "godot_packed_vector2i_array_empty", + "name": "godot_packed_vector2i_array_is_empty", "return_type": "godot_bool", "arguments": [ ["const godot_packed_vector2i_array *", "p_self"] @@ -2815,7 +2815,7 @@ ] }, { - "name": "godot_packed_vector3_array_empty", + "name": "godot_packed_vector3_array_is_empty", "return_type": "godot_bool", "arguments": [ ["const godot_packed_vector3_array *", "p_self"] @@ -2961,7 +2961,7 @@ ] }, { - "name": "godot_packed_color_array_empty", + "name": "godot_packed_color_array_is_empty", "return_type": "godot_bool", "arguments": [ ["const godot_packed_color_array *", "p_self"] @@ -3534,11 +3534,11 @@ ] }, { - "name": "godot_rect2_grow_margin", + "name": "godot_rect2_grow_side", "return_type": "godot_rect2", "arguments": [ ["const godot_rect2 *", "p_self"], - ["const godot_int", "p_margin"], + ["const godot_int", "p_side"], ["const godot_real", "p_by"] ] }, @@ -3573,7 +3573,7 @@ ] }, { - "name": "godot_rect2_clip", + "name": "godot_rect2_intersection", "return_type": "godot_rect2", "arguments": [ ["const godot_rect2 *", "p_self"], @@ -3715,7 +3715,7 @@ ] }, { - "name": "godot_rect2i_clip", + "name": "godot_rect2i_intersection", "return_type": "godot_rect2i", "arguments": [ ["const godot_rect2i *", "p_self"], @@ -3758,11 +3758,11 @@ ] }, { - "name": "godot_rect2i_grow_margin", + "name": "godot_rect2i_grow_side", "return_type": "godot_rect2i", "arguments": [ ["const godot_rect2i *", "p_self"], - ["const godot_int", "p_margin"], + ["const godot_int", "p_side"], ["const godot_int", "p_by"] ] }, @@ -5005,7 +5005,7 @@ ] }, { - "name": "godot_string_empty", + "name": "godot_string_is_empty", "return_type": "godot_bool", "arguments": [ ["const godot_string *", "p_self"] @@ -6413,7 +6413,7 @@ ] }, { - "name": "godot_vector2_tangent", + "name": "godot_vector2_orthogonal", "return_type": "godot_vector2", "arguments": [ ["const godot_vector2 *", "p_self"] @@ -7946,7 +7946,7 @@ ] }, { - "name": "godot_packed_glyph_array_empty", + "name": "godot_packed_glyph_array_is_empty", "return_type": "godot_bool", "arguments": [ ["const godot_packed_glyph_array *", "p_self"] diff --git a/modules/gdnative/gdnative_library_editor_plugin.cpp b/modules/gdnative/gdnative_library_editor_plugin.cpp index 719fcbc927..eafe0f43a4 100644 --- a/modules/gdnative/gdnative_library_editor_plugin.cpp +++ b/modules/gdnative/gdnative_library_editor_plugin.cpp @@ -65,7 +65,7 @@ void GDNativeLibraryEditor::_update_tree() { continue; } Map<String, NativePlatformConfig>::Element *E = platforms.find(filter_list->get_item_metadata(i)); - if (!text.empty()) { + if (!text.is_empty()) { text += ", "; } text += E->get().name; @@ -91,7 +91,7 @@ void GDNativeLibraryEditor::_update_tree() { bit->add_button(1, get_theme_icon("Folder", "EditorIcons"), BUTTON_SELECT_LIBRARY, false, TTR("Select the dynamic library for this entry")); String file = entry_configs[target].library; - if (!file.empty()) { + if (!file.is_empty()) { bit->add_button(1, get_theme_icon("Clear", "EditorIcons"), BUTTON_CLEAR_LIBRARY, false, TTR("Clear")); } bit->set_text(1, file); @@ -195,7 +195,7 @@ void GDNativeLibraryEditor::_on_item_activated() { void GDNativeLibraryEditor::_on_create_new_entry() { String platform = new_architecture_dialog->get_meta("platform"); String entry = new_architecture_input->get_text().strip_edges(); - if (!entry.empty()) { + if (!entry.is_empty()) { platforms[platform].entries.push_back(entry); _update_tree(); } @@ -248,7 +248,7 @@ void GDNativeLibraryEditor::_translate_to_config_file() { for (Map<String, NativePlatformConfig>::Element *E = platforms.front(); E; E = E->next()) { for (List<String>::Element *it = E->value().entries.front(); it; it = it->next()) { String target = E->key() + "." + it->get(); - if (entry_configs[target].library.empty() && entry_configs[target].dependencies.empty()) { + if (entry_configs[target].library.is_empty() && entry_configs[target].dependencies.is_empty()) { continue; } @@ -327,7 +327,7 @@ GDNativeLibraryEditor::GDNativeLibraryEditor() { VBoxContainer *container = memnew(VBoxContainer); add_child(container); - container->set_anchors_and_margins_preset(PRESET_WIDE); + container->set_anchors_and_offsets_preset(PRESET_WIDE); HBoxContainer *hbox = memnew(HBoxContainer); container->add_child(hbox); @@ -381,8 +381,8 @@ GDNativeLibraryEditor::GDNativeLibraryEditor() { new_architecture_input = memnew(LineEdit); new_architecture_dialog->add_child(new_architecture_input); // new_architecture_dialog->set_custom_minimum_size(Vector2(300, 80) * EDSCALE); - new_architecture_input->set_anchors_and_margins_preset(PRESET_HCENTER_WIDE, PRESET_MODE_MINSIZE, 5 * EDSCALE); - new_architecture_dialog->get_ok()->connect("pressed", callable_mp(this, &GDNativeLibraryEditor::_on_create_new_entry)); + new_architecture_input->set_anchors_and_offsets_preset(PRESET_HCENTER_WIDE, PRESET_MODE_MINSIZE, 5 * EDSCALE); + new_architecture_dialog->get_ok_button()->connect("pressed", callable_mp(this, &GDNativeLibraryEditor::_on_create_new_entry)); } void GDNativeLibraryEditorPlugin::edit(Object *p_node) { diff --git a/modules/gdnative/include/gdnative/array.h b/modules/gdnative/include/gdnative/array.h index 7a59493b7d..1374a899e5 100644 --- a/modules/gdnative/include/gdnative/array.h +++ b/modules/gdnative/include/gdnative/array.h @@ -87,7 +87,7 @@ 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_empty(const godot_array *p_self); +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); diff --git a/modules/gdnative/include/gdnative/dictionary.h b/modules/gdnative/include/gdnative/dictionary.h index 873efaa9bf..f02e43f173 100644 --- a/modules/gdnative/include/gdnative/dictionary.h +++ b/modules/gdnative/include/gdnative/dictionary.h @@ -67,7 +67,7 @@ godot_dictionary GDAPI godot_dictionary_duplicate(const godot_dictionary *p_self godot_int GDAPI godot_dictionary_size(const godot_dictionary *p_self); -godot_bool GDAPI godot_dictionary_empty(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); diff --git a/modules/gdnative/include/gdnative/packed_arrays.h b/modules/gdnative/include/gdnative/packed_arrays.h index ce9579f307..135d4036fc 100644 --- a/modules/gdnative/include/gdnative/packed_arrays.h +++ b/modules/gdnative/include/gdnative/packed_arrays.h @@ -195,7 +195,7 @@ uint8_t GDAPI godot_packed_byte_array_get(const godot_packed_byte_array *p_self, godot_int GDAPI godot_packed_byte_array_size(const godot_packed_byte_array *p_self); -godot_bool GDAPI godot_packed_byte_array_empty(const godot_packed_byte_array *p_self); +godot_bool GDAPI godot_packed_byte_array_is_empty(const godot_packed_byte_array *p_self); void GDAPI godot_packed_byte_array_destroy(godot_packed_byte_array *p_self); @@ -231,7 +231,7 @@ int32_t GDAPI godot_packed_int32_array_get(const godot_packed_int32_array *p_sel godot_int GDAPI godot_packed_int32_array_size(const godot_packed_int32_array *p_self); -godot_bool GDAPI godot_packed_int32_array_empty(const godot_packed_int32_array *p_self); +godot_bool GDAPI godot_packed_int32_array_is_empty(const godot_packed_int32_array *p_self); void GDAPI godot_packed_int32_array_destroy(godot_packed_int32_array *p_self); @@ -267,7 +267,7 @@ int64_t GDAPI godot_packed_int64_array_get(const godot_packed_int64_array *p_sel godot_int GDAPI godot_packed_int64_array_size(const godot_packed_int64_array *p_self); -godot_bool GDAPI godot_packed_int64_array_empty(const godot_packed_int64_array *p_self); +godot_bool GDAPI godot_packed_int64_array_is_empty(const godot_packed_int64_array *p_self); void GDAPI godot_packed_int64_array_destroy(godot_packed_int64_array *p_self); @@ -303,7 +303,7 @@ float GDAPI godot_packed_float32_array_get(const godot_packed_float32_array *p_s godot_int GDAPI godot_packed_float32_array_size(const godot_packed_float32_array *p_self); -godot_bool GDAPI godot_packed_float32_array_empty(const godot_packed_float32_array *p_self); +godot_bool GDAPI godot_packed_float32_array_is_empty(const godot_packed_float32_array *p_self); void GDAPI godot_packed_float32_array_destroy(godot_packed_float32_array *p_self); @@ -339,7 +339,7 @@ double GDAPI godot_packed_float64_array_get(const godot_packed_float64_array *p_ godot_int GDAPI godot_packed_float64_array_size(const godot_packed_float64_array *p_self); -godot_bool GDAPI godot_packed_float64_array_empty(const godot_packed_float64_array *p_self); +godot_bool GDAPI godot_packed_float64_array_is_empty(const godot_packed_float64_array *p_self); void GDAPI godot_packed_float64_array_destroy(godot_packed_float64_array *p_self); @@ -375,7 +375,7 @@ godot_string GDAPI godot_packed_string_array_get(const godot_packed_string_array godot_int GDAPI godot_packed_string_array_size(const godot_packed_string_array *p_self); -godot_bool GDAPI godot_packed_string_array_empty(const godot_packed_string_array *p_self); +godot_bool GDAPI godot_packed_string_array_is_empty(const godot_packed_string_array *p_self); void GDAPI godot_packed_string_array_destroy(godot_packed_string_array *p_self); @@ -411,7 +411,7 @@ godot_vector2 GDAPI godot_packed_vector2_array_get(const godot_packed_vector2_ar godot_int GDAPI godot_packed_vector2_array_size(const godot_packed_vector2_array *p_self); -godot_bool GDAPI godot_packed_vector2_array_empty(const godot_packed_vector2_array *p_self); +godot_bool GDAPI godot_packed_vector2_array_is_empty(const godot_packed_vector2_array *p_self); void GDAPI godot_packed_vector2_array_destroy(godot_packed_vector2_array *p_self); @@ -447,7 +447,7 @@ godot_vector2i GDAPI godot_packed_vector2i_array_get(const godot_packed_vector2i godot_int GDAPI godot_packed_vector2i_array_size(const godot_packed_vector2i_array *p_self); -godot_bool GDAPI godot_packed_vector2i_array_empty(const godot_packed_vector2i_array *p_self); +godot_bool GDAPI godot_packed_vector2i_array_is_empty(const godot_packed_vector2i_array *p_self); void GDAPI godot_packed_vector2i_array_destroy(godot_packed_vector2i_array *p_self); @@ -483,7 +483,7 @@ godot_vector3 GDAPI godot_packed_vector3_array_get(const godot_packed_vector3_ar godot_int GDAPI godot_packed_vector3_array_size(const godot_packed_vector3_array *p_self); -godot_bool GDAPI godot_packed_vector3_array_empty(const godot_packed_vector3_array *p_self); +godot_bool GDAPI godot_packed_vector3_array_is_empty(const godot_packed_vector3_array *p_self); void GDAPI godot_packed_vector3_array_destroy(godot_packed_vector3_array *p_self); @@ -519,7 +519,7 @@ godot_color GDAPI godot_packed_color_array_get(const godot_packed_color_array *p godot_int GDAPI godot_packed_color_array_size(const godot_packed_color_array *p_self); -godot_bool GDAPI godot_packed_color_array_empty(const godot_packed_color_array *p_self); +godot_bool GDAPI godot_packed_color_array_is_empty(const godot_packed_color_array *p_self); void GDAPI godot_packed_color_array_destroy(godot_packed_color_array *p_self); diff --git a/modules/gdnative/include/gdnative/rect2.h b/modules/gdnative/include/gdnative/rect2.h index f317afc9da..5bf546e8c9 100644 --- a/modules/gdnative/include/gdnative/rect2.h +++ b/modules/gdnative/include/gdnative/rect2.h @@ -80,7 +80,7 @@ godot_bool GDAPI godot_rect2_encloses(const godot_rect2 *p_self, const godot_rec godot_bool GDAPI godot_rect2_has_no_area(const godot_rect2 *p_self); -godot_rect2 GDAPI godot_rect2_clip(const godot_rect2 *p_self, const godot_rect2 *p_b); +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); @@ -90,7 +90,7 @@ godot_rect2 GDAPI godot_rect2_grow(const godot_rect2 *p_self, const godot_real p 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_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); @@ -123,7 +123,7 @@ godot_bool GDAPI godot_rect2i_encloses(const godot_rect2i *p_self, const godot_r godot_bool GDAPI godot_rect2i_has_no_area(const godot_rect2i *p_self); -godot_rect2i GDAPI godot_rect2i_clip(const godot_rect2i *p_self, const godot_rect2i *p_b); +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); @@ -133,7 +133,7 @@ godot_rect2i GDAPI godot_rect2i_grow(const godot_rect2i *p_self, const godot_int 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_margin(const godot_rect2i *p_self, const godot_int p_margin, const godot_int p_by); +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); diff --git a/modules/gdnative/include/gdnative/string.h b/modules/gdnative/include/gdnative/string.h index 6043351e84..101e119d4d 100644 --- a/modules/gdnative/include/gdnative/string.h +++ b/modules/gdnative/include/gdnative/string.h @@ -256,7 +256,7 @@ 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_empty(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); diff --git a/modules/gdnative/include/gdnative/vector2.h b/modules/gdnative/include/gdnative/vector2.h index 35b02c5a75..0585ba4a78 100644 --- a/modules/gdnative/include/gdnative/vector2.h +++ b/modules/gdnative/include/gdnative/vector2.h @@ -102,7 +102,7 @@ godot_vector2 GDAPI godot_vector2_move_toward(const godot_vector2 *p_self, const godot_vector2 GDAPI godot_vector2_rotated(const godot_vector2 *p_self, const godot_real p_phi); -godot_vector2 GDAPI godot_vector2_tangent(const godot_vector2 *p_self); +godot_vector2 GDAPI godot_vector2_orthogonal(const godot_vector2 *p_self); godot_vector2 GDAPI godot_vector2_floor(const godot_vector2 *p_self); diff --git a/modules/gdnative/include/text/godot_text.h b/modules/gdnative/include/text/godot_text.h index 2eac6adfb5..200a822e6d 100644 --- a/modules/gdnative/include/text/godot_text.h +++ b/modules/gdnative/include/text/godot_text.h @@ -82,6 +82,9 @@ typedef struct { void (*font_set_antialiased)(void *, godot_rid *, bool); bool (*font_get_antialiased)(void *, godot_rid *); godot_dictionary (*font_get_feature_list)(void *, godot_rid *); + godot_dictionary (*font_get_variation_list)(void *, godot_rid *); + void (*font_set_variation)(void *, godot_rid *, const godot_string *, double); + double (*font_get_variation)(void *, godot_rid *, const godot_string *); void (*font_set_distance_field_hint)(void *, godot_rid *, bool); bool (*font_get_distance_field_hint)(void *, godot_rid *); void (*font_set_hinting)(void *, godot_rid *, godot_int); @@ -215,7 +218,7 @@ godot_glyph GDAPI godot_packed_glyph_array_get(const godot_packed_glyph_array *p godot_int GDAPI godot_packed_glyph_array_size(const godot_packed_glyph_array *p_self); -godot_bool GDAPI godot_packed_glyph_array_empty(const godot_packed_glyph_array *p_self); +godot_bool GDAPI godot_packed_glyph_array_is_empty(const godot_packed_glyph_array *p_self); void GDAPI godot_packed_glyph_array_destroy(godot_packed_glyph_array *p_self); diff --git a/modules/gdnative/nativescript/api_generator.cpp b/modules/gdnative/nativescript/api_generator.cpp index 6f2f9bfea9..c10de8d5a0 100644 --- a/modules/gdnative/nativescript/api_generator.cpp +++ b/modules/gdnative/nativescript/api_generator.cpp @@ -295,7 +295,7 @@ List<ClassAPI> generate_c_api_classes() { property_api.index = ClassDB::get_property_index(class_name, p->get().name); - if (!property_api.setter.empty() || !property_api.getter.empty()) { + if (!property_api.setter.is_empty() || !property_api.getter.is_empty()) { class_api.properties.push_back(property_api); } } diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp index 0939cfd06a..ad2ae6fd4a 100644 --- a/modules/gdnative/nativescript/nativescript.cpp +++ b/modules/gdnative/nativescript/nativescript.cpp @@ -717,7 +717,7 @@ String NativeScript::get_property_documentation(const StringName &p_path) const } Variant NativeScript::_new(const Variant **p_args, int p_argcount, Callable::CallError &r_error) { - if (lib_path.empty() || class_name.empty() || library.is_null()) { + if (lib_path.is_empty() || class_name.is_empty() || library.is_null()) { r_error.error = Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL; return Variant(); } @@ -1800,7 +1800,7 @@ bool NativeScriptLanguage::handles_global_class_type(const String &p_type) const } String NativeScriptLanguage::get_global_class_name(const String &p_path, String *r_base_type, String *r_icon_path) const { - if (!p_path.empty()) { + if (!p_path.is_empty()) { Ref<NativeScript> script = ResourceLoader::load(p_path, "NativeScript"); if (script.is_valid()) { if (r_base_type) { diff --git a/modules/gdnative/pluginscript/pluginscript_language.cpp b/modules/gdnative/pluginscript/pluginscript_language.cpp index df685e716f..93e3181972 100644 --- a/modules/gdnative/pluginscript/pluginscript_language.cpp +++ b/modules/gdnative/pluginscript/pluginscript_language.cpp @@ -407,7 +407,7 @@ bool PluginScriptLanguage::handles_global_class_type(const String &p_type) const } String PluginScriptLanguage::get_global_class_name(const String &p_path, String *r_base_type, String *r_icon_path) const { - if (!p_path.empty()) { + if (!p_path.is_empty()) { Ref<PluginScript> script = ResourceLoader::load(p_path, "PluginScript"); if (script.is_valid()) { if (r_base_type) { diff --git a/modules/gdnative/tests/test_string.h b/modules/gdnative/tests/test_string.h index 2b1aa5bf28..7eccc74987 100644 --- a/modules/gdnative/tests/test_string.h +++ b/modules/gdnative/tests/test_string.h @@ -259,11 +259,11 @@ TEST_CASE("[GDNative String] Testing for empty string") { godot_string s; godot_string_new_with_latin1_chars(&s, "Mellon"); - CHECK(!godot_string_empty(&s)); + CHECK(!godot_string_is_empty(&s)); godot_string_destroy(&s); godot_string_new_with_latin1_chars(&s, ""); - CHECK(godot_string_empty(&s)); + CHECK(godot_string_is_empty(&s)); godot_string_destroy(&s); } diff --git a/modules/gdnative/text/text_server_gdnative.cpp b/modules/gdnative/text/text_server_gdnative.cpp index 68624260a6..baaa3c0e21 100644 --- a/modules/gdnative/text/text_server_gdnative.cpp +++ b/modules/gdnative/text/text_server_gdnative.cpp @@ -148,6 +148,24 @@ bool TextServerGDNative::font_get_antialiased(RID p_font) const { return interface->font_get_antialiased(data, (godot_rid *)&p_font); } +Dictionary TextServerGDNative::font_get_variation_list(RID p_font) const { + ERR_FAIL_COND_V(interface == nullptr, Dictionary()); + godot_dictionary result = interface->font_get_variation_list(data, (godot_rid *)&p_font); + Dictionary info = *(Dictionary *)&result; + godot_dictionary_destroy(&result); + + return info; +} + +void TextServerGDNative::font_set_variation(RID p_font, const String &p_name, double p_value) { + ERR_FAIL_COND(interface == nullptr); + interface->font_set_variation(data, (godot_rid *)&p_font, (godot_string *)&p_name, p_value); +} + +double TextServerGDNative::font_get_variation(RID p_font, const String &p_name) const { + return interface->font_get_variation(data, (godot_rid *)&p_font, (godot_string *)&p_name); +} + void TextServerGDNative::font_set_hinting(RID p_font, TextServer::Hinting p_hinting) { ERR_FAIL_COND(interface == nullptr); interface->font_set_hinting(data, (godot_rid *)&p_font, (godot_int)p_hinting); @@ -821,9 +839,9 @@ godot_int GDAPI godot_packed_glyph_array_size(const godot_packed_glyph_array *p_ return self->size(); } -godot_bool GDAPI godot_packed_glyph_array_empty(const godot_packed_glyph_array *p_self) { +godot_bool GDAPI godot_packed_glyph_array_is_empty(const godot_packed_glyph_array *p_self) { const Vector<TextServer::Glyph> *self = (const Vector<TextServer::Glyph> *)p_self; - return self->empty(); + return self->is_empty(); } void GDAPI godot_packed_glyph_array_destroy(godot_packed_glyph_array *p_self) { diff --git a/modules/gdnative/text/text_server_gdnative.h b/modules/gdnative/text/text_server_gdnative.h index 0196120c00..959302aaf4 100644 --- a/modules/gdnative/text/text_server_gdnative.h +++ b/modules/gdnative/text/text_server_gdnative.h @@ -76,6 +76,10 @@ public: virtual bool font_get_antialiased(RID p_font) const override; virtual Dictionary font_get_feature_list(RID p_font) const override; + virtual Dictionary font_get_variation_list(RID p_font) const override; + + virtual void font_set_variation(RID p_font, const String &p_name, double p_value) override; + virtual double font_get_variation(RID p_font, const String &p_name) const override; virtual void font_set_hinting(RID p_font, Hinting p_hinting) override; virtual Hinting font_get_hinting(RID p_font) const override; diff --git a/modules/gdnative/xr/xr_interface_gdnative.cpp b/modules/gdnative/xr/xr_interface_gdnative.cpp index d03fc33935..d1d575db62 100644 --- a/modules/gdnative/xr/xr_interface_gdnative.cpp +++ b/modules/gdnative/xr/xr_interface_gdnative.cpp @@ -302,12 +302,12 @@ godot_int GDAPI godot_xr_add_controller(char *p_device_name, godot_int p_hand, g ERR_FAIL_NULL_V(input, 0); XRPositionalTracker *new_tracker = memnew(XRPositionalTracker); - new_tracker->set_name(p_device_name); - new_tracker->set_type(XRServer::TRACKER_CONTROLLER); + new_tracker->set_tracker_name(p_device_name); + new_tracker->set_tracker_type(XRServer::TRACKER_CONTROLLER); if (p_hand == 1) { - new_tracker->set_hand(XRPositionalTracker::TRACKER_LEFT_HAND); + new_tracker->set_tracker_hand(XRPositionalTracker::TRACKER_HAND_LEFT); } else if (p_hand == 2) { - new_tracker->set_hand(XRPositionalTracker::TRACKER_RIGHT_HAND); + new_tracker->set_tracker_hand(XRPositionalTracker::TRACKER_HAND_RIGHT); } // also register as joystick... |