From a37eb88c5b8086e32f46e780cce75c5c94f3b175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Fri, 24 Feb 2023 08:45:21 +0100 Subject: Lift restriction that resource load thread requester has to be the initiator (cherry picked from commit c51229491d9fe5cba7e4a51821d10dcef7986e1a) --- core/io/resource_loader.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index d0448e86fc..a46fac4e7a 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -310,12 +310,6 @@ Error ResourceLoader::load_threaded_request(const String &p_path, const String & thread_load_mutex->unlock(); ERR_FAIL_V_MSG(ERR_INVALID_PARAMETER, "There is no thread loading source resource '" + p_source_resource + "'."); } - //must be loading from this thread - if (thread_load_tasks[p_source_resource].loader_id != Thread::get_caller_id()) { - thread_load_mutex->unlock(); - ERR_FAIL_V_MSG(ERR_INVALID_PARAMETER, "Threading loading resource'" + local_path + " failed: Source specified: '" + p_source_resource + "' but was not called by it."); - } - //must not be already added as s sub tasks if (thread_load_tasks[p_source_resource].sub_tasks.has(local_path)) { thread_load_mutex->unlock(); -- cgit v1.2.3 From 08b825396f21d6fd9fcf0f68d0afda6e5285d704 Mon Sep 17 00:00:00 2001 From: "fuzzy@notepc" <70929713+komugi1211s@users.noreply.github.com> Date: Sat, 8 Apr 2023 13:30:11 +0900 Subject: Fix #75790, where creating Ceil(Vector2) node in Visual Shader Editor crashes engine due to index out of bounds. (cherry picked from commit c6a45f10315d16a3434ef8ba5abb6e86c42b1e56) --- editor/plugins/visual_shader_editor_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index af761a2cea..a563d17c57 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -5931,7 +5931,7 @@ VisualShaderEditor::VisualShaderEditor() { add_options.push_back(AddOption("ATanH", "Vector/Functions", "VisualShaderNodeVectorFunc", TTR("Returns the inverse hyperbolic tangent of the parameter."), { VisualShaderNodeVectorFunc::FUNC_ATANH, VisualShaderNodeVectorFunc::OP_TYPE_VECTOR_2D }, VisualShaderNode::PORT_TYPE_VECTOR_2D)); add_options.push_back(AddOption("ATanH", "Vector/Functions", "VisualShaderNodeVectorFunc", TTR("Returns the inverse hyperbolic tangent of the parameter."), { VisualShaderNodeVectorFunc::FUNC_ATANH, VisualShaderNodeVectorFunc::OP_TYPE_VECTOR_3D }, VisualShaderNode::PORT_TYPE_VECTOR_3D)); add_options.push_back(AddOption("ATanH", "Vector/Functions", "VisualShaderNodeVectorFunc", TTR("Returns the inverse hyperbolic tangent of the parameter."), { VisualShaderNodeVectorFunc::FUNC_ATANH, VisualShaderNodeVectorFunc::OP_TYPE_VECTOR_4D }, VisualShaderNode::PORT_TYPE_VECTOR_4D)); - add_options.push_back(AddOption("Ceil", "Vector/Functions", "VisualShaderNodeVectorFunc", TTR("Finds the nearest integer that is greater than or equal to the parameter."), { VisualShaderNodeVectorFunc::FUNC_CEIL }, VisualShaderNode::PORT_TYPE_VECTOR_2D)); + add_options.push_back(AddOption("Ceil", "Vector/Functions", "VisualShaderNodeVectorFunc", TTR("Finds the nearest integer that is greater than or equal to the parameter."), { VisualShaderNodeVectorFunc::FUNC_CEIL, VisualShaderNodeVectorFunc::OP_TYPE_VECTOR_2D }, VisualShaderNode::PORT_TYPE_VECTOR_2D)); add_options.push_back(AddOption("Ceil", "Vector/Functions", "VisualShaderNodeVectorFunc", TTR("Finds the nearest integer that is greater than or equal to the parameter."), { VisualShaderNodeVectorFunc::FUNC_CEIL, VisualShaderNodeVectorFunc::OP_TYPE_VECTOR_3D }, VisualShaderNode::PORT_TYPE_VECTOR_3D)); add_options.push_back(AddOption("Ceil", "Vector/Functions", "VisualShaderNodeVectorFunc", TTR("Finds the nearest integer that is greater than or equal to the parameter."), { VisualShaderNodeVectorFunc::FUNC_CEIL, VisualShaderNodeVectorFunc::OP_TYPE_VECTOR_4D }, VisualShaderNode::PORT_TYPE_VECTOR_4D)); add_options.push_back(AddOption("Clamp", "Vector/Functions", "VisualShaderNodeClamp", TTR("Constrains a value to lie between two further values."), { VisualShaderNodeClamp::OP_TYPE_VECTOR_2D }, VisualShaderNode::PORT_TYPE_VECTOR_2D)); -- cgit v1.2.3 From 4616de0c5d6bcf4abe637e515eae2064e8f054a5 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 8 Apr 2023 18:21:08 +0200 Subject: Fix CI build error Fixes potential use of uninitialized variable. (cherry picked from commit 37362202a48f6ee731e14e47579979509bc23017) --- scene/gui/code_edit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/gui/code_edit.cpp b/scene/gui/code_edit.cpp index 91c4fa3761..ca5e9b401c 100644 --- a/scene/gui/code_edit.cpp +++ b/scene/gui/code_edit.cpp @@ -1968,7 +1968,7 @@ void CodeEdit::confirm_code_completion(bool p_replace) { return; } - char32_t caret_last_completion_char; + char32_t caret_last_completion_char = 0; begin_complex_operation(); Vector caret_edit_order = get_caret_index_edit_order(); for (const int &i : caret_edit_order) { -- cgit v1.2.3 From deb22e2381122cbd528f7deb01b6ea72d88d2d5e Mon Sep 17 00:00:00 2001 From: Ricardo Buring Date: Sat, 8 Apr 2023 20:37:12 +0200 Subject: Fix typo bug in convex-convex separating axis test (cherry picked from commit d7aed57b60a06a46a8495b5c605c078fe72a220b) --- servers/physics_3d/godot_collision_solver_3d_sat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servers/physics_3d/godot_collision_solver_3d_sat.cpp b/servers/physics_3d/godot_collision_solver_3d_sat.cpp index 2cb29b3dd0..92a4d47cd3 100644 --- a/servers/physics_3d/godot_collision_solver_3d_sat.cpp +++ b/servers/physics_3d/godot_collision_solver_3d_sat.cpp @@ -2065,7 +2065,7 @@ static void _collision_convex_polygon_convex_polygon(const GodotShape3D *p_a, co int vertex_count_B = mesh_B.vertices.size(); // Precalculating this makes the transforms faster. - Basis a_xform_normal = p_transform_b.basis.inverse().transposed(); + Basis a_xform_normal = p_transform_a.basis.inverse().transposed(); // faces of A for (int i = 0; i < face_count_A; i++) { -- cgit v1.2.3 From d0c50d820be88882161093b76846e0a9995b4e0a Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Sat, 8 Apr 2023 16:31:25 +0800 Subject: Fix connect signal dialog not allowing Unicode method name (cherry picked from commit 936c9e83b4db06215554ae6f6e888324655048d8) --- editor/connections_dialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index befe84f311..fc7a9b05d3 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -119,7 +119,7 @@ void ConnectDialog::ok_pressed() { return; } - if (!method_name.strip_edges().is_valid_identifier()) { + if (!TS->is_valid_identifier(method_name.strip_edges())) { error->set_text(TTR("Method name must be a valid identifier.")); error->popup_centered(); return; @@ -228,7 +228,7 @@ StringName ConnectDialog::generate_method_callback_name(Node *p_source, String p String node_name = p_source->get_name(); for (int i = 0; i < node_name.length(); i++) { // TODO: Regex filter may be cleaner. char32_t c = node_name[i]; - if (!is_ascii_identifier_char(c)) { + if ((i == 0 && !is_unicode_identifier_start(c)) || (i > 0 && !is_unicode_identifier_continue(c))) { if (c == ' ') { // Replace spaces with underlines. c = '_'; -- cgit v1.2.3 From 8c372f4109f1bcf75a02923aca4292e2bee38b3a Mon Sep 17 00:00:00 2001 From: kobewi Date: Sun, 9 Apr 2023 09:40:14 +0200 Subject: Fix method dialog label (cherry picked from commit c399d4f26c6f0836d90455defc7f2cee1d1b9678) --- editor/connections_dialog.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index fc7a9b05d3..ddbbdb1c6a 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -338,11 +338,6 @@ void ConnectDialog::_update_method_tree() { // If a script is attached, get methods from it. ScriptInstance *si = target->get_script_instance(); if (si) { - TreeItem *si_item = method_tree->create_item(root_item); - si_item->set_text(0, TTR("Attached Script")); - si_item->set_icon(0, get_theme_icon(SNAME("Script"), SNAME("EditorIcons"))); - si_item->set_selectable(0, false); - if (si->get_script()->is_built_in()) { si->get_script()->reload(); } @@ -350,9 +345,12 @@ void ConnectDialog::_update_method_tree() { si->get_method_list(&methods); methods = _filter_method_list(methods, signal_info, search_string); - if (methods.is_empty()) { - si_item->set_custom_color(0, disabled_color); - } else { + if (!methods.is_empty()) { + TreeItem *si_item = method_tree->create_item(root_item); + si_item->set_text(0, TTR("Attached Script")); + si_item->set_icon(0, get_theme_icon(SNAME("Script"), SNAME("EditorIcons"))); + si_item->set_selectable(0, false); + _create_method_tree_items(methods, si_item); } } @@ -687,8 +685,10 @@ ConnectDialog::ConnectDialog() { method_tree->connect("item_activated", callable_mp((Window *)method_popup, &Window::hide)); empty_tree_label = memnew(Label(TTR("No method found matching given filters."))); - method_tree->add_child(empty_tree_label); - empty_tree_label->set_anchors_and_offsets_preset(Control::PRESET_CENTER); + method_popup->add_child(empty_tree_label); + empty_tree_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); + empty_tree_label->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER); + empty_tree_label->set_autowrap_mode(TextServer::AUTOWRAP_WORD); script_methods_only = memnew(CheckButton(TTR("Script Methods Only"))); method_vbc->add_child(script_methods_only); -- cgit v1.2.3 From df5df1191680d2602583a3c5925466e8f2a0fd91 Mon Sep 17 00:00:00 2001 From: Yuri Sizov Date: Mon, 10 Apr 2023 16:18:46 +0200 Subject: Always cache parent visibility in CanvasItem (cherry picked from commit fd6a743823932639ba30e54d7e65ccd42192d88d) --- scene/main/canvas_item.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scene/main/canvas_item.cpp b/scene/main/canvas_item.cpp index 72fb838732..419e5d5c06 100644 --- a/scene/main/canvas_item.cpp +++ b/scene/main/canvas_item.cpp @@ -341,9 +341,7 @@ void CanvasItem::_notification(int p_what) { } void CanvasItem::_window_visibility_changed() { - if (visible) { - _propagate_visibility_changed(window->is_visible()); - } + _propagate_visibility_changed(window->is_visible()); } void CanvasItem::queue_redraw() { -- cgit v1.2.3 From ce7fd66896c950f8532198b6754ab5d65e7ce231 Mon Sep 17 00:00:00 2001 From: Dimitri A Date: Mon, 10 Apr 2023 15:13:20 +0200 Subject: docs/FileDialog: Use clickable references This replaces two [code][/code] blocks with clickable refs to [enum Access] and [member file_mode] respectively. (cherry picked from commit a5778da55bbf777abe1490edbc82bb05c9718377) --- doc/classes/FileDialog.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/classes/FileDialog.xml b/doc/classes/FileDialog.xml index af04956e61..407d4b2630 100644 --- a/doc/classes/FileDialog.xml +++ b/doc/classes/FileDialog.xml @@ -54,7 +54,7 @@ - The file system access scope. See enum [code]Access[/code] constants. + The file system access scope. See [enum Access] constants. [b]Warning:[/b] Currently, in sandboxed environments such as Web builds or sandboxed macOS apps, FileDialog cannot access the host file system. See [url=https://github.com/godotengine/godot-proposals/issues/1123]godot-proposals#1123[/url]. @@ -74,7 +74,7 @@ The available file type filters. For example, this shows only [code].png[/code] and [code].gd[/code] files: [code]set_filters(PackedStringArray(["*.png ; PNG Images","*.gd ; GDScript Files"]))[/code]. Multiple file types can also be specified in a single filter. [code]"*.png, *.jpg, *.jpeg ; Supported Images"[/code] will show both PNG and JPEG files when selected. - If [code]true[/code], changing the [code]Mode[/code] property will set the window title accordingly (e.g. setting mode to [constant FILE_MODE_OPEN_FILE] will change the window title to "Open a File"). + If [code]true[/code], changing the [member file_mode] property will set the window title accordingly (e.g. setting [member file_mode] to [constant FILE_MODE_OPEN_FILE] will change the window title to "Open a File"). If non-empty, the given sub-folder will be "root" of this [FileDialog], i.e. user won't be able to go to its parent directory. -- cgit v1.2.3 From 9902d07966ee5a7c804107a440585ade324c1d05 Mon Sep 17 00:00:00 2001 From: Ninni Pipping Date: Mon, 3 Apr 2023 21:12:13 +0200 Subject: Document how to make custom min/max for Array (cherry picked from commit 96ab31a7117c110da025a39390bdecf36892e7fa) --- doc/classes/Array.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index 86f8f357f8..fb35fc7a98 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -441,12 +441,23 @@ Returns the maximum value contained in the array if all elements are of comparable types. If the elements can't be compared, [code]null[/code] is returned. + To find the maximum value using a custom comparator, you can use [method reduce]. In this example every array element is checked and the first maximum value is returned: + [codeblock] + func _ready(): + var arr = [Vector2(0, 1), Vector2(2, 0), Vector2(1, 1), Vector2(1, 0), Vector2(0, 2)] + # In this example we compare the lengths. + print(arr.reduce(func(max, val): return val if is_length_greater(val, max) else max)) + + func is_length_greater(a, b): + return a.length() > b.length() + [/codeblock] Returns the minimum value contained in the array if all elements are of comparable types. If the elements can't be compared, [code]null[/code] is returned. + See also [method max] for an example of using a custom comparator. -- cgit v1.2.3 From 51fdbf6ac74ae5611b49fb8c81364e8aecb310a6 Mon Sep 17 00:00:00 2001 From: kobewi Date: Mon, 10 Apr 2023 17:04:47 +0200 Subject: Adjust size of some dialogs (cherry picked from commit 71011e085554c9113e5824f82fd0e505c339b3a8) --- editor/editor_node.cpp | 6 +++++- editor/plugins/script_editor_plugin.cpp | 2 +- editor/project_manager.cpp | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 0e17c72d90..359d17b277 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -1145,7 +1145,7 @@ void EditorNode::_scan_external_changes() { } if (need_reload) { - disk_changed->call_deferred(SNAME("popup_centered_ratio"), 0.5); + disk_changed->call_deferred(SNAME("popup_centered_ratio"), 0.3); } } @@ -2761,6 +2761,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { } } } + save_confirmation->reset_size(); save_confirmation->popup_centered(); break; } @@ -3074,6 +3075,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { save_confirmation->set_ok_button_text(TTR("Save & Quit")); save_confirmation->set_text((p_option == FILE_QUIT ? TTR("Save changes to the following scene(s) before quitting?") : TTR("Save changes to the following scene(s) before opening Project Manager?")) + unsaved_scenes); } + save_confirmation->reset_size(); save_confirmation->popup_centered(); } } @@ -5534,6 +5536,7 @@ void EditorNode::_scene_tab_closed(int p_tab, int option) { if (unsaved) { save_confirmation->set_ok_button_text(TTR("Save & Close")); save_confirmation->set_text(vformat(TTR("Save changes to '%s' before closing?"), !scene->get_scene_file_path().is_empty() ? scene->get_scene_file_path() : "unsaved scene")); + save_confirmation->reset_size(); save_confirmation->popup_centered(); } else { _discard_changes(); @@ -7830,6 +7833,7 @@ EditorNode::EditorNode() { save_confirmation = memnew(ConfirmationDialog); save_confirmation->add_button(TTR("Don't Save"), DisplayServer::get_singleton()->get_swap_cancel_ok(), "discard"); gui_base->add_child(save_confirmation); + save_confirmation->set_min_size(Vector2(450.0 * EDSCALE, 0)); save_confirmation->connect("confirmed", callable_mp(this, &EditorNode::_menu_confirm_current)); save_confirmation->connect("custom_action", callable_mp(this, &EditorNode::_discard_changes)); diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index a749e6de41..46218869b3 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -1060,7 +1060,7 @@ bool ScriptEditor::_test_script_times_on_disk(Ref p_for_script) { script_editor->reload_scripts(); need_reload = false; } else { - disk_changed->call_deferred(SNAME("popup_centered_ratio"), 0.5); + disk_changed->call_deferred(SNAME("popup_centered_ratio"), 0.3); } } diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 5ae90224a4..75773edc86 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -2256,7 +2256,7 @@ void ProjectManager::_open_selected_projects_ask() { return; } - const Size2i popup_min_size = Size2i(600.0 * EDSCALE, 400.0 * EDSCALE); + const Size2i popup_min_size = Size2i(600.0 * EDSCALE, 0); if (selected_list.size() > 1) { multi_open_ask->set_text(vformat(TTR("You requested to open %d projects in parallel. Do you confirm?\nNote that usual checks for engine version compatibility will be bypassed."), selected_list.size())); @@ -2341,7 +2341,7 @@ void ProjectManager::_open_selected_projects_ask() { void ProjectManager::_full_convert_button_pressed() { ask_update_settings->hide(); - ask_full_convert_dialog->popup_centered(Size2i(600.0 * EDSCALE, 400.0 * EDSCALE)); + ask_full_convert_dialog->popup_centered(Size2i(600.0 * EDSCALE, 0)); ask_full_convert_dialog->get_cancel_button()->grab_focus(); } -- cgit v1.2.3 From a6e15e2f1563543b375ae28e3490e646c47a7ca3 Mon Sep 17 00:00:00 2001 From: mara Date: Mon, 13 Mar 2023 22:58:27 +0100 Subject: Change to_utf8 to to_utf8_buffer and to_ascii to to_ascii_buffer in remaining docs The method `to_utf8` doesn't exist in Godot 4, but is still mentioned in the documentation in some places. Replace it with the new name `to_utf8_buffer`. Same for ascii. Same for C#. (cherry picked from commit 57dca93718f34573713de2fd09315f42bcd26fff) --- doc/classes/AESContext.xml | 32 ++++++++++++++++---------------- doc/classes/Crypto.xml | 8 ++++---- doc/classes/DTLSServer.xml | 8 ++++---- doc/classes/HMACContext.xml | 12 ++++++------ doc/classes/PacketPeerUDP.xml | 4 ++-- doc/classes/StreamPeer.xml | 8 ++++---- doc/classes/UDPServer.xml | 4 ++-- 7 files changed, 38 insertions(+), 38 deletions(-) diff --git a/doc/classes/AESContext.xml b/doc/classes/AESContext.xml index 747968ea91..bbea8535bb 100644 --- a/doc/classes/AESContext.xml +++ b/doc/classes/AESContext.xml @@ -15,27 +15,27 @@ var key = "My secret key!!!" # Key must be either 16 or 32 bytes. var data = "My secret text!!" # Data size must be multiple of 16 bytes, apply padding if needed. # Encrypt ECB - aes.start(AESContext.MODE_ECB_ENCRYPT, key.to_utf8()) - var encrypted = aes.update(data.to_utf8()) + aes.start(AESContext.MODE_ECB_ENCRYPT, key.to_utf8_buffer()) + var encrypted = aes.update(data.to_utf8_buffer()) aes.finish() # Decrypt ECB - aes.start(AESContext.MODE_ECB_DECRYPT, key.to_utf8()) + aes.start(AESContext.MODE_ECB_DECRYPT, key.to_utf8_buffer()) var decrypted = aes.update(encrypted) aes.finish() # Check ECB - assert(decrypted == data.to_utf8()) + assert(decrypted == data.to_utf8_buffer()) var iv = "My secret iv!!!!" # IV must be of exactly 16 bytes. # Encrypt CBC - aes.start(AESContext.MODE_CBC_ENCRYPT, key.to_utf8(), iv.to_utf8()) - encrypted = aes.update(data.to_utf8()) + aes.start(AESContext.MODE_CBC_ENCRYPT, key.to_utf8_buffer(), iv.to_utf8_buffer()) + encrypted = aes.update(data.to_utf8_buffer()) aes.finish() # Decrypt CBC - aes.start(AESContext.MODE_CBC_DECRYPT, key.to_utf8(), iv.to_utf8()) + aes.start(AESContext.MODE_CBC_DECRYPT, key.to_utf8_buffer(), iv.to_utf8_buffer()) decrypted = aes.update(encrypted) aes.finish() # Check CBC - assert(decrypted == data.to_utf8()) + assert(decrypted == data.to_utf8_buffer()) [/gdscript] [csharp] using Godot; @@ -50,27 +50,27 @@ string key = "My secret key!!!"; // Key must be either 16 or 32 bytes. string data = "My secret text!!"; // Data size must be multiple of 16 bytes, apply padding if needed. // Encrypt ECB - _aes.Start(AesContext.Mode.EcbEncrypt, key.ToUtf8()); - byte[] encrypted = _aes.Update(data.ToUtf8()); + _aes.Start(AesContext.Mode.EcbEncrypt, key.ToUtf8Buffer()); + byte[] encrypted = _aes.Update(data.ToUtf8Buffer()); _aes.Finish(); // Decrypt ECB - _aes.Start(AesContext.Mode.EcbDecrypt, key.ToUtf8()); + _aes.Start(AesContext.Mode.EcbDecrypt, key.ToUtf8Buffer()); byte[] decrypted = _aes.Update(encrypted); _aes.Finish(); // Check ECB - Debug.Assert(decrypted == data.ToUtf8()); + Debug.Assert(decrypted == data.ToUtf8Buffer()); string iv = "My secret iv!!!!"; // IV must be of exactly 16 bytes. // Encrypt CBC - _aes.Start(AesContext.Mode.EcbEncrypt, key.ToUtf8(), iv.ToUtf8()); - encrypted = _aes.Update(data.ToUtf8()); + _aes.Start(AesContext.Mode.EcbEncrypt, key.ToUtf8Buffer(), iv.ToUtf8Buffer()); + encrypted = _aes.Update(data.ToUtf8Buffer()); _aes.Finish(); // Decrypt CBC - _aes.Start(AesContext.Mode.EcbDecrypt, key.ToUtf8(), iv.ToUtf8()); + _aes.Start(AesContext.Mode.EcbDecrypt, key.ToUtf8Buffer(), iv.ToUtf8Buffer()); decrypted = _aes.Update(encrypted); _aes.Finish(); // Check CBC - Debug.Assert(decrypted == data.ToUtf8()); + Debug.Assert(decrypted == data.ToUtf8Buffer()); } } [/csharp] diff --git a/doc/classes/Crypto.xml b/doc/classes/Crypto.xml index a7e7e756c6..7fbb89423d 100644 --- a/doc/classes/Crypto.xml +++ b/doc/classes/Crypto.xml @@ -24,7 +24,7 @@ cert.save("user://generated.crt") # Encryption var data = "Some data" - var encrypted = crypto.encrypt(key, data.to_utf8()) + var encrypted = crypto.encrypt(key, data.to_utf8_buffer()) # Decryption var decrypted = crypto.decrypt(key, encrypted) # Signing @@ -33,7 +33,7 @@ var verified = crypto.verify(HashingContext.HASH_SHA256, data.sha256_buffer(), signature, key) # Checks assert(verified) - assert(data.to_utf8() == decrypted) + assert(data.to_utf8_buffer() == decrypted) [/gdscript] [csharp] using Godot; @@ -56,7 +56,7 @@ _cert.Save("user://generated.crt"); // Encryption string data = "Some data"; - byte[] encrypted = _crypto.Encrypt(_key, data.ToUtf8()); + byte[] encrypted = _crypto.Encrypt(_key, data.ToUtf8Buffer()); // Decryption byte[] decrypted = _crypto.Decrypt(_key, encrypted); // Signing @@ -65,7 +65,7 @@ bool verified = _crypto.Verify(HashingContext.HashType.Sha256, Data.Sha256Buffer(), signature, _key); // Checks Debug.Assert(verified); - Debug.Assert(data.ToUtf8() == decrypted); + Debug.Assert(data.ToUtf8Buffer() == decrypted); } } [/csharp] diff --git a/doc/classes/DTLSServer.xml b/doc/classes/DTLSServer.xml index 3e91780095..8e85c12ad1 100644 --- a/doc/classes/DTLSServer.xml +++ b/doc/classes/DTLSServer.xml @@ -35,7 +35,7 @@ if p.get_status() == PacketPeerDTLS.STATUS_CONNECTED: while p.get_available_packet_count() > 0: print("Received message from client: %s" % p.get_packet().get_string_from_utf8()) - p.put_packet("Hello DTLS client".to_utf8()) + p.put_packet("Hello DTLS client".to_utf8_buffer()) [/gdscript] [csharp] // ServerNode.cs @@ -77,7 +77,7 @@ while (p.GetAvailablePacketCount() > 0) { GD.Print($"Received Message From Client: {p.GetPacket().GetStringFromUtf8()}"); - p.PutPacket("Hello DTLS Client".ToUtf8()); + p.PutPacket("Hello DTLS Client".ToUtf8Buffer()); } } } @@ -103,7 +103,7 @@ if dtls.get_status() == PacketPeerDTLS.STATUS_CONNECTED: if !connected: # Try to contact server - dtls.put_packet("The answer is... 42!".to_utf8()) + dtls.put_packet("The answer is... 42!".to_utf8_buffer()) while dtls.get_available_packet_count() > 0: print("Connected: %s" % dtls.get_packet().get_string_from_utf8()) connected = true @@ -133,7 +133,7 @@ if (!_connected) { // Try to contact server - _dtls.PutPacket("The Answer Is..42!".ToUtf8()); + _dtls.PutPacket("The Answer Is..42!".ToUtf8Buffer()); } while (_dtls.GetAvailablePacketCount() > 0) { diff --git a/doc/classes/HMACContext.xml b/doc/classes/HMACContext.xml index fbdc6b5e64..7db6a398dc 100644 --- a/doc/classes/HMACContext.xml +++ b/doc/classes/HMACContext.xml @@ -11,11 +11,11 @@ var ctx = HMACContext.new() func _ready(): - var key = "supersecret".to_utf8() + var key = "supersecret".to_utf8_buffer() var err = ctx.start(HashingContext.HASH_SHA256, key) assert(err == OK) - var msg1 = "this is ".to_utf8() - var msg2 = "super duper secret".to_utf8() + var msg1 = "this is ".to_utf8_buffer() + var msg2 = "super duper secret".to_utf8_buffer() err = ctx.update(msg1) assert(err == OK) err = ctx.update(msg2) @@ -34,11 +34,11 @@ public override void _Ready() { - byte[] key = "supersecret".ToUtf8(); + byte[] key = "supersecret".ToUtf8Buffer(); Error err = _ctx.Start(HashingContext.HashType.Sha256, key); Debug.Assert(err == Error.Ok); - byte[] msg1 = "this is ".ToUtf8(); - byte[] msg2 = "super duper secret".ToUtf8(); + byte[] msg1 = "this is ".ToUtf8Buffer(); + byte[] msg2 = "super duper secret".ToUtf8Buffer(); err = _ctx.Update(msg1); Debug.Assert(err == Error.Ok); err = _ctx.Update(msg2); diff --git a/doc/classes/PacketPeerUDP.xml b/doc/classes/PacketPeerUDP.xml index 9107937183..35ee04cfd8 100644 --- a/doc/classes/PacketPeerUDP.xml +++ b/doc/classes/PacketPeerUDP.xml @@ -112,7 +112,7 @@ socket = PacketPeerUDP.new() # Server socket.set_dest_address("127.0.0.1", 789) - socket.put_packet("Time to stop".to_ascii()) + socket.put_packet("Time to stop".to_ascii_buffer()) # Client while socket.wait() == OK: @@ -124,7 +124,7 @@ var socket = new PacketPeerUDP(); // Server socket.SetDestAddress("127.0.0.1", 789); - socket.PutPacket("Time to stop".ToAscii()); + socket.PutPacket("Time to stop".ToAsciiBuffer()); // Client while (socket.Wait() == OK) diff --git a/doc/classes/StreamPeer.xml b/doc/classes/StreamPeer.xml index 9a70690122..492efe5007 100644 --- a/doc/classes/StreamPeer.xml +++ b/doc/classes/StreamPeer.xml @@ -177,10 +177,10 @@ [b]Note:[/b] To put an ASCII string without prepending its size, you can use [method put_data]: [codeblocks] [gdscript] - put_data("Hello world".to_ascii()) + put_data("Hello world".to_ascii_buffer()) [/gdscript] [csharp] - PutData("Hello World".ToAscii()); + PutData("Hello World".ToAsciiBuffer()); [/csharp] [/codeblocks] @@ -221,10 +221,10 @@ [b]Note:[/b] To put an UTF-8 string without prepending its size, you can use [method put_data]: [codeblocks] [gdscript] - put_data("Hello world".to_utf8()) + put_data("Hello world".to_utf8_buffer()) [/gdscript] [csharp] - PutData("Hello World".ToUtf8()); + PutData("Hello World".ToUtf8Buffer()); [/csharp] [/codeblocks] diff --git a/doc/classes/UDPServer.xml b/doc/classes/UDPServer.xml index 60d1986bee..ccb6a67a0e 100644 --- a/doc/classes/UDPServer.xml +++ b/doc/classes/UDPServer.xml @@ -86,7 +86,7 @@ func _process(delta): if !connected: # Try to contact server - udp.put_packet("The answer is... 42!".to_utf8()) + udp.put_packet("The answer is... 42!".to_utf8_buffer()) if udp.get_available_packet_count() > 0: print("Connected: %s" % udp.get_packet().get_string_from_utf8()) connected = true @@ -110,7 +110,7 @@ if (!_connected) { // Try to contact server - _udp.PutPacket("The Answer Is..42!".ToUtf8()); + _udp.PutPacket("The Answer Is..42!".ToUtf8Buffer()); } if (_udp.GetAvailablePacketCount() > 0) { -- cgit v1.2.3 From e7f7de004465e274721bb6ec82f60424b21e0c95 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Fri, 7 Apr 2023 20:01:55 +0800 Subject: Set font sizes for various styles in editor output panel (cherry picked from commit 2c0db8222a2e9f882040e773f3b375510ebcccc5) --- editor/editor_log.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp index 296181f79d..4ee28c5c31 100644 --- a/editor/editor_log.cpp +++ b/editor/editor_log.cpp @@ -91,7 +91,12 @@ void EditorLog::_update_theme() { log->add_theme_font_override("mono_font", mono_font); } - log->add_theme_font_size_override("normal_font_size", get_theme_font_size(SNAME("output_source_size"), SNAME("EditorFonts"))); + const int font_size = get_theme_font_size(SNAME("output_source_size"), SNAME("EditorFonts")); + log->add_theme_font_size_override("normal_font_size", font_size); + log->add_theme_font_size_override("bold_font_size", font_size); + log->add_theme_font_size_override("italics_font_size", font_size); + log->add_theme_font_size_override("mono_font_size", font_size); + log->add_theme_color_override("selection_color", get_theme_color(SNAME("accent_color"), SNAME("Editor")) * Color(1, 1, 1, 0.4)); type_filter_map[MSG_TYPE_STD]->toggle_button->set_icon(get_theme_icon(SNAME("Popup"), SNAME("EditorIcons"))); -- cgit v1.2.3 From b5ff677381e2e846c0512fb41c5f4d4c2c8abd23 Mon Sep 17 00:00:00 2001 From: Ricardo Subtil Date: Sun, 9 Apr 2023 12:36:01 +0100 Subject: Poll LSP/DAP clients for connection status updates (cherry picked from commit 4be4eeea3ac9d37fa1dc520a5bc8c57554448410) --- editor/debugger/debug_adapter/debug_adapter_protocol.cpp | 1 + modules/gdscript/language_server/gdscript_language_protocol.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/editor/debugger/debug_adapter/debug_adapter_protocol.cpp b/editor/debugger/debug_adapter/debug_adapter_protocol.cpp index e5f74762f6..4a95047a71 100644 --- a/editor/debugger/debug_adapter/debug_adapter_protocol.cpp +++ b/editor/debugger/debug_adapter/debug_adapter_protocol.cpp @@ -970,6 +970,7 @@ void DebugAdapterProtocol::poll() { List> to_delete; for (List>::Element *E = clients.front(); E; E = E->next()) { Ref peer = E->get(); + peer->connection->poll(); StreamPeerTCP::Status status = peer->connection->get_status(); if (status == StreamPeerTCP::STATUS_NONE || status == StreamPeerTCP::STATUS_ERROR) { to_delete.push_back(peer); diff --git a/modules/gdscript/language_server/gdscript_language_protocol.cpp b/modules/gdscript/language_server/gdscript_language_protocol.cpp index acd75f039a..0aa53c1dbe 100644 --- a/modules/gdscript/language_server/gdscript_language_protocol.cpp +++ b/modules/gdscript/language_server/gdscript_language_protocol.cpp @@ -237,6 +237,7 @@ void GDScriptLanguageProtocol::poll() { HashMap>::Iterator E = clients.begin(); while (E != clients.end()) { Ref peer = E->value; + peer->connection->poll(); StreamPeerTCP::Status status = peer->connection->get_status(); if (status == StreamPeerTCP::STATUS_NONE || status == StreamPeerTCP::STATUS_ERROR) { on_client_disconnected(E->key); -- cgit v1.2.3 From 7e482f420d19bb4318f3ca448b014177b4f6baa4 Mon Sep 17 00:00:00 2001 From: Koyper Date: Fri, 20 Jan 2023 09:55:27 -0600 Subject: Fixed RichTextLabel wrong selection offset in padded table cell. (cherry picked from commit 6f11cf7d31101bc9f4d3c5d644f90b231cd7ce4f) --- scene/gui/rich_text_label.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 68e12b9bb5..849f217b4a 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -1510,7 +1510,7 @@ float RichTextLabel::_find_click_in_line(ItemFrame *p_frame, int p_line, const V } if (crect.has_point(p_click)) { for (int j = 0; j < (int)frame->lines.size(); j++) { - _find_click_in_line(frame, j, rect.position + Vector2(0, frame->lines[j].offset.y), rect.size.x, p_click, &table_click_frame, &table_click_line, &table_click_item, &table_click_char, true, p_meta); + _find_click_in_line(frame, j, rect.position + Vector2(frame->padding.position.x, frame->lines[j].offset.y), rect.size.x, p_click, &table_click_frame, &table_click_line, &table_click_item, &table_click_char, true, p_meta); if (table_click_frame && table_click_item) { // Save cell detected cell hit data. table_range = Vector2i(INT32_MAX, 0); -- cgit v1.2.3 From effefe9feb1013312fdbe9cbae24828807cddd29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 11 Apr 2023 15:54:06 +0200 Subject: Windows TTS: Use HashMap instead of RBMap for ids And fixup includes in other implementations. (cherry picked from commit 92b9806dcc98bc5ffbee6a7ca11090a926df0b3a) --- platform/android/tts_android.h | 1 + platform/ios/tts_ios.h | 2 +- platform/linuxbsd/tts_linux.h | 2 +- platform/macos/tts_macos.h | 2 +- platform/windows/tts_windows.cpp | 22 ++++++++++++---------- platform/windows/tts_windows.h | 4 ++-- 6 files changed, 18 insertions(+), 15 deletions(-) diff --git a/platform/android/tts_android.h b/platform/android/tts_android.h index 8e3bfccbdb..8e00ac5000 100644 --- a/platform/android/tts_android.h +++ b/platform/android/tts_android.h @@ -32,6 +32,7 @@ #define TTS_ANDROID_H #include "core/string/ustring.h" +#include "core/templates/hash_map.h" #include "core/variant/array.h" #include "servers/display_server.h" diff --git a/platform/ios/tts_ios.h b/platform/ios/tts_ios.h index 2d104de8ae..7f9d30b22b 100644 --- a/platform/ios/tts_ios.h +++ b/platform/ios/tts_ios.h @@ -38,8 +38,8 @@ #endif #include "core/string/ustring.h" +#include "core/templates/hash_map.h" #include "core/templates/list.h" -#include "core/templates/rb_map.h" #include "core/variant/array.h" #include "servers/display_server.h" diff --git a/platform/linuxbsd/tts_linux.h b/platform/linuxbsd/tts_linux.h index 4134f8fa2f..651a64d9d6 100644 --- a/platform/linuxbsd/tts_linux.h +++ b/platform/linuxbsd/tts_linux.h @@ -34,8 +34,8 @@ #include "core/os/thread.h" #include "core/os/thread_safe.h" #include "core/string/ustring.h" +#include "core/templates/hash_map.h" #include "core/templates/list.h" -#include "core/templates/rb_map.h" #include "core/variant/array.h" #include "servers/display_server.h" diff --git a/platform/macos/tts_macos.h b/platform/macos/tts_macos.h index 2153a4c692..35205bd1ae 100644 --- a/platform/macos/tts_macos.h +++ b/platform/macos/tts_macos.h @@ -32,8 +32,8 @@ #define TTS_MACOS_H #include "core/string/ustring.h" +#include "core/templates/hash_map.h" #include "core/templates/list.h" -#include "core/templates/rb_map.h" #include "core/variant/array.h" #include "servers/display_server.h" diff --git a/platform/windows/tts_windows.cpp b/platform/windows/tts_windows.cpp index 3a143d0ecb..54ab93ee01 100644 --- a/platform/windows/tts_windows.cpp +++ b/platform/windows/tts_windows.cpp @@ -36,15 +36,16 @@ void __stdcall TTS_Windows::speech_event_callback(WPARAM wParam, LPARAM lParam) TTS_Windows *tts = TTS_Windows::get_singleton(); SPEVENT event; while (tts->synth->GetEvents(1, &event, NULL) == S_OK) { - if (tts->ids.has(event.ulStreamNum)) { + uint32_t stream_num = (uint32_t)event.ulStreamNum; + if (tts->ids.has(stream_num)) { if (event.eEventId == SPEI_START_INPUT_STREAM) { - DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_STARTED, tts->ids[event.ulStreamNum].id); + DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_STARTED, tts->ids[stream_num].id); } else if (event.eEventId == SPEI_END_INPUT_STREAM) { - DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_ENDED, tts->ids[event.ulStreamNum].id); - tts->ids.erase(event.ulStreamNum); + DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_ENDED, tts->ids[stream_num].id); + tts->ids.erase(stream_num); tts->_update_tts(); } else if (event.eEventId == SPEI_WORD_BOUNDARY) { - const Char16String &string = tts->ids[event.ulStreamNum].string; + const Char16String &string = tts->ids[stream_num].string; int pos = 0; for (int i = 0; i < MIN(event.lParam, string.length()); i++) { char16_t c = string[i]; @@ -53,7 +54,7 @@ void __stdcall TTS_Windows::speech_event_callback(WPARAM wParam, LPARAM lParam) } pos++; } - DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_BOUNDARY, tts->ids[event.ulStreamNum].id, pos - tts->ids[event.ulStreamNum].offset); + DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_BOUNDARY, tts->ids[stream_num].id, pos - tts->ids[stream_num].offset); } } } @@ -106,7 +107,7 @@ void TTS_Windows::_update_tts() { synth->SetRate(10.f * log10(message.rate) / log10(3.f)); synth->Speak((LPCWSTR)ut.string.get_data(), flags, &stream_number); - ids[stream_number] = ut; + ids[(uint32_t)stream_number] = ut; queue.pop_front(); } @@ -230,9 +231,10 @@ void TTS_Windows::stop() { SPVOICESTATUS status; synth->GetStatus(&status, nullptr); - if (ids.has(status.ulCurrentStream)) { - DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_CANCELED, ids[status.ulCurrentStream].id); - ids.erase(status.ulCurrentStream); + uint32_t current_stream = (uint32_t)status.ulCurrentStream; + if (ids.has(current_stream)) { + DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_CANCELED, ids[current_stream].id); + ids.erase(current_stream); } for (DisplayServer::TTSUtterance &message : queue) { DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_CANCELED, message.id); diff --git a/platform/windows/tts_windows.h b/platform/windows/tts_windows.h index f0538a097c..33b597c612 100644 --- a/platform/windows/tts_windows.h +++ b/platform/windows/tts_windows.h @@ -32,8 +32,8 @@ #define TTS_WINDOWS_H #include "core/string/ustring.h" +#include "core/templates/hash_map.h" #include "core/templates/list.h" -#include "core/templates/rb_map.h" #include "core/variant/array.h" #include "servers/display_server.h" @@ -54,7 +54,7 @@ class TTS_Windows { int offset; int id; }; - RBMap ids; + HashMap ids; static void __stdcall speech_event_callback(WPARAM wParam, LPARAM lParam); void _update_tts(); -- cgit v1.2.3 From 5bcff18c76e57525eacc7fd99143fc782bee4ea7 Mon Sep 17 00:00:00 2001 From: Johan Mattsson <39247600+mjunix@users.noreply.github.com> Date: Fri, 3 Mar 2023 23:20:36 +0100 Subject: macOS export: Fix validation of codesigning certificate password (cherry picked from commit 76e1d1363b954fa4ca989516ad5851c40a288a48) --- platform/macos/export/export_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/macos/export/export_plugin.cpp b/platform/macos/export/export_plugin.cpp index 5a097adf39..ab76d9b273 100644 --- a/platform/macos/export/export_plugin.cpp +++ b/platform/macos/export/export_plugin.cpp @@ -768,7 +768,7 @@ Error EditorExportPlatformMacOS::_code_sign(const Ref &p_pre String certificate_file = p_preset->get("codesign/certificate_file"); String certificate_pass = p_preset->get("codesign/certificate_password"); - if (!certificate_file.is_empty() && !certificate_file.is_empty()) { + if (!certificate_file.is_empty() && !certificate_pass.is_empty()) { args.push_back("--p12-file"); args.push_back(certificate_file); args.push_back("--p12-password"); -- cgit v1.2.3 From e801fe83d1b2e165455b49fe1cc37b21e1a25f07 Mon Sep 17 00:00:00 2001 From: Mallardbro Date: Tue, 11 Apr 2023 17:38:10 +0100 Subject: Correct the side mentioned with focus_neighbor_right and focus_neighbor_top. A small typo with the definitions of `focus_neighbor_right` and `focus_neighbor_top`. Both use "bottom" rather than the correct side for each. (cherry picked from commit c25d015d0658696b1a2da99a838e6cfcce155efd) --- doc/classes/Control.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index 83797f793b..a4b5764c3b 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -937,10 +937,10 @@ Tells Godot which node it should give focus to if the user presses the left arrow on the keyboard or left on a gamepad by default. You can change the key by editing the [member ProjectSettings.input/ui_left] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the left of this one. - Tells Godot which node it should give focus to if the user presses the right arrow on the keyboard or right on a gamepad by default. You can change the key by editing the [member ProjectSettings.input/ui_right] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the bottom of this one. + Tells Godot which node it should give focus to if the user presses the right arrow on the keyboard or right on a gamepad by default. You can change the key by editing the [member ProjectSettings.input/ui_right] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the right of this one. - Tells Godot which node it should give focus to if the user presses the top arrow on the keyboard or top on a gamepad by default. You can change the key by editing the [member ProjectSettings.input/ui_up] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the bottom of this one. + Tells Godot which node it should give focus to if the user presses the top arrow on the keyboard or top on a gamepad by default. You can change the key by editing the [member ProjectSettings.input/ui_up] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the top of this one. Tells Godot which node it should give focus to if the user presses [kbd]Tab[/kbd] on a keyboard by default. You can change the key by editing the [member ProjectSettings.input/ui_focus_next] input action. -- cgit v1.2.3 From 214ad50498deac45a805e5612fbf4290dc3575b7 Mon Sep 17 00:00:00 2001 From: Riteo Siuga Date: Fri, 7 Apr 2023 17:32:59 +0200 Subject: Convert the logo's text outlines into paths This avoids rendering issues with ThorVG and other renderers (which don't support the `paint-order` property) at a slight cost in file size. This approach has already been used by the main icon. (cherry picked from commit af9372eb5900a2c853e036cf9df91a66dc72e1a2) --- logo_outlined.png | Bin 17898 -> 25859 bytes logo_outlined.svg | 59 ++++++++++++++++++++++++++++++++---------------------- 2 files changed, 35 insertions(+), 24 deletions(-) diff --git a/logo_outlined.png b/logo_outlined.png index 44b85cde57..f834ec395c 100644 Binary files a/logo_outlined.png and b/logo_outlined.png differ diff --git a/logo_outlined.svg b/logo_outlined.svg index 4079a1dd56..8ddc564295 100644 --- a/logo_outlined.svg +++ b/logo_outlined.svg @@ -1,23 +1,23 @@ image/svg+xml Date: Tue, 4 Apr 2023 02:30:05 +0200 Subject: Fix `get_test_texture()` returning an almost fully white texture The texture's appearance is now similar to the texture that was displayed on the TestCube node in Godot 2.x. (cherry picked from commit e4d5cecd4c5e571b6f46b2a7d3e693d09277eb37) --- servers/rendering_server.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp index 3d0443b494..8380558e1c 100644 --- a/servers/rendering_server.cpp +++ b/servers/rendering_server.cpp @@ -140,9 +140,9 @@ RID RenderingServer::get_test_texture() { c.b = y; } - w[(y * TEST_TEXTURE_SIZE + x) * 3 + 0] = uint8_t(CLAMP(c.r * 255, 0, 255)); - w[(y * TEST_TEXTURE_SIZE + x) * 3 + 1] = uint8_t(CLAMP(c.g * 255, 0, 255)); - w[(y * TEST_TEXTURE_SIZE + x) * 3 + 2] = uint8_t(CLAMP(c.b * 255, 0, 255)); + w[(y * TEST_TEXTURE_SIZE + x) * 3 + 0] = uint8_t(CLAMP(c.r, 0, 255)); + w[(y * TEST_TEXTURE_SIZE + x) * 3 + 1] = uint8_t(CLAMP(c.g, 0, 255)); + w[(y * TEST_TEXTURE_SIZE + x) * 3 + 2] = uint8_t(CLAMP(c.b, 0, 255)); } } } -- cgit v1.2.3 From 25518aad2742e8314c270a963c50d679f694fdc6 Mon Sep 17 00:00:00 2001 From: smix8 <52464204+smix8@users.noreply.github.com> Date: Mon, 10 Apr 2023 22:46:03 +0200 Subject: Fix forced optimization in dev_build Fixes forced optimization in dev_build. (cherry picked from commit b18c7481aac9f79e7108e12458bc6743945311bd) --- methods.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/methods.py b/methods.py index 7654e6e86d..33ab894f92 100644 --- a/methods.py +++ b/methods.py @@ -50,7 +50,7 @@ def disable_warnings(self): def force_optimization_on_debug(self): # 'self' is the environment - if self["target"] != "template-release": + if self["target"] == "template_release": return if self.msvc: -- cgit v1.2.3 From 8a349e4fa973a10e26ba4300fe02228ebc1a793a Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Mon, 10 Apr 2023 21:06:02 +0200 Subject: Allow entering named colors in ColorPicker's hex field This also makes the hex field wider to allow displaying 9-character hex code (`#rrggbbaa`) in full, even when using a custom font. (cherry picked from commit 517dc3654a80e30021b8468ef87d0327200963db) --- scene/gui/color_picker.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index 48e3759981..cea60f375a 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -500,8 +500,9 @@ void ColorPicker::_html_submitted(const String &p_html) { return; } - Color previous_color = color; - color = Color::html(p_html); + const Color previous_color = color; + color = Color::from_string(p_html, previous_color); + if (!is_editing_alpha()) { color.a = previous_color.a; } @@ -601,13 +602,13 @@ void ColorPicker::_text_type_toggled() { text_type->set_icon(get_theme_icon(SNAME("Script"), SNAME("EditorIcons"))); c_text->set_editable(false); - c_text->set_h_size_flags(SIZE_EXPAND_FILL); + c_text->set_tooltip_text(RTR("Copy this constructor in a script.")); } else { text_type->set_text("#"); text_type->set_icon(nullptr); c_text->set_editable(true); - c_text->set_h_size_flags(SIZE_FILL); + c_text->set_tooltip_text(RTR("Enter a hex code (\"#ff0000\") or named color (\"red\").")); } _update_color(); } @@ -1754,7 +1755,10 @@ ColorPicker::ColorPicker() { c_text = memnew(LineEdit); hex_hbc->add_child(c_text); + c_text->set_h_size_flags(SIZE_EXPAND_FILL); c_text->set_select_all_on_focus(true); + c_text->set_tooltip_text(RTR("Enter a hex code (\"#ff0000\") or named color (\"red\").")); + c_text->set_placeholder(RTR("Hex code or named color")); c_text->connect("text_submitted", callable_mp(this, &ColorPicker::_html_submitted)); c_text->connect("text_changed", callable_mp(this, &ColorPicker::_text_changed)); c_text->connect("focus_exited", callable_mp(this, &ColorPicker::_html_focus_exit)); -- cgit v1.2.3 From aeca8f07fa8ea3680a8013e8047ff948c81b04b0 Mon Sep 17 00:00:00 2001 From: clayjohn Date: Tue, 11 Apr 2023 16:58:42 -0700 Subject: Check for instancing without relying on instance_count when drawing 2D meshes This ensures that Particles and MultiMeshes still draw when instance_count is 1 (cherry picked from commit 579ca03e885f294b2d430a3550693b43d58d4f64) --- drivers/gles3/rasterizer_canvas_gles3.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp index 522685bf87..19f2cfd47d 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.cpp +++ b/drivers/gles3/rasterizer_canvas_gles3.cpp @@ -1310,6 +1310,7 @@ void RasterizerCanvasGLES3::_render_batch(Light *p_lights, uint32_t p_index) { uint32_t instance_color_offset = 0; bool instance_uses_color = false; bool instance_uses_custom_data = false; + bool use_instancing = false; if (state.canvas_instance_batches[p_index].command_type == Item::Command::TYPE_MESH) { const Item::CommandMesh *m = static_cast(state.canvas_instance_batches[p_index].command); @@ -1336,6 +1337,7 @@ void RasterizerCanvasGLES3::_render_batch(Light *p_lights, uint32_t p_index) { instance_color_offset = mesh_storage->multimesh_get_color_offset(multimesh); instance_uses_color = mesh_storage->multimesh_uses_colors(multimesh); instance_uses_custom_data = mesh_storage->multimesh_uses_custom_data(multimesh); + use_instancing = true; } else if (state.canvas_instance_batches[p_index].command_type == Item::Command::TYPE_PARTICLES) { const Item::CommandParticles *pt = static_cast(state.canvas_instance_batches[p_index].command); @@ -1362,6 +1364,7 @@ void RasterizerCanvasGLES3::_render_batch(Light *p_lights, uint32_t p_index) { instance_color_offset = 8; // 8 bytes for instance transform. instance_uses_color = true; instance_uses_custom_data = true; + use_instancing = true; } ERR_FAIL_COND(mesh.is_null()); @@ -1397,7 +1400,7 @@ void RasterizerCanvasGLES3::_render_batch(Light *p_lights, uint32_t p_index) { use_index_buffer = true; } - if (instance_count > 1) { + if (use_instancing) { if (instance_buffer == 0) { break; } @@ -1426,7 +1429,7 @@ void RasterizerCanvasGLES3::_render_batch(Light *p_lights, uint32_t p_index) { } glBindBuffer(GL_ARRAY_BUFFER, 0); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); - if (instance_count > 1) { + if (use_instancing) { glDisableVertexAttribArray(5); glDisableVertexAttribArray(6); glDisableVertexAttribArray(7); -- cgit v1.2.3 From c1ec270b448bac4ae1c8e1a4b900dde6ffbaedaa Mon Sep 17 00:00:00 2001 From: cody Date: Wed, 5 Apr 2023 23:42:00 +0200 Subject: Fix "error X3708: continue cannot be used in a switch" in HTML export (cherry picked from commit 5062df41a5fbb42d99e08817e19eb6a82c0464d2) --- drivers/gles3/shaders/particles.glsl | 153 ++++++++++++++++------------------- 1 file changed, 70 insertions(+), 83 deletions(-) diff --git a/drivers/gles3/shaders/particles.glsl b/drivers/gles3/shaders/particles.glsl index f8741a22ab..40881a1808 100644 --- a/drivers/gles3/shaders/particles.glsl +++ b/drivers/gles3/shaders/particles.glsl @@ -300,28 +300,23 @@ void main() { vec3 rel_vec = xform[3].xyz - attractors[i].transform[3].xyz; vec3 local_pos = rel_vec * mat3(attractors[i].transform); - switch (attractors[i].type) { - case ATTRACTOR_TYPE_SPHERE: { - dir = safe_normalize(rel_vec); - float d = length(local_pos) / attractors[i].extents.x; - if (d > 1.0) { - continue; - } - amount = max(0.0, 1.0 - d); - } break; - case ATTRACTOR_TYPE_BOX: { - dir = safe_normalize(rel_vec); - - vec3 abs_pos = abs(local_pos / attractors[i].extents.xyz); - float d = max(abs_pos.x, max(abs_pos.y, abs_pos.z)); - if (d > 1.0) { - continue; - } - amount = max(0.0, 1.0 - d); - - } break; - case ATTRACTOR_TYPE_VECTOR_FIELD: { - } break; + if (attractors[i].type == ATTRACTOR_TYPE_SPHERE) { + dir = safe_normalize(rel_vec); + float d = length(local_pos) / attractors[i].extents.x; + if (d > 1.0) { + continue; + } + amount = max(0.0, 1.0 - d); + } else if (attractors[i].type == ATTRACTOR_TYPE_BOX) { + dir = safe_normalize(rel_vec); + + vec3 abs_pos = abs(local_pos / attractors[i].extents.xyz); + float d = max(abs_pos.x, max(abs_pos.y, abs_pos.z)); + if (d > 1.0) { + continue; + } + amount = max(0.0, 1.0 - d); + } else if (attractors[i].type == ATTRACTOR_TYPE_VECTOR_FIELD) { } amount = pow(amount, attractors[i].attenuation); dir = safe_normalize(mix(dir, attractors[i].transform[2].xyz, attractors[i].directionality)); @@ -383,80 +378,72 @@ void main() { vec3 rel_vec = xform[3].xyz - colliders[i].transform[3].xyz; vec3 local_pos = rel_vec * mat3(colliders[i].transform); - switch (colliders[i].type) { - case COLLIDER_TYPE_SPHERE: { - float d = length(rel_vec) - (particle_size + colliders[i].extents.x); + if (colliders[i].type == COLLIDER_TYPE_SPHERE) { + float d = length(rel_vec) - (particle_size + colliders[i].extents.x); - if (d < 0.0) { - col = true; - depth = -d; - normal = normalize(rel_vec); - } + if (d < 0.0) { + col = true; + depth = -d; + normal = normalize(rel_vec); + } + } else if (colliders[i].type == COLLIDER_TYPE_BOX) { + vec3 abs_pos = abs(local_pos); + vec3 sgn_pos = sign(local_pos); - } break; - case COLLIDER_TYPE_BOX: { - vec3 abs_pos = abs(local_pos); - vec3 sgn_pos = sign(local_pos); - - if (any(greaterThan(abs_pos, colliders[i].extents.xyz))) { - //point outside box - - vec3 closest = min(abs_pos, colliders[i].extents.xyz); - vec3 rel = abs_pos - closest; - depth = length(rel) - particle_size; - if (depth < 0.0) { - col = true; - normal = mat3(colliders[i].transform) * (normalize(rel) * sgn_pos); - depth = -depth; - } - } else { - //point inside box - vec3 axis_len = colliders[i].extents.xyz - abs_pos; - // there has to be a faster way to do this? - if (all(lessThan(axis_len.xx, axis_len.yz))) { - normal = vec3(1, 0, 0); - } else if (all(lessThan(axis_len.yy, axis_len.xz))) { - normal = vec3(0, 1, 0); - } else { - normal = vec3(0, 0, 1); - } + if (any(greaterThan(abs_pos, colliders[i].extents.xyz))) { + //point outside box + vec3 closest = min(abs_pos, colliders[i].extents.xyz); + vec3 rel = abs_pos - closest; + depth = length(rel) - particle_size; + if (depth < 0.0) { col = true; - depth = dot(normal * axis_len, vec3(1)) + particle_size; - normal = mat3(colliders[i].transform) * (normal * sgn_pos); + normal = mat3(colliders[i].transform) * (normalize(rel) * sgn_pos); + depth = -depth; } - - } break; - case COLLIDER_TYPE_SDF: { - } break; - case COLLIDER_TYPE_HEIGHT_FIELD: { - vec3 local_pos_bottom = local_pos; - local_pos_bottom.y -= particle_size; - - if (any(greaterThan(abs(local_pos_bottom), colliders[i].extents.xyz))) { - continue; + } else { + //point inside box + vec3 axis_len = colliders[i].extents.xyz - abs_pos; + // there has to be a faster way to do this? + if (all(lessThan(axis_len.xx, axis_len.yz))) { + normal = vec3(1, 0, 0); + } else if (all(lessThan(axis_len.yy, axis_len.xz))) { + normal = vec3(0, 1, 0); + } else { + normal = vec3(0, 0, 1); } - const float DELTA = 1.0 / 8192.0; - vec3 uvw_pos = vec3(local_pos_bottom / colliders[i].extents.xyz) * 0.5 + 0.5; + col = true; + depth = dot(normal * axis_len, vec3(1)) + particle_size; + normal = mat3(colliders[i].transform) * (normal * sgn_pos); + } + } else if (colliders[i].type == COLLIDER_TYPE_SDF) { + } else if (colliders[i].type == COLLIDER_TYPE_HEIGHT_FIELD) { + vec3 local_pos_bottom = local_pos; + local_pos_bottom.y -= particle_size; - float y = 1.0 - texture(height_field_texture, uvw_pos.xz).r; + if (any(greaterThan(abs(local_pos_bottom), colliders[i].extents.xyz))) { + continue; + } + const float DELTA = 1.0 / 8192.0; - if (y > uvw_pos.y) { - //inside heightfield + vec3 uvw_pos = vec3(local_pos_bottom / colliders[i].extents.xyz) * 0.5 + 0.5; - vec3 pos1 = (vec3(uvw_pos.x, y, uvw_pos.z) * 2.0 - 1.0) * colliders[i].extents.xyz; - vec3 pos2 = (vec3(uvw_pos.x + DELTA, 1.0 - texture(height_field_texture, uvw_pos.xz + vec2(DELTA, 0)).r, uvw_pos.z) * 2.0 - 1.0) * colliders[i].extents.xyz; - vec3 pos3 = (vec3(uvw_pos.x, 1.0 - texture(height_field_texture, uvw_pos.xz + vec2(0, DELTA)).r, uvw_pos.z + DELTA) * 2.0 - 1.0) * colliders[i].extents.xyz; + float y = 1.0 - texture(height_field_texture, uvw_pos.xz).r; - normal = normalize(cross(pos1 - pos2, pos1 - pos3)); - float local_y = (vec3(local_pos / colliders[i].extents.xyz) * 0.5 + 0.5).y; + if (y > uvw_pos.y) { + //inside heightfield - col = true; - depth = dot(normal, pos1) - dot(normal, local_pos_bottom); - } + vec3 pos1 = (vec3(uvw_pos.x, y, uvw_pos.z) * 2.0 - 1.0) * colliders[i].extents.xyz; + vec3 pos2 = (vec3(uvw_pos.x + DELTA, 1.0 - texture(height_field_texture, uvw_pos.xz + vec2(DELTA, 0)).r, uvw_pos.z) * 2.0 - 1.0) * colliders[i].extents.xyz; + vec3 pos3 = (vec3(uvw_pos.x, 1.0 - texture(height_field_texture, uvw_pos.xz + vec2(0, DELTA)).r, uvw_pos.z + DELTA) * 2.0 - 1.0) * colliders[i].extents.xyz; - } break; + normal = normalize(cross(pos1 - pos2, pos1 - pos3)); + float local_y = (vec3(local_pos / colliders[i].extents.xyz) * 0.5 + 0.5).y; + + col = true; + depth = dot(normal, pos1) - dot(normal, local_pos_bottom); + } } if (col) { -- cgit v1.2.3 From df80e2ae4331f58643c12fa6e4f00ed4d2d0a6e8 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Wed, 12 Apr 2023 17:49:52 +0800 Subject: Tree: Fix offset calculation when there are hidden items (cherry picked from commit a083c855214722bc02ed2eb48ea808c7f4d756da) --- scene/gui/tree.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index f8c2e9f4ad..bae2c8a9cb 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -4523,8 +4523,8 @@ int Tree::get_item_offset(TreeItem *p_item) const { return ofs; } - ofs += compute_item_height(it); - if (it != root || !hide_root) { + if ((it != root || !hide_root) && it->is_visible()) { + ofs += compute_item_height(it); ofs += theme_cache.v_separation; } -- cgit v1.2.3 From d4c9ca39758ef0fb9ed27f8473faed5690994fef Mon Sep 17 00:00:00 2001 From: clayjohn Date: Tue, 11 Apr 2023 21:15:24 -0700 Subject: Ensure that depth write state is updated before transparent pass in OpenGL3 renderer (cherry picked from commit ed0c378bda98d41288c0f9eeb31707590853e215) --- drivers/gles3/rasterizer_scene_gles3.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index b3d6b01c6c..3d8f7924a7 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -1948,7 +1948,7 @@ void RasterizerSceneGLES3::render_scene(const Ref &p_render_ glDepthFunc(GL_LEQUAL); glDepthMask(GL_TRUE); scene_state.current_depth_test = GLES3::SceneShaderData::DEPTH_TEST_ENABLED; - scene_state.current_depth_draw = GLES3::SceneShaderData::DEPTH_DRAW_OPAQUE; + scene_state.current_depth_draw = GLES3::SceneShaderData::DEPTH_DRAW_ALWAYS; if (!fb_cleared) { glClearDepth(1.0f); @@ -1976,19 +1976,17 @@ void RasterizerSceneGLES3::render_scene(const Ref &p_render_ _render_list_template(&render_list_params, &render_data, 0, render_list[RENDER_LIST_OPAQUE].elements.size()); + glDepthMask(GL_FALSE); + scene_state.current_depth_draw = GLES3::SceneShaderData::DEPTH_DRAW_DISABLED; + if (draw_sky) { RENDER_TIMESTAMP("Render Sky"); - if (scene_state.current_depth_test != GLES3::SceneShaderData::DEPTH_TEST_ENABLED) { - glEnable(GL_DEPTH_TEST); - scene_state.current_depth_test = GLES3::SceneShaderData::DEPTH_TEST_ENABLED; - } + glEnable(GL_DEPTH_TEST); - glDepthMask(GL_FALSE); glDisable(GL_BLEND); glEnable(GL_CULL_FACE); glCullFace(GL_BACK); scene_state.current_depth_test = GLES3::SceneShaderData::DEPTH_TEST_ENABLED; - scene_state.current_depth_draw = GLES3::SceneShaderData::DEPTH_DRAW_DISABLED; scene_state.cull_mode = GLES3::SceneShaderData::CULL_BACK; _draw_sky(render_data.environment, render_data.cam_projection, render_data.cam_transform, sky_energy_multiplier, p_camera_data->view_count > 1, flip_y); -- cgit v1.2.3 From e071fb226374e027eedf5660294288a683b422a7 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Wed, 12 Apr 2023 10:08:51 +0300 Subject: [TextServer] Use dedicated flag for object replacement characters. (cherry picked from commit d904516e553426dae1fa40566e3fe67f6213e769) --- doc/classes/TextServer.xml | 3 +++ modules/text_server_adv/text_server_adv.cpp | 2 +- modules/text_server_fb/text_server_fb.cpp | 2 +- scene/gui/line_edit.cpp | 2 +- scene/gui/rich_text_label.cpp | 2 +- scene/gui/text_edit.cpp | 2 +- servers/text_server.cpp | 3 ++- servers/text_server.h | 9 +++++---- 8 files changed, 15 insertions(+), 10 deletions(-) diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml index 6d71578488..608fef8f37 100644 --- a/doc/classes/TextServer.xml +++ b/doc/classes/TextServer.xml @@ -1775,6 +1775,9 @@ It is safe to insert a U+0640 before this grapheme for elongation. + + Grapheme is an object replacement character for the embedded object. + Disables font hinting (smoother but less crisp). diff --git a/modules/text_server_adv/text_server_adv.cpp b/modules/text_server_adv/text_server_adv.cpp index 3cf6288fef..c1a1d8e048 100644 --- a/modules/text_server_adv/text_server_adv.cpp +++ b/modules/text_server_adv/text_server_adv.cpp @@ -5697,7 +5697,7 @@ bool TextServerAdvanced::_shaped_text_shape(const RID &p_shaped) { gl.start = span.start; gl.end = span.end; gl.count = 1; - gl.flags = GRAPHEME_IS_VALID | GRAPHEME_IS_VIRTUAL; + gl.flags = GRAPHEME_IS_VALID | GRAPHEME_IS_EMBEDDED_OBJECT; if (sd->orientation == ORIENTATION_HORIZONTAL) { gl.advance = sd->objects[span.embedded_key].rect.size.x; } else { diff --git a/modules/text_server_fb/text_server_fb.cpp b/modules/text_server_fb/text_server_fb.cpp index 8687726287..eac5ba4a07 100644 --- a/modules/text_server_fb/text_server_fb.cpp +++ b/modules/text_server_fb/text_server_fb.cpp @@ -3664,7 +3664,7 @@ bool TextServerFallback::_shaped_text_shape(const RID &p_shaped) { gl.end = span.end; gl.count = 1; gl.index = 0; - gl.flags = GRAPHEME_IS_VALID | GRAPHEME_IS_VIRTUAL; + gl.flags = GRAPHEME_IS_VALID | GRAPHEME_IS_EMBEDDED_OBJECT; if (sd->orientation == ORIENTATION_HORIZONTAL) { gl.advance = sd->objects[span.embedded_key].rect.size.x; } else { diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 6b2faf1a40..17cc81c8d3 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -952,7 +952,7 @@ void LineEdit::_notification(int p_what) { if (ceil(ofs.x) >= x_ofs && (ofs.x + glyphs[i].advance) <= ofs_max) { if (glyphs[i].font_rid != RID()) { TS->font_draw_glyph(glyphs[i].font_rid, ci, glyphs[i].font_size, ofs + Vector2(glyphs[i].x_off, glyphs[i].y_off), glyphs[i].index, selected ? font_selected_color : font_color); - } else if ((glyphs[i].flags & TextServer::GRAPHEME_IS_VIRTUAL) != TextServer::GRAPHEME_IS_VIRTUAL) { + } else if (((glyphs[i].flags & TextServer::GRAPHEME_IS_VIRTUAL) != TextServer::GRAPHEME_IS_VIRTUAL) && ((glyphs[i].flags & TextServer::GRAPHEME_IS_EMBEDDED_OBJECT) != TextServer::GRAPHEME_IS_EMBEDDED_OBJECT)) { TS->draw_hex_code_box(ci, glyphs[i].font_size, ofs + Vector2(glyphs[i].x_off, glyphs[i].y_off), glyphs[i].index, selected ? font_selected_color : font_color); } } diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 849f217b4a..81ef8dee36 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -1323,7 +1323,7 @@ int RichTextLabel::_draw_line(ItemFrame *p_frame, int p_line, const Vector2 &p_o if (!skip) { if (frid != RID()) { TS->font_draw_glyph(frid, ci, glyphs[i].font_size, p_ofs + fx_offset + off, gl, font_color); - } else if ((glyphs[i].flags & TextServer::GRAPHEME_IS_VIRTUAL) != TextServer::GRAPHEME_IS_VIRTUAL) { + } else if (((glyphs[i].flags & TextServer::GRAPHEME_IS_VIRTUAL) != TextServer::GRAPHEME_IS_VIRTUAL) && ((glyphs[i].flags & TextServer::GRAPHEME_IS_EMBEDDED_OBJECT) != TextServer::GRAPHEME_IS_EMBEDDED_OBJECT)) { TS->draw_hex_code_box(ci, glyphs[i].font_size, p_ofs + fx_offset + off, gl, font_color); } } diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 0560b9f2e4..814af12d60 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -1276,7 +1276,7 @@ void TextEdit::_notification(int p_what) { if (glyphs[j].font_rid != RID()) { TS->font_draw_glyph(glyphs[j].font_rid, ci, glyphs[j].font_size, Vector2(char_margin + char_ofs + ofs_x + glyphs[j].x_off, ofs_y + glyphs[j].y_off), glyphs[j].index, gl_color); had_glyphs_drawn = true; - } else if ((glyphs[j].flags & TextServer::GRAPHEME_IS_VIRTUAL) != TextServer::GRAPHEME_IS_VIRTUAL) { + } else if (((glyphs[j].flags & TextServer::GRAPHEME_IS_VIRTUAL) != TextServer::GRAPHEME_IS_VIRTUAL) && ((glyphs[j].flags & TextServer::GRAPHEME_IS_EMBEDDED_OBJECT) != TextServer::GRAPHEME_IS_EMBEDDED_OBJECT)) { TS->draw_hex_code_box(ci, glyphs[j].font_size, Vector2(char_margin + char_ofs + ofs_x + glyphs[j].x_off, ofs_y + glyphs[j].y_off), glyphs[j].index, gl_color); had_glyphs_drawn = true; } diff --git a/servers/text_server.cpp b/servers/text_server.cpp index 027109b67d..69ba3dafb2 100644 --- a/servers/text_server.cpp +++ b/servers/text_server.cpp @@ -546,6 +546,7 @@ void TextServer::_bind_methods() { BIND_BITFIELD_FLAG(GRAPHEME_IS_UNDERSCORE); BIND_BITFIELD_FLAG(GRAPHEME_IS_CONNECTED); BIND_BITFIELD_FLAG(GRAPHEME_IS_SAFE_TO_INSERT_TATWEEL); + BIND_BITFIELD_FLAG(GRAPHEME_IS_EMBEDDED_OBJECT); /* Hinting */ BIND_ENUM_CONSTANT(HINTING_NONE); @@ -1448,7 +1449,7 @@ void TextServer::shaped_text_draw(const RID &p_shaped, const RID &p_canvas, cons if (glyphs[i].font_rid != RID()) { font_draw_glyph(glyphs[i].font_rid, p_canvas, glyphs[i].font_size, ofs + Vector2(glyphs[i].x_off, glyphs[i].y_off), glyphs[i].index, p_color); - } else if (hex_codes && ((glyphs[i].flags & GRAPHEME_IS_VIRTUAL) != GRAPHEME_IS_VIRTUAL)) { + } else if (hex_codes && ((glyphs[i].flags & GRAPHEME_IS_VIRTUAL) != GRAPHEME_IS_VIRTUAL) && ((glyphs[i].flags & GRAPHEME_IS_EMBEDDED_OBJECT) != GRAPHEME_IS_EMBEDDED_OBJECT)) { TextServer::draw_hex_code_box(p_canvas, glyphs[i].font_size, ofs + Vector2(glyphs[i].x_off, glyphs[i].y_off), glyphs[i].index, p_color); } if (orientation == ORIENTATION_HORIZONTAL) { diff --git a/servers/text_server.h b/servers/text_server.h index 2c6a8af682..7490a48b51 100644 --- a/servers/text_server.h +++ b/servers/text_server.h @@ -125,18 +125,19 @@ public: }; enum GraphemeFlag { - GRAPHEME_IS_VALID = 1 << 0, // Glyph is valid. - GRAPHEME_IS_RTL = 1 << 1, // Glyph is right-to-left. - GRAPHEME_IS_VIRTUAL = 1 << 2, // Glyph is not part of source string (added by fit_to_width function, do not affect caret movement). + GRAPHEME_IS_VALID = 1 << 0, // Grapheme is valid. + GRAPHEME_IS_RTL = 1 << 1, // Grapheme is right-to-left. + GRAPHEME_IS_VIRTUAL = 1 << 2, // Grapheme is not part of source string (added by fit_to_width function, do not affect caret movement). GRAPHEME_IS_SPACE = 1 << 3, // Is whitespace (for justification and word breaks). GRAPHEME_IS_BREAK_HARD = 1 << 4, // Is line break (mandatory break, e.g. "\n"). GRAPHEME_IS_BREAK_SOFT = 1 << 5, // Is line break (optional break, e.g. space). GRAPHEME_IS_TAB = 1 << 6, // Is tab or vertical tab. - GRAPHEME_IS_ELONGATION = 1 << 7, // Elongation (e.g. kashida), glyph can be duplicated or truncated to fit line to width. + GRAPHEME_IS_ELONGATION = 1 << 7, // Elongation (e.g. kashida), grapheme can be duplicated or truncated to fit line to width. GRAPHEME_IS_PUNCTUATION = 1 << 8, // Punctuation, except underscore (can be used as word break, but not line break or justifiction). GRAPHEME_IS_UNDERSCORE = 1 << 9, // Underscore (can be used as word break). GRAPHEME_IS_CONNECTED = 1 << 10, // Connected to previous grapheme. GRAPHEME_IS_SAFE_TO_INSERT_TATWEEL = 1 << 11, // It is safe to insert a U+0640 before this grapheme for elongation. + GRAPHEME_IS_EMBEDDED_OBJECT = 1 << 12, // Grapheme is an object replacement character for the embedded object. }; enum Hinting { -- cgit v1.2.3 From 95f50274534563dbcb27e6ed3fcfa25a77f366e9 Mon Sep 17 00:00:00 2001 From: clayjohn Date: Tue, 11 Apr 2023 18:03:00 -0700 Subject: Write out render_mode even when mode is set to default in VisualShaders (cherry picked from commit 016946b552e16a43eef14b89c010d41dfc28d340) --- scene/resources/visual_shader.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp index 3a6d40d22c..e46b643cd1 100644 --- a/scene/resources/visual_shader.cpp +++ b/scene/resources/visual_shader.cpp @@ -2183,11 +2183,17 @@ void VisualShader::_update_shader() const { const String temp = String(info.name); if (!info.options.is_empty()) { + if (!render_mode.is_empty()) { + render_mode += ", "; + } + // Always write out a render_mode for the enumerated modes as having no render mode is not always + // the same as the default. i.e. for depth_draw_opaque, the render mode has to be declared for it + // to work properly, no render mode is an invalid option. if (modes.has(temp) && modes[temp] < info.options.size()) { - if (!render_mode.is_empty()) { - render_mode += ", "; - } render_mode += temp + "_" + info.options[modes[temp]]; + } else { + // Use the default. + render_mode += temp + "_" + info.options[0]; } } else if (flags.has(temp)) { flag_names.push_back(temp); -- cgit v1.2.3 From 27df8b93aa3055d707421222eb9176964e294096 Mon Sep 17 00:00:00 2001 From: clayjohn Date: Tue, 14 Feb 2023 14:37:47 -0800 Subject: Properly calculate lifetime_split for particles (cherry picked from commit f35ca4a9c735e49d496c4e733e7dc9a072841f92) --- drivers/gles3/storage/particles_storage.cpp | 9 ++++----- servers/rendering/renderer_rd/storage_rd/particles_storage.cpp | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/gles3/storage/particles_storage.cpp b/drivers/gles3/storage/particles_storage.cpp index 2b47271408..4b64e2aec1 100644 --- a/drivers/gles3/storage/particles_storage.cpp +++ b/drivers/gles3/storage/particles_storage.cpp @@ -919,7 +919,7 @@ void ParticlesStorage::_particles_update_instance_buffer(Particles *particles, c glBeginTransformFeedback(GL_POINTS); if (particles->draw_order == RS::PARTICLES_DRAW_ORDER_LIFETIME) { - uint32_t lifetime_split = MIN(particles->amount * particles->phase, particles->amount - 1); + uint32_t lifetime_split = (MIN(int(particles->amount * particles->phase), particles->amount - 1) + 1) % particles->amount; uint32_t stride = particles->process_buffer_stride_cache; glBindBuffer(GL_ARRAY_BUFFER, particles->back_process_buffer); @@ -1135,14 +1135,13 @@ void ParticlesStorage::_particles_reverse_lifetime_sort(Particles *particles) { glGetBufferSubData(GL_ARRAY_BUFFER, 0, buffer_size, particle_array); #endif - uint32_t lifetime_split = MIN(particles->amount * particles->sort_buffer_phase, particles->amount - 1); - + uint32_t lifetime_split = (MIN(int(particles->amount * particles->sort_buffer_phase), particles->amount - 1) + 1) % particles->amount; for (uint32_t i = 0; i < lifetime_split / 2; i++) { - SWAP(particle_array[i], particle_array[lifetime_split - i]); + SWAP(particle_array[i], particle_array[lifetime_split - i - 1]); } for (uint32_t i = 0; i < (particles->amount - lifetime_split) / 2; i++) { - SWAP(particle_array[lifetime_split + i + 1], particle_array[particles->amount - 1 - i]); + SWAP(particle_array[lifetime_split + i], particle_array[particles->amount - 1 - i]); } #ifndef __EMSCRIPTEN__ diff --git a/servers/rendering/renderer_rd/storage_rd/particles_storage.cpp b/servers/rendering/renderer_rd/storage_rd/particles_storage.cpp index 3ed5d7dda8..1f6ec75df1 100644 --- a/servers/rendering/renderer_rd/storage_rd/particles_storage.cpp +++ b/servers/rendering/renderer_rd/storage_rd/particles_storage.cpp @@ -1193,7 +1193,7 @@ void ParticlesStorage::particles_set_view_axis(RID p_particles, const Vector3 &p } copy_push_constant.order_by_lifetime = (particles->draw_order == RS::PARTICLES_DRAW_ORDER_LIFETIME || particles->draw_order == RS::PARTICLES_DRAW_ORDER_REVERSE_LIFETIME); - copy_push_constant.lifetime_split = MIN(particles->amount * particles->phase, particles->amount - 1); + copy_push_constant.lifetime_split = (MIN(int(particles->amount * particles->phase), particles->amount - 1) + 1) % particles->amount; copy_push_constant.lifetime_reverse = particles->draw_order == RS::PARTICLES_DRAW_ORDER_REVERSE_LIFETIME; copy_push_constant.frame_remainder = particles->interpolate ? particles->frame_remainder : 0.0; @@ -1511,7 +1511,7 @@ void ParticlesStorage::update_particles() { } copy_push_constant.order_by_lifetime = (particles->draw_order == RS::PARTICLES_DRAW_ORDER_LIFETIME || particles->draw_order == RS::PARTICLES_DRAW_ORDER_REVERSE_LIFETIME); - copy_push_constant.lifetime_split = MIN(particles->amount * particles->phase, particles->amount - 1); + copy_push_constant.lifetime_split = (MIN(int(particles->amount * particles->phase), particles->amount - 1) + 1) % particles->amount; copy_push_constant.lifetime_reverse = particles->draw_order == RS::PARTICLES_DRAW_ORDER_REVERSE_LIFETIME; RD::ComputeListID compute_list = RD::get_singleton()->compute_list_begin(); -- cgit v1.2.3 From f3907e2fe0353ae91015412bd64e7abbe08e5a9e Mon Sep 17 00:00:00 2001 From: Jason Knight Date: Wed, 12 Apr 2023 09:18:11 -0600 Subject: Fix potential null in android text entry system. (cherry picked from commit f8699d93f6abe01a85319c06f7c94911e75498aa) --- .../org/godotengine/godot/input/GodotTextInputWrapper.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/platform/android/java/lib/src/org/godotengine/godot/input/GodotTextInputWrapper.java b/platform/android/java/lib/src/org/godotengine/godot/input/GodotTextInputWrapper.java index 7b628e25ed..f48dba56df 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/input/GodotTextInputWrapper.java +++ b/platform/android/java/lib/src/org/godotengine/godot/input/GodotTextInputWrapper.java @@ -124,11 +124,12 @@ public class GodotTextInputWrapper implements TextWatcher, OnEditorActionListene public boolean onEditorAction(final TextView pTextView, final int pActionID, final KeyEvent pKeyEvent) { if (mEdit == pTextView && isFullScreenEdit() && pKeyEvent != null) { final String characters = pKeyEvent.getCharacters(); - - for (int i = 0; i < characters.length(); i++) { - final int character = characters.codePointAt(i); - GodotLib.key(0, character, 0, true); - GodotLib.key(0, character, 0, false); + if (characters != null) { + for (int i = 0; i < characters.length(); i++) { + final int character = characters.codePointAt(i); + GodotLib.key(0, character, 0, true); + GodotLib.key(0, character, 0, false); + } } } -- cgit v1.2.3 From 2992a996293894d0b74b2129adaaea430a24cec7 Mon Sep 17 00:00:00 2001 From: Martin Capitanio Date: Wed, 12 Apr 2023 16:05:31 +0200 Subject: Fix blend_shape (shapekey) empty name import. Corresponds to the Blender glTF-Importer PR https://github.com/KhronosGroup/glTF-Blender-IO/pull/1902 (cherry picked from commit 8b6fa79eee25d721a05518b56615eb5576147eba) --- modules/gltf/gltf_document.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp index d93485a800..7087c30688 100644 --- a/modules/gltf/gltf_document.cpp +++ b/modules/gltf/gltf_document.cpp @@ -2820,7 +2820,13 @@ Error GLTFDocument::_parse_meshes(Ref p_state) { if (j == 0) { const Array &target_names = extras.has("targetNames") ? (Array)extras["targetNames"] : Array(); for (int k = 0; k < targets.size(); k++) { - import_mesh->add_blend_shape(k < target_names.size() ? (String)target_names[k] : String("morph_") + itos(k)); + String bs_name; + if (k < target_names.size() && ((String)target_names[k]).size() != 0) { + bs_name = (String)target_names[k]; + } else { + bs_name = String("morph_") + itos(k); + } + import_mesh->add_blend_shape(bs_name); } } -- cgit v1.2.3 From ccc761dd93566cec98ee3f1608d4c4da709f308f Mon Sep 17 00:00:00 2001 From: Ninni Pipping Date: Wed, 12 Apr 2023 17:40:40 +0200 Subject: Don't apply scale to autohide theme property (cherry picked from commit 722597aa97753a12bc5cd643c6350431f45e7d0b) --- scene/resources/default_theme/default_theme.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 2e1ba96d11..11373c430c 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -1069,9 +1069,9 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const theme->set_constant("minimum_grab_thickness", "SplitContainer", 6 * scale); theme->set_constant("minimum_grab_thickness", "HSplitContainer", 6 * scale); theme->set_constant("minimum_grab_thickness", "VSplitContainer", 6 * scale); - theme->set_constant("autohide", "SplitContainer", 1 * scale); - theme->set_constant("autohide", "HSplitContainer", 1 * scale); - theme->set_constant("autohide", "VSplitContainer", 1 * scale); + theme->set_constant("autohide", "SplitContainer", 1); + theme->set_constant("autohide", "HSplitContainer", 1); + theme->set_constant("autohide", "VSplitContainer", 1); theme->set_constant("h_separation", "FlowContainer", 4 * scale); theme->set_constant("v_separation", "FlowContainer", 4 * scale); theme->set_constant("h_separation", "HFlowContainer", 4 * scale); -- cgit v1.2.3 From 3445fa7dbcddff1aabb73e0ee156d97227dbe41b Mon Sep 17 00:00:00 2001 From: Ninni Pipping Date: Thu, 13 Apr 2023 09:39:03 +0200 Subject: Expose more compression formats in Image and fix compress check Check for compressing ASTC checked if the function for BPTC was present (cherry picked from commit cf64e2fa479ce548713c589d9c3252e5ac36a6d3) --- core/io/image.cpp | 4 +++- doc/classes/Image.xml | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/core/io/image.cpp b/core/io/image.cpp index 736a3ec82e..8111ca447c 100644 --- a/core/io/image.cpp +++ b/core/io/image.cpp @@ -2649,7 +2649,7 @@ Error Image::compress_from_channels(CompressMode p_mode, UsedChannels p_channels _image_compress_bptc_func(this, p_channels); } break; case COMPRESS_ASTC: { - ERR_FAIL_COND_V(!_image_compress_bptc_func, ERR_UNAVAILABLE); + ERR_FAIL_COND_V(!_image_compress_astc_func, ERR_UNAVAILABLE); _image_compress_astc_func(this, p_astc_format); } break; case COMPRESS_MAX: { @@ -3535,6 +3535,8 @@ void Image::_bind_methods() { BIND_ENUM_CONSTANT(COMPRESS_ETC); BIND_ENUM_CONSTANT(COMPRESS_ETC2); BIND_ENUM_CONSTANT(COMPRESS_BPTC); + BIND_ENUM_CONSTANT(COMPRESS_ASTC); + BIND_ENUM_CONSTANT(COMPRESS_MAX); BIND_ENUM_CONSTANT(USED_CHANNELS_L); BIND_ENUM_CONSTANT(USED_CHANNELS_LA); diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml index 166ef7a108..09911d58a8 100644 --- a/doc/classes/Image.xml +++ b/doc/classes/Image.xml @@ -714,6 +714,12 @@ Use BPTC compression. + + Use ASTC compression. + + + Represents the size of the [enum CompressMode] enum. + -- cgit v1.2.3 From 410b503aace744ba1ea5b1f7a67d0d8600258481 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Mon, 20 Mar 2023 20:40:13 -0400 Subject: Translate inactive particles to -INF (cherry picked from commit 6229c2a1f99135b841ce43f2728b4ac35a9b1938) --- drivers/gles3/shaders/particles_copy.glsl | 9 ++++++--- servers/rendering/renderer_rd/shaders/particles_copy.glsl | 7 ++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/gles3/shaders/particles_copy.glsl b/drivers/gles3/shaders/particles_copy.glsl index f273cb7b64..774aa139b3 100644 --- a/drivers/gles3/shaders/particles_copy.glsl +++ b/drivers/gles3/shaders/particles_copy.glsl @@ -44,8 +44,12 @@ uniform highp mat4 inv_emission_transform; #define PARTICLE_FLAG_ACTIVE uint(1) +#define FLT_MAX float(3.402823466e+38) + void main() { - mat4 txform = mat4(vec4(0.0), vec4(0.0), vec4(0.0), vec4(0.0)); // zero scale, becomes invisible. + // Set scale to zero and translate to -INF so particle will be invisible + // even for materials that ignore rotation/scale (i.e. billboards). + mat4 txform = mat4(vec4(0.0), vec4(0.0), vec4(0.0), vec4(-FLT_MAX, -FLT_MAX, -FLT_MAX, 0.0)); if (bool(floatBitsToUint(velocity_flags.w) & PARTICLE_FLAG_ACTIVE)) { #ifdef MODE_3D txform = transpose(mat4(xform_1, xform_2, xform_3, vec4(0.0, 0.0, 0.0, 1.0))); @@ -102,9 +106,8 @@ void main() { // as they will be drawn with the node position as origin. txform = inv_emission_transform * txform; #endif - - txform = transpose(txform); } + txform = transpose(txform); instance_color_custom_data = uvec4(packHalf2x16(color.xy), packHalf2x16(color.zw), packHalf2x16(custom.xy), packHalf2x16(custom.zw)); out_xform_1 = txform[0]; diff --git a/servers/rendering/renderer_rd/shaders/particles_copy.glsl b/servers/rendering/renderer_rd/shaders/particles_copy.glsl index afbd5a9caa..67a894b86f 100644 --- a/servers/rendering/renderer_rd/shaders/particles_copy.glsl +++ b/servers/rendering/renderer_rd/shaders/particles_copy.glsl @@ -206,11 +206,12 @@ void main() { // as they will be drawn with the node position as origin. txform = params.inv_emission_transform * txform; } - - txform = transpose(txform); } else { - txform = mat4(vec4(0.0), vec4(0.0), vec4(0.0), vec4(0.0)); //zero scale, becomes invisible + // Set scale to zero and translate to -INF so particle will be invisible + // even for materials that ignore rotation/scale (i.e. billboards). + txform = mat4(vec4(0.0), vec4(0.0), vec4(0.0), vec4(-1.0 / 0.0, -1.0 / 0.0, -1.0 / 0.0, 0.0)); } + txform = transpose(txform); if (params.copy_mode_2d) { uint write_offset = gl_GlobalInvocationID.x * (2 + 1 + 1); //xform + color + custom -- cgit v1.2.3 From ad582cf0b163a8c15ba6a372ee76e0133213976c Mon Sep 17 00:00:00 2001 From: clayjohn Date: Wed, 12 Apr 2023 14:41:17 -0700 Subject: Don't store instance transform in RD 3D renderer unless requested Previously, when using doubles builds of the engine, instance transform was stored no matter what which caused world space particles to accumulate the instance transform twice (cherry picked from commit 29edd277e4a45c9f84a9f5291087e671b2169191) --- .../forward_clustered/render_forward_clustered.cpp | 16 ++++++++-------- .../renderer_rd/forward_mobile/render_forward_mobile.cpp | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp index 91789201c6..c7d85a3bbf 100644 --- a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp +++ b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp @@ -721,6 +721,14 @@ void RenderForwardClustered::_fill_instance_data(RenderListType p_render_list, i if (inst->store_transform_cache) { RendererRD::MaterialStorage::store_transform(inst->transform, instance_data.transform); RendererRD::MaterialStorage::store_transform(inst->prev_transform, instance_data.prev_transform); + +#ifdef REAL_T_IS_DOUBLE + // Split the origin into two components, the float approximation and the missing precision + // In the shader we will combine these back together to restore the lost precision. + RendererRD::MaterialStorage::split_double(inst->transform.origin.x, &instance_data.transform[12], &instance_data.transform[3]); + RendererRD::MaterialStorage::split_double(inst->transform.origin.y, &instance_data.transform[13], &instance_data.transform[7]); + RendererRD::MaterialStorage::split_double(inst->transform.origin.z, &instance_data.transform[14], &instance_data.transform[11]); +#endif } else { RendererRD::MaterialStorage::store_transform(Transform3D(), instance_data.transform); RendererRD::MaterialStorage::store_transform(Transform3D(), instance_data.prev_transform); @@ -735,14 +743,6 @@ void RenderForwardClustered::_fill_instance_data(RenderListType p_render_list, i instance_data.lightmap_uv_scale[2] = inst->lightmap_uv_scale.size.x; instance_data.lightmap_uv_scale[3] = inst->lightmap_uv_scale.size.y; -#ifdef REAL_T_IS_DOUBLE - // Split the origin into two components, the float approximation and the missing precision - // In the shader we will combine these back together to restore the lost precision. - RendererRD::MaterialStorage::split_double(inst->transform.origin.x, &instance_data.transform[12], &instance_data.transform[3]); - RendererRD::MaterialStorage::split_double(inst->transform.origin.y, &instance_data.transform[13], &instance_data.transform[7]); - RendererRD::MaterialStorage::split_double(inst->transform.origin.z, &instance_data.transform[14], &instance_data.transform[11]); -#endif - bool cant_repeat = instance_data.flags & INSTANCE_DATA_FLAG_MULTIMESH || inst->mesh_instance.is_valid(); if (prev_surface != nullptr && !cant_repeat && prev_surface->sort.sort_key1 == surface->sort.sort_key1 && prev_surface->sort.sort_key2 == surface->sort.sort_key2 && inst->mirror == prev_surface->owner->mirror && repeats < RenderElementInfo::MAX_REPEATS) { diff --git a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp index 6bfbc2e0a7..b9edc46aee 100644 --- a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp +++ b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp @@ -2060,17 +2060,17 @@ void RenderForwardMobile::_render_list_template(RenderingDevice::DrawListID p_dr if (inst->store_transform_cache) { RendererRD::MaterialStorage::store_transform(inst->transform, push_constant.transform); - } else { - RendererRD::MaterialStorage::store_transform(Transform3D(), push_constant.transform); - } #ifdef REAL_T_IS_DOUBLE - // Split the origin into two components, the float approximation and the missing precision - // In the shader we will combine these back together to restore the lost precision. - RendererRD::MaterialStorage::split_double(inst->transform.origin.x, &push_constant.transform[12], &push_constant.transform[3]); - RendererRD::MaterialStorage::split_double(inst->transform.origin.y, &push_constant.transform[13], &push_constant.transform[7]); - RendererRD::MaterialStorage::split_double(inst->transform.origin.z, &push_constant.transform[14], &push_constant.transform[11]); + // Split the origin into two components, the float approximation and the missing precision + // In the shader we will combine these back together to restore the lost precision. + RendererRD::MaterialStorage::split_double(inst->transform.origin.x, &push_constant.transform[12], &push_constant.transform[3]); + RendererRD::MaterialStorage::split_double(inst->transform.origin.y, &push_constant.transform[13], &push_constant.transform[7]); + RendererRD::MaterialStorage::split_double(inst->transform.origin.z, &push_constant.transform[14], &push_constant.transform[11]); #endif + } else { + RendererRD::MaterialStorage::store_transform(Transform3D(), push_constant.transform); + } push_constant.flags = inst->flags_cache; push_constant.gi_offset = inst->gi_offset_cache; -- cgit v1.2.3 From 1a85f6398fe62f8879675ace2401bb7d1a4ff4c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Braz?= Date: Wed, 29 Mar 2023 10:17:15 -0300 Subject: Use MODELVIEW_MATRIX for vertex transform when double precision is enabled This commit updates the double precision vertex transform code from using the MODEL_MATRIX to now use the MODELVIEW_MATRIX instead. This can be made possible by transforming the MODELVIEW_MATRIX back into model space (ie, same space as the MODEL_MATRIX) and then using it as if it were the MODEL_MATRIX. With this in place we now properly handle VERTEX transformations that a Material Shader might do, such as billboard-ing. (cherry picked from commit 63c6f0b93ccc0f016b6b6ff7833c31371059a782) --- .../shaders/forward_clustered/scene_forward_clustered.glsl | 2 +- .../renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl b/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl index c8ad1f0312..0098b13d5b 100644 --- a/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl +++ b/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl @@ -360,7 +360,7 @@ void vertex_shader(in uint instance_index, in bool is_multimesh, in uint multime vertex = mat3(matrix) * vertex; model_origin = double_add_vec3(model_origin, model_precision, matrix[3].xyz, vec3(0.0), model_precision); } - vertex = mat3(model_matrix) * vertex; + vertex = mat3(inv_view_matrix * modelview) * vertex; vec3 temp_precision; // Will be ignored. vertex += double_add_vec3(model_origin, model_precision, scene_data.inv_view_matrix[3].xyz, view_precision, temp_precision); vertex = mat3(scene_data.view_matrix) * vertex; diff --git a/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl b/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl index a8b28bbd4f..80f05e7121 100644 --- a/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl +++ b/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl @@ -347,8 +347,6 @@ void main() { #CODE : VERTEX } - /* output */ - // using local coordinates (default) #if !defined(SKIP_TRANSFORM_USED) && !defined(VERTEX_WORLD_COORDS_USED) @@ -361,7 +359,7 @@ void main() { vertex = mat3(matrix) * vertex; model_origin = double_add_vec3(model_origin, model_precision, matrix[3].xyz, vec3(0.0), model_precision); } - vertex = mat3(model_matrix) * vertex; + vertex = mat3(inv_view_matrix * modelview) * vertex; vec3 temp_precision; vertex += double_add_vec3(model_origin, model_precision, scene_data.inv_view_matrix[3].xyz, view_precision, temp_precision); vertex = mat3(scene_data.view_matrix) * vertex; -- cgit v1.2.3 From ad5d7c2030bf44d54a854943d2a5f8a2a28ebe17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82?= Date: Wed, 12 Apr 2023 18:28:41 +0200 Subject: Fix Windows StringFileInfo structure (cherry picked from commit e15a086bb99f450fbfa223fe8896c47a860735fc) --- core/version.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/version.h b/core/version.h index 8ed7fe4af3..5ddb09284e 100644 --- a/core/version.h +++ b/core/version.h @@ -40,13 +40,13 @@ // Defines the main "branch" version. Patch versions in this branch should be // forward-compatible. // Example: "3.1" -#define VERSION_BRANCH "" _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR) +#define VERSION_BRANCH _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR) #if VERSION_PATCH // Example: "3.1.4" -#define VERSION_NUMBER "" VERSION_BRANCH "." _MKSTR(VERSION_PATCH) +#define VERSION_NUMBER VERSION_BRANCH "." _MKSTR(VERSION_PATCH) #else // patch is 0, we don't include it in the "pretty" version number. // Example: "3.1" instead of "3.1.0" -#define VERSION_NUMBER "" VERSION_BRANCH +#define VERSION_NUMBER VERSION_BRANCH #endif // VERSION_PATCH // Version number encoded as hexadecimal int with one byte for each number, @@ -57,16 +57,16 @@ // Describes the full configuration of that Godot version, including the version number, // the status (beta, stable, etc.) and potential module-specific features (e.g. mono). // Example: "3.1.4.stable.mono" -#define VERSION_FULL_CONFIG "" VERSION_NUMBER "." VERSION_STATUS VERSION_MODULE_CONFIG +#define VERSION_FULL_CONFIG VERSION_NUMBER "." VERSION_STATUS VERSION_MODULE_CONFIG // Similar to VERSION_FULL_CONFIG, but also includes the (potentially custom) VERSION_BUILD // description (e.g. official, custom_build, etc.). // Example: "3.1.4.stable.mono.official" -#define VERSION_FULL_BUILD "" VERSION_FULL_CONFIG "." VERSION_BUILD +#define VERSION_FULL_BUILD VERSION_FULL_CONFIG "." VERSION_BUILD // Same as above, but prepended with Godot's name and a cosmetic "v" for "version". // Example: "Godot v3.1.4.stable.official.mono" -#define VERSION_FULL_NAME "" VERSION_NAME " v" VERSION_FULL_BUILD +#define VERSION_FULL_NAME VERSION_NAME " v" VERSION_FULL_BUILD // Git commit hash, generated at build time in `core/version_hash.gen.cpp`. extern const char *const VERSION_HASH; -- cgit v1.2.3 From 756d809ef18224c4ade3d49bfb8120794533f049 Mon Sep 17 00:00:00 2001 From: Hakim Date: Wed, 12 Apr 2023 19:47:43 +0200 Subject: Change cursor consistently when panning in the 2D Editor (cherry picked from commit f4edbe634182916fd785b0897b8f309a5b9cc5ae) --- editor/plugins/canvas_item_editor_plugin.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 4814b9ae3b..9522ab6e7e 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -1239,6 +1239,7 @@ bool CanvasItemEditor::_gui_input_zoom_or_pan(const Ref &p_event, bo bool panner_active = panner->gui_input(p_event, warped_panning ? viewport->get_global_rect() : Rect2()); if (panner->is_panning() != pan_pressed) { pan_pressed = panner->is_panning(); + _update_cursor(); } if (panner_active) { -- cgit v1.2.3 From ebcc7b4b9883c287d5e90551b6a0704e74b71d6c Mon Sep 17 00:00:00 2001 From: kleonc <9283098+kleonc@users.noreply.github.com> Date: Sat, 25 Mar 2023 11:38:55 +0100 Subject: Fix OBJ mesh importer smoothing handling (cherry picked from commit e8900a2cac901d9b7d596af7be185eec54c7b858) --- editor/import/resource_importer_obj.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/editor/import/resource_importer_obj.cpp b/editor/import/resource_importer_obj.cpp index 3dd01754a3..89e2e36b77 100644 --- a/editor/import/resource_importer_obj.cpp +++ b/editor/import/resource_importer_obj.cpp @@ -245,6 +245,7 @@ static Error _parse_obj(const String &p_path, List> &r_meshes, bool p_ String current_group; uint32_t smooth_group = 0; bool smoothing = true; + const uint32_t no_smoothing_smooth_group = (uint32_t)-1; while (true) { String l = f->get_line().strip_edges(); @@ -349,10 +350,7 @@ static Error _parse_obj(const String &p_path, List> &r_meshes, bool p_ if (!colors.is_empty()) { surf_tool->set_color(colors[vtx]); } - if (!smoothing) { - smooth_group++; - } - surf_tool->set_smooth_group(smooth_group); + surf_tool->set_smooth_group(smoothing ? smooth_group : no_smoothing_smooth_group); surf_tool->add_vertex(vertex); } @@ -367,8 +365,10 @@ static Error _parse_obj(const String &p_path, List> &r_meshes, bool p_ do_smooth = true; } if (do_smooth != smoothing) { - smooth_group++; smoothing = do_smooth; + if (smoothing) { + smooth_group++; + } } } else if (/*l.begins_with("g ") ||*/ l.begins_with("usemtl ") || (l.begins_with("o ") || f->eof_reached())) { //commit group to mesh //groups are too annoying -- cgit v1.2.3 From 3fcaffc96bc00dedf350a0106ee44c74241efc80 Mon Sep 17 00:00:00 2001 From: Ninni Pipping Date: Thu, 13 Apr 2023 10:05:23 +0200 Subject: Fix `Image.compress` description Description mentioned `mode` instead of `source` (cherry picked from commit 6312fe2fae92718560b06c114803b18008a50839) --- doc/classes/Image.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml index 09911d58a8..896f9f9cf5 100644 --- a/doc/classes/Image.xml +++ b/doc/classes/Image.xml @@ -78,7 +78,7 @@ Compresses the image to use less memory. Can not directly access pixel data while the image is compressed. Returns error if the chosen compression mode is not available. - The [param mode] parameter helps to pick the best compression method for DXT and ETC2 formats. It is ignored for ASTC compression. + The [param source] parameter helps to pick the best compression method for DXT and ETC2 formats. It is ignored for ASTC compression. For ASTC compression, the [param astc_format] parameter must be supplied. -- cgit v1.2.3 From 3a5bc7455eddd87feb8a70d3270a16c69a2c90f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Thu, 19 Jan 2023 13:07:19 +0100 Subject: Make EditorToaster's handler thread-safe (cherry picked from commit 84183f89e6d204068484c86bad3f304c6249fa48) --- editor/editor_toaster.cpp | 17 +++++++++-------- editor/editor_toaster.h | 1 + 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/editor/editor_toaster.cpp b/editor/editor_toaster.cpp index 10c3e963af..866a6db2a6 100644 --- a/editor/editor_toaster.cpp +++ b/editor/editor_toaster.cpp @@ -145,6 +145,12 @@ void EditorToaster::_notification(int p_what) { } void EditorToaster::_error_handler(void *p_self, const char *p_func, const char *p_file, int p_line, const char *p_error, const char *p_errorexp, bool p_editor_notify, ErrorHandlerType p_type) { + // This may be called from a thread. Since we will deal with non-thread-safe elements, + // we have to put it in the queue for safety. + callable_mp_static(&EditorToaster::_error_handler_impl).bind(p_file, p_line, p_error, p_errorexp, p_editor_notify, p_type).call_deferred(); +} + +void EditorToaster::_error_handler_impl(const String &p_file, int p_line, const String &p_error, const String &p_errorexp, bool p_editor_notify, int p_type) { if (!EditorToaster::get_singleton() || !EditorToaster::get_singleton()->is_inside_tree()) { return; } @@ -158,13 +164,8 @@ void EditorToaster::_error_handler(void *p_self, const char *p_func, const char int show_all_setting = EDITOR_GET("interface/editor/show_internal_errors_in_toast_notifications"); if (p_editor_notify || (show_all_setting == 0 && in_dev) || show_all_setting == 1) { - String err_str; - if (p_errorexp && p_errorexp[0]) { - err_str = String::utf8(p_errorexp); - } else { - err_str = String::utf8(p_error); - } - String tooltip_str = String::utf8(p_file) + ":" + itos(p_line); + String err_str = !p_errorexp.is_empty() ? p_errorexp : p_error; + String tooltip_str = p_file + ":" + itos(p_line); if (!p_editor_notify) { if (p_type == ERR_HANDLER_WARNING) { @@ -174,7 +175,7 @@ void EditorToaster::_error_handler(void *p_self, const char *p_func, const char } } - Severity severity = (p_type == ERR_HANDLER_WARNING) ? SEVERITY_WARNING : SEVERITY_ERROR; + Severity severity = ((ErrorHandlerType)p_type == ERR_HANDLER_WARNING) ? SEVERITY_WARNING : SEVERITY_ERROR; EditorToaster::get_singleton()->popup_str(err_str, severity, tooltip_str); } } diff --git a/editor/editor_toaster.h b/editor/editor_toaster.h index 6b834f8288..4837756b4e 100644 --- a/editor/editor_toaster.h +++ b/editor/editor_toaster.h @@ -89,6 +89,7 @@ private: const double default_message_duration = 5.0; static void _error_handler(void *p_self, const char *p_func, const char *p_file, int p_line, const char *p_error, const char *p_errorexp, bool p_editor_notify, ErrorHandlerType p_type); + static void _error_handler_impl(const String &p_file, int p_line, const String &p_error, const String &p_errorexp, bool p_editor_notify, int p_type); void _update_vbox_position(); void _update_disable_notifications_button(); void _auto_hide_or_free_toasts(); -- cgit v1.2.3 From d31002cfbee5f33c335c329d24be8d82fb04bcc5 Mon Sep 17 00:00:00 2001 From: Danil Alexeev Date: Mon, 10 Apr 2023 09:54:53 +0300 Subject: GDScript: Add missing member type check when resolving `extends` (cherry picked from commit 66279b98b6c3418232003cc8d6c2e52af7a62ac4) --- modules/gdscript/gdscript_analyzer.cpp | 23 +++++++++++++++++++++- .../analyzer/errors/extend_non_class_constant_1.gd | 9 +++++++++ .../errors/extend_non_class_constant_1.out | 2 ++ .../analyzer/errors/extend_non_class_constant_2.gd | 12 +++++++++++ .../errors/extend_non_class_constant_2.out | 2 ++ .../scripts/analyzer/errors/extend_variable.gd | 9 +++++++++ .../scripts/analyzer/errors/extend_variable.out | 2 ++ 7 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 modules/gdscript/tests/scripts/analyzer/errors/extend_non_class_constant_1.gd create mode 100644 modules/gdscript/tests/scripts/analyzer/errors/extend_non_class_constant_1.out create mode 100644 modules/gdscript/tests/scripts/analyzer/errors/extend_non_class_constant_2.gd create mode 100644 modules/gdscript/tests/scripts/analyzer/errors/extend_non_class_constant_2.out create mode 100644 modules/gdscript/tests/scripts/analyzer/errors/extend_variable.gd create mode 100644 modules/gdscript/tests/scripts/analyzer/errors/extend_variable.out diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index c233d51801..b964bbce7e 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -478,7 +478,24 @@ Error GDScriptAnalyzer::resolve_class_inheritance(GDScriptParser::ClassNode *p_c } if (look_class->has_member(name)) { resolve_class_member(look_class, name, p_class); - base = look_class->get_member(name).get_datatype(); + GDScriptParser::ClassNode::Member member = look_class->get_member(name); + GDScriptParser::DataType member_datatype = member.get_datatype(); + + switch (member.type) { + case GDScriptParser::ClassNode::Member::CLASS: + break; // OK. + case GDScriptParser::ClassNode::Member::CONSTANT: + if (member_datatype.kind != GDScriptParser::DataType::SCRIPT && member_datatype.kind != GDScriptParser::DataType::CLASS) { + push_error(vformat(R"(Constant "%s" is not a preloaded script or class.)", name), p_class); + return ERR_PARSE_ERROR; + } + break; + default: + push_error(vformat(R"(Cannot use %s "%s" in extends chain.)", member.get_type_name(), name), p_class); + return ERR_PARSE_ERROR; + } + + base = member_datatype; found = true; break; } @@ -506,6 +523,10 @@ Error GDScriptAnalyzer::resolve_class_inheritance(GDScriptParser::ClassNode *p_c GDScriptParser::DataType id_type = id->get_datatype(); if (!id_type.is_set()) { push_error(vformat(R"(Could not find type "%s" under base "%s".)", id->name, base.to_string()), p_class); + return ERR_PARSE_ERROR; + } else if (id_type.kind != GDScriptParser::DataType::SCRIPT && id_type.kind != GDScriptParser::DataType::CLASS) { + push_error(vformat(R"(Identifier "%s" is not a preloaded script or class.)", id->name), p_class); + return ERR_PARSE_ERROR; } base = id_type; diff --git a/modules/gdscript/tests/scripts/analyzer/errors/extend_non_class_constant_1.gd b/modules/gdscript/tests/scripts/analyzer/errors/extend_non_class_constant_1.gd new file mode 100644 index 0000000000..72af099158 --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/errors/extend_non_class_constant_1.gd @@ -0,0 +1,9 @@ +# GH-75870 + +const A = 1 + +class B extends A: + pass + +func test(): + pass diff --git a/modules/gdscript/tests/scripts/analyzer/errors/extend_non_class_constant_1.out b/modules/gdscript/tests/scripts/analyzer/errors/extend_non_class_constant_1.out new file mode 100644 index 0000000000..65d629a35b --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/errors/extend_non_class_constant_1.out @@ -0,0 +1,2 @@ +GDTEST_ANALYZER_ERROR +Constant "A" is not a preloaded script or class. diff --git a/modules/gdscript/tests/scripts/analyzer/errors/extend_non_class_constant_2.gd b/modules/gdscript/tests/scripts/analyzer/errors/extend_non_class_constant_2.gd new file mode 100644 index 0000000000..fe334f8cb7 --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/errors/extend_non_class_constant_2.gd @@ -0,0 +1,12 @@ +# GH-75870 + +class A: + const X = 1 + +const Y = A.X # A.X is now resolved. + +class B extends A.X: + pass + +func test(): + pass diff --git a/modules/gdscript/tests/scripts/analyzer/errors/extend_non_class_constant_2.out b/modules/gdscript/tests/scripts/analyzer/errors/extend_non_class_constant_2.out new file mode 100644 index 0000000000..951cfb1ea4 --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/errors/extend_non_class_constant_2.out @@ -0,0 +1,2 @@ +GDTEST_ANALYZER_ERROR +Identifier "X" is not a preloaded script or class. diff --git a/modules/gdscript/tests/scripts/analyzer/errors/extend_variable.gd b/modules/gdscript/tests/scripts/analyzer/errors/extend_variable.gd new file mode 100644 index 0000000000..6574d4cf31 --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/errors/extend_variable.gd @@ -0,0 +1,9 @@ +# GH-75870 + +var A = 1 + +class B extends A: + pass + +func test(): + pass diff --git a/modules/gdscript/tests/scripts/analyzer/errors/extend_variable.out b/modules/gdscript/tests/scripts/analyzer/errors/extend_variable.out new file mode 100644 index 0000000000..7b39af6979 --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/errors/extend_variable.out @@ -0,0 +1,2 @@ +GDTEST_ANALYZER_ERROR +Cannot use variable "A" in extends chain. -- cgit v1.2.3 From 2c773e12b8122edd58a32c67febeb470434f89dd Mon Sep 17 00:00:00 2001 From: clayjohn Date: Wed, 12 Apr 2023 11:35:25 -0700 Subject: Use angle_rand to calculate base_angle in particles process material (cherry picked from commit 821917ba9f30b036ef7f43664db3f09d33f59109) --- scene/2d/cpu_particles_2d.cpp | 4 ++-- scene/3d/cpu_particles_3d.cpp | 4 ++-- scene/resources/particle_process_material.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scene/2d/cpu_particles_2d.cpp b/scene/2d/cpu_particles_2d.cpp index 04c7555306..b86635b82b 100644 --- a/scene/2d/cpu_particles_2d.cpp +++ b/scene/2d/cpu_particles_2d.cpp @@ -722,12 +722,12 @@ void CPUParticles2D::_particles_process(double p_delta) { tex_linear_velocity = curve_parameters[PARAM_INITIAL_LINEAR_VELOCITY]->sample(0); }*/ - real_t tex_angle = 0.0; + real_t tex_angle = 1.0; if (curve_parameters[PARAM_ANGLE].is_valid()) { tex_angle = curve_parameters[PARAM_ANGLE]->sample(tv); } - real_t tex_anim_offset = 0.0; + real_t tex_anim_offset = 1.0; if (curve_parameters[PARAM_ANGLE].is_valid()) { tex_anim_offset = curve_parameters[PARAM_ANGLE]->sample(tv); } diff --git a/scene/3d/cpu_particles_3d.cpp b/scene/3d/cpu_particles_3d.cpp index 23855b2d8e..2ee62920ed 100644 --- a/scene/3d/cpu_particles_3d.cpp +++ b/scene/3d/cpu_particles_3d.cpp @@ -742,12 +742,12 @@ void CPUParticles3D::_particles_process(double p_delta) { tex_linear_velocity = curve_parameters[PARAM_INITIAL_LINEAR_VELOCITY]->sample(0); }*/ - real_t tex_angle = 0.0; + real_t tex_angle = 1.0; if (curve_parameters[PARAM_ANGLE].is_valid()) { tex_angle = curve_parameters[PARAM_ANGLE]->sample(tv); } - real_t tex_anim_offset = 0.0; + real_t tex_anim_offset = 1.0; if (curve_parameters[PARAM_ANGLE].is_valid()) { tex_anim_offset = curve_parameters[PARAM_ANGLE]->sample(tv); } diff --git a/scene/resources/particle_process_material.cpp b/scene/resources/particle_process_material.cpp index 7ae154ea1d..41edbcb726 100644 --- a/scene/resources/particle_process_material.cpp +++ b/scene/resources/particle_process_material.cpp @@ -419,7 +419,7 @@ void ParticleProcessMaterial::_update_shader() { if (tex_parameters[PARAM_ANGLE].is_valid()) { code += " float tex_angle = textureLod(angle_texture, vec2(0.0, 0.0), 0.0).r;\n"; } else { - code += " float tex_angle = 0.0;\n"; + code += " float tex_angle = 1.0;\n"; } if (tex_parameters[PARAM_ANIM_OFFSET].is_valid()) { @@ -737,7 +737,7 @@ void ParticleProcessMaterial::_update_shader() { code += " VELOCITY = normalize(VELOCITY) * v;\n"; code += " }\n"; code += " }\n"; - code += " float base_angle = (tex_angle) * mix(initial_angle_min, initial_angle_max, rand_from_seed(alt_seed));\n"; + code += " float base_angle = (tex_angle) * mix(initial_angle_min, initial_angle_max, angle_rand);\n"; code += " base_angle += CUSTOM.y * LIFETIME * (tex_angular_velocity) * mix(angular_velocity_min,angular_velocity_max, rand_from_seed(alt_seed));\n"; code += " CUSTOM.x = base_angle * degree_to_rad;\n"; // angle code += " CUSTOM.z = (tex_anim_offset) * mix(anim_offset_min, anim_offset_max, rand_from_seed(alt_seed)) + tv * tex_anim_speed * mix(anim_speed_min, anim_speed_max, rand_from_seed(alt_seed));\n"; // angle -- cgit v1.2.3 From 3a1af9393f0accfed8d05a257e2ff8af6b2e7050 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Tue, 11 Apr 2023 10:07:00 +0300 Subject: [TextServer] Improve BiDi error handling. (cherry picked from commit d8d88e15300de05119a6d782067578e6e05d52e5) --- modules/text_server_adv/text_server_adv.cpp | 98 +++++++++++++++++++---------- modules/text_server_adv/text_server_adv.h | 4 +- 2 files changed, 67 insertions(+), 35 deletions(-) diff --git a/modules/text_server_adv/text_server_adv.cpp b/modules/text_server_adv/text_server_adv.cpp index c1a1d8e048..ae32a08c58 100644 --- a/modules/text_server_adv/text_server_adv.cpp +++ b/modules/text_server_adv/text_server_adv.cpp @@ -4149,22 +4149,37 @@ bool TextServerAdvanced::_shape_substr(ShapedTextDataAdvanced *p_new_sd, const S ERR_FAIL_COND_V_MSG((start < 0 || end - start > p_new_sd->utf16.length()), false, "Invalid BiDi override range."); // Create temporary line bidi & shape. - UBiDi *bidi_iter = ubidi_openSized(end - start, 0, &err); - ERR_FAIL_COND_V_MSG(U_FAILURE(err), false, u_errorName(err)); - ubidi_setLine(p_sd->bidi_iter[ov], start, end, bidi_iter, &err); - if (U_FAILURE(err)) { - ubidi_close(bidi_iter); - ERR_FAIL_V_MSG(false, u_errorName(err)); + UBiDi *bidi_iter = nullptr; + if (p_sd->bidi_iter[ov]) { + bidi_iter = ubidi_openSized(end - start, 0, &err); + if (U_SUCCESS(err)) { + ubidi_setLine(p_sd->bidi_iter[ov], start, end, bidi_iter, &err); + if (U_FAILURE(err)) { + ubidi_close(bidi_iter); + bidi_iter = nullptr; + ERR_PRINT(vformat("BiDi reordering for the line failed: %s", u_errorName(err))); + } + } else { + bidi_iter = nullptr; + ERR_PRINT(vformat("BiDi iterator allocation for the line failed: %s", u_errorName(err))); + } } p_new_sd->bidi_iter.push_back(bidi_iter); err = U_ZERO_ERROR; - int bidi_run_count = ubidi_countRuns(bidi_iter, &err); - ERR_FAIL_COND_V_MSG(U_FAILURE(err), false, u_errorName(err)); + int bidi_run_count = 1; + if (bidi_iter) { + bidi_run_count = ubidi_countRuns(bidi_iter, &err); + if (U_FAILURE(err)) { + ERR_PRINT(u_errorName(err)); + } + } for (int i = 0; i < bidi_run_count; i++) { int32_t _bidi_run_start = 0; - int32_t _bidi_run_length = 0; - ubidi_getVisualRun(bidi_iter, i, &_bidi_run_start, &_bidi_run_length); + int32_t _bidi_run_length = end - start; + if (bidi_iter) { + ubidi_getVisualRun(bidi_iter, i, &_bidi_run_start, &_bidi_run_length); + } int32_t bidi_run_start = _convert_pos(p_sd, ov_start + start + _bidi_run_start); int32_t bidi_run_end = _convert_pos(p_sd, ov_start + start + _bidi_run_start + _bidi_run_length); @@ -5609,38 +5624,53 @@ bool TextServerAdvanced::_shaped_text_shape(const RID &p_shaped) { UErrorCode err = U_ZERO_ERROR; UBiDi *bidi_iter = ubidi_openSized(end - start, 0, &err); - ERR_FAIL_COND_V_MSG(U_FAILURE(err), false, u_errorName(err)); - - switch (static_cast(sd->bidi_override[ov].z)) { - case DIRECTION_LTR: { - ubidi_setPara(bidi_iter, data + start, end - start, UBIDI_LTR, nullptr, &err); - } break; - case DIRECTION_RTL: { - ubidi_setPara(bidi_iter, data + start, end - start, UBIDI_RTL, nullptr, &err); - } break; - case DIRECTION_INHERITED: { - ubidi_setPara(bidi_iter, data + start, end - start, base_para_direction, nullptr, &err); - } break; - case DIRECTION_AUTO: { - UBiDiDirection direction = ubidi_getBaseDirection(data + start, end - start); - if (direction != UBIDI_NEUTRAL) { - ubidi_setPara(bidi_iter, data + start, end - start, direction, nullptr, &err); - } else { + if (U_SUCCESS(err)) { + switch (static_cast(sd->bidi_override[ov].z)) { + case DIRECTION_LTR: { + ubidi_setPara(bidi_iter, data + start, end - start, UBIDI_LTR, nullptr, &err); + } break; + case DIRECTION_RTL: { + ubidi_setPara(bidi_iter, data + start, end - start, UBIDI_RTL, nullptr, &err); + } break; + case DIRECTION_INHERITED: { ubidi_setPara(bidi_iter, data + start, end - start, base_para_direction, nullptr, &err); - } - } break; + } break; + case DIRECTION_AUTO: { + UBiDiDirection direction = ubidi_getBaseDirection(data + start, end - start); + if (direction != UBIDI_NEUTRAL) { + ubidi_setPara(bidi_iter, data + start, end - start, direction, nullptr, &err); + } else { + ubidi_setPara(bidi_iter, data + start, end - start, base_para_direction, nullptr, &err); + } + } break; + } + if (U_FAILURE(err)) { + ubidi_close(bidi_iter); + bidi_iter = nullptr; + ERR_PRINT(vformat("BiDi reordering for the paragraph failed: %s", u_errorName(err))); + } + } else { + bidi_iter = nullptr; + ERR_PRINT(vformat("BiDi iterator allocation for the paragraph failed: %s", u_errorName(err))); } - ERR_FAIL_COND_V_MSG(U_FAILURE(err), false, u_errorName(err)); sd->bidi_iter.push_back(bidi_iter); err = U_ZERO_ERROR; - int bidi_run_count = ubidi_countRuns(bidi_iter, &err); - ERR_FAIL_COND_V_MSG(U_FAILURE(err), false, u_errorName(err)); + int bidi_run_count = 1; + if (bidi_iter) { + bidi_run_count = ubidi_countRuns(bidi_iter, &err); + if (U_FAILURE(err)) { + ERR_PRINT(u_errorName(err)); + } + } for (int i = 0; i < bidi_run_count; i++) { int32_t _bidi_run_start = 0; - int32_t _bidi_run_length = 0; + int32_t _bidi_run_length = end - start; + bool is_rtl = false; hb_direction_t bidi_run_direction = HB_DIRECTION_INVALID; - bool is_rtl = (ubidi_getVisualRun(bidi_iter, i, &_bidi_run_start, &_bidi_run_length) == UBIDI_LTR); + if (bidi_iter) { + is_rtl = (ubidi_getVisualRun(bidi_iter, i, &_bidi_run_start, &_bidi_run_length) == UBIDI_LTR); + } switch (sd->orientation) { case ORIENTATION_HORIZONTAL: { if (is_rtl) { diff --git a/modules/text_server_adv/text_server_adv.h b/modules/text_server_adv/text_server_adv.h index ce08cf7694..046a85d2f7 100644 --- a/modules/text_server_adv/text_server_adv.h +++ b/modules/text_server_adv/text_server_adv.h @@ -514,7 +514,9 @@ class TextServerAdvanced : public TextServerExtension { ~ShapedTextDataAdvanced() { for (int i = 0; i < bidi_iter.size(); i++) { - ubidi_close(bidi_iter[i]); + if (bidi_iter[i]) { + ubidi_close(bidi_iter[i]); + } } if (script_iter) { memdelete(script_iter); -- cgit v1.2.3 From 9c1ea280927a1376cd31e1b0dfe7ca5abd12e693 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Wed, 12 Apr 2023 11:39:05 +0300 Subject: Improve line BiDi handling, prevent crash on recursive log updates. (cherry picked from commit 282e4231c26c172b186a5bf22a8ba7f0337ba3d6) --- editor/editor_log.cpp | 5 ++++ modules/text_server_adv/text_server_adv.cpp | 45 ++++++++++++++++++++++------- modules/text_server_adv/text_server_adv.h | 1 + scene/gui/rich_text_label.cpp | 11 +++++++ scene/gui/rich_text_label.h | 2 ++ 5 files changed, 54 insertions(+), 10 deletions(-) diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp index 4ee28c5c31..cc88424c55 100644 --- a/editor/editor_log.cpp +++ b/editor/editor_log.cpp @@ -278,6 +278,11 @@ void EditorLog::_add_log_line(LogMessage &p_message, bool p_replace_previous) { return; } + if (unlikely(log->is_updating())) { + // The new message arrived during log RTL text processing/redraw (invalid BiDi control characters / font error), ignore it to avoid RTL data corruption. + return; + } + // Only add the message to the log if it passes the filters. bool filter_active = type_filter_map[p_message.type]->is_active(); String search_text = search_box->get_text(); diff --git a/modules/text_server_adv/text_server_adv.cpp b/modules/text_server_adv/text_server_adv.cpp index ae32a08c58..e1aa467fdc 100644 --- a/modules/text_server_adv/text_server_adv.cpp +++ b/modules/text_server_adv/text_server_adv.cpp @@ -4105,6 +4105,7 @@ RID TextServerAdvanced::_shaped_text_substr(const RID &p_shaped, int64_t p_start new_sd->direction = sd->direction; new_sd->custom_punct = sd->custom_punct; new_sd->para_direction = sd->para_direction; + new_sd->base_para_direction = sd->base_para_direction; for (int i = 0; i < TextServer::SPACING_MAX; i++) { new_sd->extra_spacing[i] = sd->extra_spacing[i]; } @@ -4155,9 +4156,33 @@ bool TextServerAdvanced::_shape_substr(ShapedTextDataAdvanced *p_new_sd, const S if (U_SUCCESS(err)) { ubidi_setLine(p_sd->bidi_iter[ov], start, end, bidi_iter, &err); if (U_FAILURE(err)) { - ubidi_close(bidi_iter); - bidi_iter = nullptr; - ERR_PRINT(vformat("BiDi reordering for the line failed: %s", u_errorName(err))); + // Line BiDi failed (string contains incompatible control characters), try full paragraph BiDi instead. + err = U_ZERO_ERROR; + const UChar *data = p_sd->utf16.get_data(); + switch (static_cast(p_sd->bidi_override[ov].z)) { + case DIRECTION_LTR: { + ubidi_setPara(bidi_iter, data + start, end - start, UBIDI_LTR, nullptr, &err); + } break; + case DIRECTION_RTL: { + ubidi_setPara(bidi_iter, data + start, end - start, UBIDI_RTL, nullptr, &err); + } break; + case DIRECTION_INHERITED: { + ubidi_setPara(bidi_iter, data + start, end - start, p_sd->base_para_direction, nullptr, &err); + } break; + case DIRECTION_AUTO: { + UBiDiDirection direction = ubidi_getBaseDirection(data + start, end - start); + if (direction != UBIDI_NEUTRAL) { + ubidi_setPara(bidi_iter, data + start, end - start, direction, nullptr, &err); + } else { + ubidi_setPara(bidi_iter, data + start, end - start, p_sd->base_para_direction, nullptr, &err); + } + } break; + } + if (U_FAILURE(err)) { + ubidi_close(bidi_iter); + bidi_iter = nullptr; + ERR_PRINT(vformat("BiDi reordering for the line failed: %s", u_errorName(err))); + } } } else { bidi_iter = nullptr; @@ -5586,25 +5611,25 @@ bool TextServerAdvanced::_shaped_text_shape(const RID &p_shaped) { sd->script_iter = memnew(ScriptIterator(sd->text, 0, sd->text.length())); } - int base_para_direction = UBIDI_DEFAULT_LTR; + sd->base_para_direction = UBIDI_DEFAULT_LTR; switch (sd->direction) { case DIRECTION_LTR: { sd->para_direction = DIRECTION_LTR; - base_para_direction = UBIDI_LTR; + sd->base_para_direction = UBIDI_LTR; } break; case DIRECTION_RTL: { sd->para_direction = DIRECTION_RTL; - base_para_direction = UBIDI_RTL; + sd->base_para_direction = UBIDI_RTL; } break; case DIRECTION_INHERITED: case DIRECTION_AUTO: { UBiDiDirection direction = ubidi_getBaseDirection(data, sd->utf16.length()); if (direction != UBIDI_NEUTRAL) { sd->para_direction = (direction == UBIDI_RTL) ? DIRECTION_RTL : DIRECTION_LTR; - base_para_direction = direction; + sd->base_para_direction = direction; } else { sd->para_direction = DIRECTION_LTR; - base_para_direction = UBIDI_DEFAULT_LTR; + sd->base_para_direction = UBIDI_DEFAULT_LTR; } } break; } @@ -5633,14 +5658,14 @@ bool TextServerAdvanced::_shaped_text_shape(const RID &p_shaped) { ubidi_setPara(bidi_iter, data + start, end - start, UBIDI_RTL, nullptr, &err); } break; case DIRECTION_INHERITED: { - ubidi_setPara(bidi_iter, data + start, end - start, base_para_direction, nullptr, &err); + ubidi_setPara(bidi_iter, data + start, end - start, sd->base_para_direction, nullptr, &err); } break; case DIRECTION_AUTO: { UBiDiDirection direction = ubidi_getBaseDirection(data + start, end - start); if (direction != UBIDI_NEUTRAL) { ubidi_setPara(bidi_iter, data + start, end - start, direction, nullptr, &err); } else { - ubidi_setPara(bidi_iter, data + start, end - start, base_para_direction, nullptr, &err); + ubidi_setPara(bidi_iter, data + start, end - start, sd->base_para_direction, nullptr, &err); } } break; } diff --git a/modules/text_server_adv/text_server_adv.h b/modules/text_server_adv/text_server_adv.h index 046a85d2f7..dff87f3d74 100644 --- a/modules/text_server_adv/text_server_adv.h +++ b/modules/text_server_adv/text_server_adv.h @@ -475,6 +475,7 @@ class TextServerAdvanced : public TextServerExtension { /* Shaped data */ TextServer::Direction para_direction = DIRECTION_LTR; // Detected text direction. + int base_para_direction = UBIDI_DEFAULT_LTR; bool valid = false; // String is shaped. bool line_breaks_valid = false; // Line and word break flags are populated (and virtual zero width spaces inserted). bool justification_ops_valid = false; // Virtual elongation glyphs are added to the string. diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 81ef8dee36..cf7b6cf608 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -2697,6 +2697,10 @@ bool RichTextLabel::is_ready() const { return (main->first_invalid_line.load() == (int)main->lines.size() && main->first_resized_line.load() == (int)main->lines.size() && main->first_invalid_font_line.load() == (int)main->lines.size()); } +bool RichTextLabel::is_updating() const { + return updating.load() || validating.load(); +} + void RichTextLabel::set_threaded(bool p_threaded) { if (threaded != p_threaded) { _stop_thread(); @@ -2721,6 +2725,7 @@ bool RichTextLabel::_validate_line_caches() { if (updating.load()) { return false; } + validating.store(true); if (main->first_invalid_line.load() == (int)main->lines.size()) { MutexLock data_lock(data_mutex); Rect2 text_rect = _get_text_rect(); @@ -2739,6 +2744,7 @@ bool RichTextLabel::_validate_line_caches() { if (main->first_resized_line.load() == (int)main->lines.size()) { vscroll->set_value(old_scroll); + validating.store(false); return true; } @@ -2790,8 +2796,10 @@ bool RichTextLabel::_validate_line_caches() { if (fit_content) { update_minimum_size(); } + validating.store(false); return true; } + validating.store(false); stop_thread.store(false); if (threaded) { updating.store(true); @@ -2801,7 +2809,9 @@ bool RichTextLabel::_validate_line_caches() { loading_started = OS::get_singleton()->get_ticks_msec(); return false; } else { + updating.store(true); _process_line_caches(); + updating.store(false); queue_redraw(); return true; } @@ -5882,6 +5892,7 @@ RichTextLabel::RichTextLabel(const String &p_text) { set_text(p_text); updating.store(false); + validating.store(false); stop_thread.store(false); set_clip_contents(true); diff --git a/scene/gui/rich_text_label.h b/scene/gui/rich_text_label.h index 1dae8b75ca..5a9a8478b7 100644 --- a/scene/gui/rich_text_label.h +++ b/scene/gui/rich_text_label.h @@ -376,6 +376,7 @@ private: bool threaded = false; std::atomic stop_thread; std::atomic updating; + std::atomic validating; std::atomic loaded; uint64_t loading_started = 0; @@ -679,6 +680,7 @@ public: void deselect(); bool is_ready() const; + bool is_updating() const; void set_threaded(bool p_threaded); bool is_threaded() const; -- cgit v1.2.3 From a27b427b1fffb1f66d082ceb33372d35ce9697d6 Mon Sep 17 00:00:00 2001 From: Tae Hong Ahn <33810422+taehong99@users.noreply.github.com> Date: Sat, 15 Apr 2023 18:25:10 -0400 Subject: update set_smooth_group description fixes https://github.com/godotengine/godot/issues/74452 (cherry picked from commit 5a775ac08cfe02dc8015768bdf69e9e59d85030f) --- doc/classes/SurfaceTool.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/classes/SurfaceTool.xml b/doc/classes/SurfaceTool.xml index 5b567dbc28..9eb3dba731 100644 --- a/doc/classes/SurfaceTool.xml +++ b/doc/classes/SurfaceTool.xml @@ -242,6 +242,7 @@ Specifies the smooth group to use for the [i]next[/i] vertex. If this is never called, all vertices will have the default smooth group of [code]0[/code] and will be smoothed with adjacent vertices of the same group. To produce a mesh with flat normals, set the smooth group to [code]-1[/code]. + [b]Note:[/b] This function actually takes an [code]uint32_t[/code], so C# users should use [code]uint32.MaxValue[/code] instead of [code]-1[/code] to produce a mesh with flat normals. -- cgit v1.2.3 From 12da78cf3044faec0cdaf7c7dcae55f9295ccfe0 Mon Sep 17 00:00:00 2001 From: Rattle22 Date: Fri, 7 Apr 2023 12:24:31 +0200 Subject: Fix Typo in NavigationServer2D (cherry picked from commit 5c387cbdb3653bbe44a9fdde5ff8ca559f4b12b1) --- doc/classes/NavigationServer2D.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/classes/NavigationServer2D.xml b/doc/classes/NavigationServer2D.xml index 60d473a103..024b8d5a2b 100644 --- a/doc/classes/NavigationServer2D.xml +++ b/doc/classes/NavigationServer2D.xml @@ -10,7 +10,7 @@ For two regions to be connected to each other, they must share a similar edge. An edge is considered connected to another if both of its two vertices are at a distance less than [code]edge_connection_margin[/code] to the respective other edge's vertex. You may assign navigation layers to regions with [method NavigationServer2D.region_set_navigation_layers], which then can be checked upon when requesting a path with [method NavigationServer2D.map_get_path]. This allows allowing or forbidding some areas to 2D objects. To use the collision avoidance system, you may use agents. You can set an agent's target velocity, then the servers will emit a callback with a modified velocity. - [b]Note:[/b] The collision avoidance system ignores regions. Using the modified velocity as-is might lead to pushing and agent outside of a navigable area. This is a limitation of the collision avoidance system, any more complex situation may require the use of the physics engine. + [b]Note:[/b] The collision avoidance system ignores regions. Using the modified velocity as-is might lead to pushing an agent outside of a navigable area. This is a limitation of the collision avoidance system, any more complex situation may require the use of the physics engine. This server keeps tracks of any call and executes them during the sync phase. This means that you can request any change to the map, using any thread, without worrying. -- cgit v1.2.3 From c6297f46fe236abbd6c6b06bb9b6bfaa239b49a5 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Fri, 14 Apr 2023 14:39:35 +0800 Subject: Unify descriptions of vector methods * is_equal_approx * normalize * length_squared * posmod * posmodv (cherry picked from commit 6cd8e706fae5dacc908efd1a823e3447e01bfa56) --- core/variant/variant_call.cpp | 2 +- doc/classes/Vector2.xml | 4 ++-- doc/classes/Vector4.xml | 11 ++++++----- doc/classes/Vector4i.xml | 3 ++- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/core/variant/variant_call.cpp b/core/variant/variant_call.cpp index 0c0c8f657a..c3617d4598 100644 --- a/core/variant/variant_call.cpp +++ b/core/variant/variant_call.cpp @@ -1906,7 +1906,7 @@ static void _register_variant_builtin_methods() { bind_method(Vector4, distance_squared_to, sarray("to"), varray()); bind_method(Vector4, dot, sarray("with"), varray()); bind_method(Vector4, inverse, sarray(), varray()); - bind_method(Vector4, is_equal_approx, sarray("with"), varray()); + bind_method(Vector4, is_equal_approx, sarray("to"), varray()); bind_method(Vector4, is_zero_approx, sarray(), varray()); bind_method(Vector4, is_finite, sarray(), varray()); diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml index fe85ad7df6..9988b892db 100644 --- a/doc/classes/Vector2.xml +++ b/doc/classes/Vector2.xml @@ -214,7 +214,7 @@ - Returns [code]true[/code] if this vector and [code]v[/code] are approximately equal, by running [method @GlobalScope.is_equal_approx] on each component. + Returns [code]true[/code] if this vector and [param to] are approximately equal, by running [method @GlobalScope.is_equal_approx] on each component. @@ -288,7 +288,7 @@ Returns the result of scaling the vector to unit length. Equivalent to [code]v / v.length()[/code]. See also [method is_normalized]. - [b]Note:[/b] This function may return incorrect values if the initial vector length is near zero. + [b]Note:[/b] This function may return incorrect values if the input vector length is near zero. diff --git a/doc/classes/Vector4.xml b/doc/classes/Vector4.xml index 7f71dc23ec..cb7a5b2b2d 100644 --- a/doc/classes/Vector4.xml +++ b/doc/classes/Vector4.xml @@ -131,9 +131,9 @@ - + - Returns [code]true[/code] if this vector and [param with] are approximately equal, by running [method @GlobalScope.is_equal_approx] on each component. + Returns [code]true[/code] if this vector and [param to] are approximately equal, by running [method @GlobalScope.is_equal_approx] on each component. @@ -164,7 +164,8 @@ - Returns the squared length (squared magnitude) of this vector. This method runs faster than [method length]. + Returns the squared length (squared magnitude) of this vector. + This method runs faster than [method length], so prefer it if you need to compare vectors or need the squared distance for some formula. @@ -198,14 +199,14 @@ - Returns a new vector composed of the [method @GlobalScope.fposmod] of this vector's components and [param mod]. + Returns a vector composed of the [method @GlobalScope.fposmod] of this vector's components and [param mod]. - Returns a new vector composed of the [method @GlobalScope.fposmod] of this vector's components and [param modv]'s components. + Returns a vector composed of the [method @GlobalScope.fposmod] of this vector's components and [param modv]'s components. diff --git a/doc/classes/Vector4i.xml b/doc/classes/Vector4i.xml index 0885525d7c..92e01c7ce4 100644 --- a/doc/classes/Vector4i.xml +++ b/doc/classes/Vector4i.xml @@ -65,7 +65,8 @@ - Returns the squared length (squared magnitude) of this vector. This method runs faster than [method length]. + Returns the squared length (squared magnitude) of this vector. + This method runs faster than [method length], so prefer it if you need to compare vectors or need the squared distance for some formula. -- cgit v1.2.3 From d46cb8e65cf6f9356f190699b11d386719aba7ed Mon Sep 17 00:00:00 2001 From: Evgeniy Vasilyev Date: Sun, 16 Apr 2023 19:37:39 +0300 Subject: Fixed typo in DisplayServer.ScreenOrientation docs (cherry picked from commit 5ba98e59f076729876001de30ebd980434cd4fc7) --- doc/classes/DisplayServer.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml index 7872c53af6..6586d9b314 100644 --- a/doc/classes/DisplayServer.xml +++ b/doc/classes/DisplayServer.xml @@ -1575,7 +1575,7 @@ Default landscape orientation. - Default portrait orienstation. + Default portrait orientation. Reverse landscape orientation (upside down). -- cgit v1.2.3 From 4a140b61f17bbe742eb280be305366f7c597cd05 Mon Sep 17 00:00:00 2001 From: Yuri Sizov Date: Thu, 13 Apr 2023 15:26:50 +0200 Subject: Use Point2 consistently in Control methods While Size2 and Point2 are just aliases, which is why this doesn't fail compilation, it's nice to have things consistent. (cherry picked from commit 4fed87320cf8e1a87fc6c54bf15cef6f610e6091) --- scene/gui/control.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 3ecb9c47c0..8aee6144fc 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -765,7 +765,7 @@ void Control::set_anchor_and_offset(Side p_side, real_t p_anchor, real_t p_pos, set_offset(p_side, p_pos); } -void Control::set_begin(const Size2 &p_point) { +void Control::set_begin(const Point2 &p_point) { ERR_FAIL_COND(!isfinite(p_point.x) || !isfinite(p_point.y)); if (data.offset[0] == p_point.x && data.offset[1] == p_point.y) { return; @@ -776,11 +776,11 @@ void Control::set_begin(const Size2 &p_point) { _size_changed(); } -Size2 Control::get_begin() const { - return Size2(data.offset[0], data.offset[1]); +Point2 Control::get_begin() const { + return Point2(data.offset[0], data.offset[1]); } -void Control::set_end(const Size2 &p_point) { +void Control::set_end(const Point2 &p_point) { if (data.offset[2] == p_point.x && data.offset[3] == p_point.y) { return; } @@ -790,8 +790,8 @@ void Control::set_end(const Size2 &p_point) { _size_changed(); } -Size2 Control::get_end() const { - return Size2(data.offset[2], data.offset[3]); +Point2 Control::get_end() const { + return Point2(data.offset[2], data.offset[3]); } void Control::set_h_grow_direction(GrowDirection p_direction) { @@ -1358,11 +1358,11 @@ void Control::set_grow_direction_preset(LayoutPreset p_preset) { /// Manual positioning. -void Control::_set_position(const Size2 &p_point) { +void Control::_set_position(const Point2 &p_point) { set_position(p_point); } -void Control::set_position(const Size2 &p_point, bool p_keep_offsets) { +void Control::set_position(const Point2 &p_point, bool p_keep_offsets) { if (p_keep_offsets) { _compute_anchors(Rect2(p_point, data.size_cache), data.offset, data.anchor); } else { -- cgit v1.2.3 From d936cc8b9eb470faa6b9d38982128806321028cc Mon Sep 17 00:00:00 2001 From: angel-721 Date: Sun, 16 Apr 2023 17:42:21 -0600 Subject: Rename internal root canvas group to start with underscore (cherry picked from commit e347d7d64d1a6f9fe9993b93f88f7af19cd784dd) --- scene/main/canvas_item.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/main/canvas_item.cpp b/scene/main/canvas_item.cpp index 419e5d5c06..de76d3610d 100644 --- a/scene/main/canvas_item.cpp +++ b/scene/main/canvas_item.cpp @@ -219,7 +219,7 @@ void CanvasItem::_enter_canvas() { RenderingServer::get_singleton()->canvas_item_set_parent(canvas_item, canvas); RenderingServer::get_singleton()->canvas_item_set_visibility_layer(canvas_item, visibility_layer); - canvas_group = "root_canvas" + itos(canvas.get_id()); + canvas_group = "_root_canvas" + itos(canvas.get_id()); add_to_group(canvas_group); if (canvas_layer) { -- cgit v1.2.3 From 13cfbe6a256ef156c39a70974f01e1388629711f Mon Sep 17 00:00:00 2001 From: kleonc <9283098+kleonc@users.noreply.github.com> Date: Fri, 7 Apr 2023 16:37:20 +0200 Subject: Fix deserializing resource usage debug data (cherry picked from commit 3e7752463aed5adc59dc0f962e541b691800315f) --- servers/debugger/servers_debugger.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/servers/debugger/servers_debugger.cpp b/servers/debugger/servers_debugger.cpp index 75452be49b..e1bdba0595 100644 --- a/servers/debugger/servers_debugger.cpp +++ b/servers/debugger/servers_debugger.cpp @@ -56,15 +56,17 @@ Array ServersDebugger::ResourceUsage::serialize() { bool ServersDebugger::ResourceUsage::deserialize(const Array &p_arr) { CHECK_SIZE(p_arr, 1, "ResourceUsage"); uint32_t size = p_arr[0]; - CHECK_SIZE(p_arr, size, "ResourceUsage"); - int idx = 1; - for (uint32_t i = 0; i < size / 4; i++) { + ERR_FAIL_COND_V(size % 4, false); + CHECK_SIZE(p_arr, 1 + size, "ResourceUsage"); + uint32_t idx = 1; + while (idx < 1 + size) { ResourceInfo info; info.path = p_arr[idx]; info.format = p_arr[idx + 1]; info.type = p_arr[idx + 2]; info.vram = p_arr[idx + 3]; infos.push_back(info); + idx += 4; } CHECK_END(p_arr, idx, "ResourceUsage"); return true; -- cgit v1.2.3 From 83c39632352c0a65d9297ebbb47dd76a28ec1bdf Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sun, 16 Apr 2023 16:28:30 +0200 Subject: Improve `print_rich()` documentation - List all supported colors. - Mention URL tag support limitations. - Fix and tweak code example to do what it says. - Remove outdated notice about lack of Windows support (but mention that only Windows 10 and later support ANSI code conversion). (cherry picked from commit ec277d804e381b3bc5d44b88050e522c727ed505) --- doc/classes/@GlobalScope.xml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 12b5493589..73f1fe9ad6 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -826,17 +826,21 @@ - Converts one or more arguments of any type to string in the best way possible and prints them to the console. The following BBCode tags are supported: b, i, u, s, indent, code, url, center, right, color, bgcolor, fgcolor. Color tags only support named colors such as [code]red[/code], [i]not[/i] hexadecimal color codes. Unsupported tags will be left as-is in standard output. - When printing to standard output, the supported subset of BBCode is converted to ANSI escape codes for the terminal emulator to display. Displaying ANSI escape codes is currently only supported on Linux and macOS. Support for ANSI escape codes may vary across terminal emulators, especially for italic and strikethrough. + Converts one or more arguments of any type to string in the best way possible and prints them to the console. + The following BBCode tags are supported: [code]b[/code], [code]i[/code], [code]u[/code], [code]s[/code], [code]indent[/code], [code]code[/code], [code]url[/code], [code]center[/code], [code]right[/code], [code]color[/code], [code]bgcolor[/code], [code]fgcolor[/code]. + Color tags only support the following named colors: [code]black[/code], [code]red[/code], [code]green[/code], [code]yellow[/code], [code]blue[/code], [code]magenta[/code], [code]pink[/code], [code]purple[/code], [code]cyan[/code], [code]white[/code], [code]orange[/code], [code]gray[/code]. Hexadecimal color codes are not supported. + URL tags only support URLs wrapped by an URL tag, not URLs with a different title. + When printing to standard output, the supported subset of BBCode is converted to ANSI escape codes for the terminal emulator to display. Support for ANSI escape codes varies across terminal emulators, especially for italic and strikethrough. In standard output, [code]code[/code] is represented with faint text but without any font change. Unsupported tags are left as-is in standard output. [codeblocks] [gdscript] - print_rich("[code][b]Hello world![/b][/code]") # Prints out: [b]Hello world![/b] + print_rich("[color=green][b]Hello world![/b][/color]") # Prints out "Hello world!" in green with a bold font [/gdscript] [csharp] - GD.PrintRich("[code][b]Hello world![/b][/code]"); // Prints out: [b]Hello world![/b] + GD.PrintRich("[color=green][b]Hello world![/b][/color]"); // Prints out "Hello world!" in green with a bold font [/csharp] [/codeblocks] [b]Note:[/b] Consider using [method push_error] and [method push_warning] to print error and warning messages instead of [method print] or [method print_rich]. This distinguishes them from print messages used for debugging purposes, while also displaying a stack trace when an error or warning is printed. + [b]Note:[/b] On Windows, only Windows 10 and later correctly displays ANSI escape codes in standard output. -- cgit v1.2.3 From 10d8a672672fc5f93eebdcea5520412c6e7f9402 Mon Sep 17 00:00:00 2001 From: VolTer Date: Sat, 15 Apr 2023 16:01:19 +0200 Subject: Fix Quaternion's brief description (cherry picked from commit 5c0e3b26a603eb6458d1e23bc77d49c05cdc0449) --- doc/classes/Quaternion.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/classes/Quaternion.xml b/doc/classes/Quaternion.xml index 161514bc03..36f8eac58b 100644 --- a/doc/classes/Quaternion.xml +++ b/doc/classes/Quaternion.xml @@ -1,12 +1,12 @@ - Quaternion. + A unit quaternion used for representing 3D rotations. - A unit quaternion used for representing 3D rotations. Quaternions need to be normalized to be used for rotation. - It is similar to Basis, which implements matrix representation of rotations, and can be parametrized using both an axis-angle pair or Euler angles. Basis stores rotation, scale, and shearing, while Quaternion only stores rotation. - Due to its compactness and the way it is stored in memory, certain operations (obtaining axis-angle and performing SLERP, in particular) are more efficient and robust against floating-point errors. + Quaternions are similar to [Basis], which implements the matrix representation of rotations. Unlike [Basis], which stores rotation, scale, and shearing, quaternions only store rotation. + Quaternions can be parametrized using both an axis-angle pair or Euler angles. Due to their compactness and the way they are stored in memory, certain operations (obtaining axis-angle and performing SLERP, in particular) are more efficient and robust against floating-point errors. + [b]Note:[/b] Quaternions need to be normalized before being used for rotation. $DOCS_URL/tutorials/3d/using_transforms.html#interpolating-with-quaternions -- cgit v1.2.3 From 13f368067fc87d79e01c83bfc9c231c461d8aa4e Mon Sep 17 00:00:00 2001 From: Ninni Pipping Date: Sun, 16 Apr 2023 23:00:49 +0200 Subject: Improve description of `Callable.bind/unbind` (cherry picked from commit 0332fd5e8f71c1292bfa75ac2288bb4355f77567) --- doc/classes/Callable.xml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/doc/classes/Callable.xml b/doc/classes/Callable.xml index 50be9b86bf..1268205537 100644 --- a/doc/classes/Callable.xml +++ b/doc/classes/Callable.xml @@ -76,14 +76,16 @@ - Returns a copy of this [Callable] with one or more arguments bound. When called, the bound arguments are passed [i]after[/i] the arguments supplied by [method call]. + Returns a copy of this [Callable] with one or more arguments bound. When called, the bound arguments are passed [i]after[/i] the arguments supplied by [method call]. See also [method unbind]. + [b]Note:[/b] When this method is chained with other similar methods, the order in which the argument list is modified is read from right to left. - Returns a copy of this [Callable] with one or more arguments bound, reading them from an array. When called, the bound arguments are passed [i]after[/i] the arguments supplied by [method call]. + Returns a copy of this [Callable] with one or more arguments bound, reading them from an array. When called, the bound arguments are passed [i]after[/i] the arguments supplied by [method call]. See also [method unbind]. + [b]Note:[/b] When this method is chained with other similar methods, the order in which the argument list is modified is read from right to left. @@ -187,7 +189,13 @@ - Returns a copy of this [Callable] with the arguments unbound, as defined by [param argcount]. Calling the returned [Callable] will call the method without the extra arguments that are supplied in the [Callable] on which you are calling this method. + Returns a copy of this [Callable] with a number of arguments unbound. In other words, when the new callable is called the last few arguments supplied by the user are ignored, according to [param argcount]. The remaining arguments are passed to the callable. This allows to use the original callable in a context that attempts to pass more arguments than this callable can handle, e.g. a signal with a fixed number of arguments. See also [method bind]. + [b]Note:[/b] When this method is chained with other similar methods, the order in which the argument list is modified is read from right to left. + [codeblock] + func _ready(): + foo.unbind(1).call(1, 2) # Calls foo(1). + foo.bind(3, 4).unbind(1).call(1, 2) # Calls foo(1, 3, 4), note that it does not change the arguments from bind. + [/codeblock] -- cgit v1.2.3 From af0dd6591bd861e33fb2a54d72136dd52ff8ef88 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Sat, 8 Apr 2023 09:16:21 -0300 Subject: Remove unnecessary zero multiplications (cherry picked from commit f057d755abdb0328113ab9472c243b94694a8b04) --- editor/editor_themes.cpp | 38 ++++++++++++------------- editor/plugins/node_3d_editor_plugin.cpp | 8 +++--- scene/resources/default_theme/default_theme.cpp | 18 ++++++------ 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 0d480c7896..178c1f175f 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -834,7 +834,7 @@ Ref create_editor_theme(const Ref p_theme) { theme->set_color("font_focus_color", "MenuButton", font_focus_color); theme->set_color("font_outline_color", "MenuButton", font_outline_color); - theme->set_constant("outline_size", "MenuButton", 0 * EDSCALE); + theme->set_constant("outline_size", "MenuButton", 0); theme->set_stylebox("MenuHover", "EditorStyles", style_widget_hover); @@ -860,7 +860,7 @@ Ref create_editor_theme(const Ref p_theme) { theme->set_color("icon_disabled_color", "Button", icon_disabled_color); theme->set_constant("h_separation", "Button", 2 * EDSCALE); - theme->set_constant("outline_size", "Button", 0 * EDSCALE); + theme->set_constant("outline_size", "Button", 0); const float ACTION_BUTTON_EXTRA_MARGIN = 32 * EDSCALE; @@ -917,7 +917,7 @@ Ref create_editor_theme(const Ref p_theme) { theme->set_color("icon_disabled_color", "MenuBar", icon_disabled_color); theme->set_constant("h_separation", "MenuBar", 4 * EDSCALE); - theme->set_constant("outline_size", "MenuBar", 0 * EDSCALE); + theme->set_constant("outline_size", "MenuBar", 0); // OptionButton Ref style_option_button_focus = style_widget_focus->duplicate(); @@ -961,7 +961,7 @@ Ref create_editor_theme(const Ref p_theme) { theme->set_constant("arrow_margin", "OptionButton", widget_default_margin.x - 2 * EDSCALE); theme->set_constant("modulate_arrow", "OptionButton", true); theme->set_constant("h_separation", "OptionButton", 4 * EDSCALE); - theme->set_constant("outline_size", "OptionButton", 0 * EDSCALE); + theme->set_constant("outline_size", "OptionButton", 0); // CheckButton theme->set_stylebox("normal", "CheckButton", style_menu); @@ -995,8 +995,8 @@ Ref create_editor_theme(const Ref p_theme) { theme->set_color("icon_disabled_color", "CheckButton", icon_disabled_color); theme->set_constant("h_separation", "CheckButton", 8 * EDSCALE); - theme->set_constant("check_v_offset", "CheckButton", 0 * EDSCALE); - theme->set_constant("outline_size", "CheckButton", 0 * EDSCALE); + theme->set_constant("check_v_offset", "CheckButton", 0); + theme->set_constant("outline_size", "CheckButton", 0); // Checkbox Ref sb_checkbox = style_menu->duplicate(); @@ -1031,8 +1031,8 @@ Ref create_editor_theme(const Ref p_theme) { theme->set_color("icon_disabled_color", "CheckBox", icon_disabled_color); theme->set_constant("h_separation", "CheckBox", 8 * EDSCALE); - theme->set_constant("check_v_offset", "CheckBox", 0 * EDSCALE); - theme->set_constant("outline_size", "CheckBox", 0 * EDSCALE); + theme->set_constant("check_v_offset", "CheckBox", 0); + theme->set_constant("outline_size", "CheckBox", 0); // PopupDialog theme->set_stylebox("panel", "PopupDialog", style_popup); @@ -1087,7 +1087,7 @@ Ref create_editor_theme(const Ref p_theme) { const int vsep_base = extra_spacing + default_margin_size + 6; const int force_even_vsep = vsep_base + (vsep_base % 2); theme->set_constant("v_separation", "PopupMenu", force_even_vsep * EDSCALE); - theme->set_constant("outline_size", "PopupMenu", 0 * EDSCALE); + theme->set_constant("outline_size", "PopupMenu", 0); theme->set_constant("item_start_padding", "PopupMenu", default_margin_size * 1.5 * EDSCALE); theme->set_constant("item_end_padding", "PopupMenu", default_margin_size * 1.5 * EDSCALE); @@ -1206,7 +1206,7 @@ Ref create_editor_theme(const Ref p_theme) { theme->set_constant("button_margin", "Tree", default_margin_size * EDSCALE); theme->set_constant("scroll_border", "Tree", 40 * EDSCALE); theme->set_constant("scroll_speed", "Tree", 12); - theme->set_constant("outline_size", "Tree", 0 * EDSCALE); + theme->set_constant("outline_size", "Tree", 0); const Color guide_color = mono_color * Color(1, 1, 1, 0.05); Color relationship_line_color = mono_color * Color(1, 1, 1, relationship_line_opacity); @@ -1302,7 +1302,7 @@ Ref create_editor_theme(const Ref p_theme) { theme->set_constant("h_separation", "ItemList", 6 * EDSCALE); theme->set_constant("icon_margin", "ItemList", 6 * EDSCALE); theme->set_constant("line_separation", "ItemList", 3 * EDSCALE); - theme->set_constant("outline_size", "ItemList", 0 * EDSCALE); + theme->set_constant("outline_size", "ItemList", 0); // TabBar & TabContainer Ref style_tabbar_background = make_flat_stylebox(dark_color_1, 0, 0, 0, 0, corner_radius * EDSCALE); @@ -1340,9 +1340,9 @@ Ref create_editor_theme(const Ref p_theme) { theme->set_icon("drop_mark", "TabContainer", theme->get_icon(SNAME("GuiTabDropMark"), SNAME("EditorIcons"))); theme->set_icon("drop_mark", "TabBar", theme->get_icon(SNAME("GuiTabDropMark"), SNAME("EditorIcons"))); theme->set_constant("side_margin", "TabContainer", 0); - theme->set_constant("outline_size", "TabContainer", 0 * EDSCALE); + theme->set_constant("outline_size", "TabContainer", 0); theme->set_constant("h_separation", "TabBar", 4 * EDSCALE); - theme->set_constant("outline_size", "TabBar", 0 * EDSCALE); + theme->set_constant("outline_size", "TabBar", 0); // Content of each tab. Ref style_content_panel = style_default->duplicate(); @@ -1438,7 +1438,7 @@ Ref create_editor_theme(const Ref p_theme) { theme->set_color("selection_color", "LineEdit", selection_color); theme->set_color("clear_button_color", "LineEdit", font_color); theme->set_color("clear_button_color_pressed", "LineEdit", accent_color); - theme->set_constant("outline_size", "LineEdit", 0 * EDSCALE); + theme->set_constant("outline_size", "LineEdit", 0); // TextEdit theme->set_stylebox("normal", "TextEdit", style_line_edit); @@ -1455,7 +1455,7 @@ Ref create_editor_theme(const Ref p_theme) { theme->set_color("background_color", "TextEdit", Color(0, 0, 0, 0)); theme->set_constant("line_spacing", "TextEdit", 4 * EDSCALE); - theme->set_constant("outline_size", "TextEdit", 0 * EDSCALE); + theme->set_constant("outline_size", "TextEdit", 0); theme->set_icon("h_grabber", "SplitContainer", theme->get_icon(SNAME("GuiHsplitter"), SNAME("EditorIcons"))); theme->set_icon("v_grabber", "SplitContainer", theme->get_icon(SNAME("GuiVsplitter"), SNAME("EditorIcons"))); @@ -1592,7 +1592,7 @@ Ref create_editor_theme(const Ref p_theme) { theme->set_constant("shadow_offset_x", "RichTextLabel", 1 * EDSCALE); theme->set_constant("shadow_offset_y", "RichTextLabel", 1 * EDSCALE); theme->set_constant("shadow_outline_size", "RichTextLabel", 1 * EDSCALE); - theme->set_constant("outline_size", "RichTextLabel", 0 * EDSCALE); + theme->set_constant("outline_size", "RichTextLabel", 0); theme->set_stylebox("focus", "RichTextLabel", make_empty_stylebox()); theme->set_stylebox("normal", "RichTextLabel", style_tree_bg); @@ -1636,7 +1636,7 @@ Ref create_editor_theme(const Ref p_theme) { theme->set_constant("shadow_offset_y", "Label", 1 * EDSCALE); theme->set_constant("shadow_outline_size", "Label", 1 * EDSCALE); theme->set_constant("line_spacing", "Label", 3 * EDSCALE); - theme->set_constant("outline_size", "Label", 0 * EDSCALE); + theme->set_constant("outline_size", "Label", 0); // LinkButton theme->set_stylebox("focus", "LinkButton", style_empty); @@ -1648,7 +1648,7 @@ Ref create_editor_theme(const Ref p_theme) { theme->set_color("font_disabled_color", "LinkButton", font_disabled_color); theme->set_color("font_outline_color", "LinkButton", font_outline_color); - theme->set_constant("outline_size", "LinkButton", 0 * EDSCALE); + theme->set_constant("outline_size", "LinkButton", 0); // TooltipPanel + TooltipLabel // TooltipPanel is also used for custom tooltips, while TooltipLabel @@ -1685,7 +1685,7 @@ Ref create_editor_theme(const Ref p_theme) { theme->set_stylebox("fill", "ProgressBar", make_stylebox(theme->get_icon(SNAME("GuiProgressFill"), SNAME("EditorIcons")), 6, 6, 6, 6, 2, 1, 2, 1)); theme->set_color("font_color", "ProgressBar", font_color); theme->set_color("font_outline_color", "ProgressBar", font_outline_color); - theme->set_constant("outline_size", "ProgressBar", 0 * EDSCALE); + theme->set_constant("outline_size", "ProgressBar", 0); // GraphEdit theme->set_stylebox("bg", "GraphEdit", style_tree_bg); diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index e443548550..e110e52454 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -5162,10 +5162,10 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p position_control->set_navigation_mode(Node3DEditorViewport::NAVIGATION_MOVE); position_control->set_custom_minimum_size(Size2(navigation_control_size, navigation_control_size) * EDSCALE); position_control->set_h_size_flags(SIZE_SHRINK_END); - position_control->set_anchor_and_offset(SIDE_LEFT, ANCHOR_BEGIN, 0 * EDSCALE); + position_control->set_anchor_and_offset(SIDE_LEFT, ANCHOR_BEGIN, 0); position_control->set_anchor_and_offset(SIDE_TOP, ANCHOR_END, -navigation_control_size * EDSCALE); position_control->set_anchor_and_offset(SIDE_RIGHT, ANCHOR_BEGIN, navigation_control_size * EDSCALE); - position_control->set_anchor_and_offset(SIDE_BOTTOM, ANCHOR_END, 0 * EDSCALE); + position_control->set_anchor_and_offset(SIDE_BOTTOM, ANCHOR_END, 0); position_control->set_viewport(this); surface->add_child(position_control); @@ -5175,8 +5175,8 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p look_control->set_h_size_flags(SIZE_SHRINK_END); look_control->set_anchor_and_offset(SIDE_LEFT, ANCHOR_END, -navigation_control_size * EDSCALE); look_control->set_anchor_and_offset(SIDE_TOP, ANCHOR_END, -navigation_control_size * EDSCALE); - look_control->set_anchor_and_offset(SIDE_RIGHT, ANCHOR_END, 0 * EDSCALE); - look_control->set_anchor_and_offset(SIDE_BOTTOM, ANCHOR_END, 0 * EDSCALE); + look_control->set_anchor_and_offset(SIDE_RIGHT, ANCHOR_END, 0); + look_control->set_anchor_and_offset(SIDE_BOTTOM, ANCHOR_END, 0); look_control->set_viewport(this); surface->add_child(look_control); diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 11373c430c..35c81ea91b 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -162,7 +162,7 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const theme->set_font("font", "Button", Ref()); theme->set_font_size("font_size", "Button", -1); - theme->set_constant("outline_size", "Button", 0 * scale); + theme->set_constant("outline_size", "Button", 0); theme->set_color("font_color", "Button", control_font_color); theme->set_color("font_pressed_color", "Button", control_font_pressed_color); @@ -190,7 +190,7 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const theme->set_font("font", "MenuBar", Ref()); theme->set_font_size("font_size", "MenuBar", -1); - theme->set_constant("outline_size", "MenuBar", 0 * scale); + theme->set_constant("outline_size", "MenuBar", 0); theme->set_color("font_color", "MenuBar", control_font_color); theme->set_color("font_pressed_color", "MenuBar", control_font_pressed_color); @@ -315,7 +315,7 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const theme->set_color("font_outline_color", "CheckBox", Color(1, 1, 1)); theme->set_constant("h_separation", "CheckBox", 4 * scale); - theme->set_constant("check_v_offset", "CheckBox", 0 * scale); + theme->set_constant("check_v_offset", "CheckBox", 0); theme->set_constant("outline_size", "CheckBox", 0); // CheckButton @@ -352,7 +352,7 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const theme->set_color("font_outline_color", "CheckButton", Color(1, 1, 1)); theme->set_constant("h_separation", "CheckButton", 4 * scale); - theme->set_constant("check_v_offset", "CheckButton", 0 * scale); + theme->set_constant("check_v_offset", "CheckButton", 0); theme->set_constant("outline_size", "CheckButton", 0); // Label @@ -1034,7 +1034,7 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const theme->set_constant("shadow_offset_y", "RichTextLabel", 1 * scale); theme->set_constant("shadow_outline_size", "RichTextLabel", 1 * scale); - theme->set_constant("line_separation", "RichTextLabel", 0 * scale); + theme->set_constant("line_separation", "RichTextLabel", 0); theme->set_constant("table_h_separation", "RichTextLabel", 3 * scale); theme->set_constant("table_v_separation", "RichTextLabel", 3 * scale); @@ -1057,10 +1057,10 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const theme->set_constant("separation", "BoxContainer", 4 * scale); theme->set_constant("separation", "HBoxContainer", 4 * scale); theme->set_constant("separation", "VBoxContainer", 4 * scale); - theme->set_constant("margin_left", "MarginContainer", 0 * scale); - theme->set_constant("margin_top", "MarginContainer", 0 * scale); - theme->set_constant("margin_right", "MarginContainer", 0 * scale); - theme->set_constant("margin_bottom", "MarginContainer", 0 * scale); + theme->set_constant("margin_left", "MarginContainer", 0); + theme->set_constant("margin_top", "MarginContainer", 0); + theme->set_constant("margin_right", "MarginContainer", 0); + theme->set_constant("margin_bottom", "MarginContainer", 0); theme->set_constant("h_separation", "GridContainer", 4 * scale); theme->set_constant("v_separation", "GridContainer", 4 * scale); theme->set_constant("separation", "SplitContainer", 12 * scale); -- cgit v1.2.3 From f39f3543134ade65b24ab2aed0abf1e356a0d3df Mon Sep 17 00:00:00 2001 From: kobewi Date: Sun, 16 Apr 2023 12:06:45 +0200 Subject: Add missing LineEdit constants in editor theme (cherry picked from commit f462efd7f11c54c5113273055c788364ef65abb5) --- editor/editor_themes.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 178c1f175f..31668416ac 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -1438,7 +1438,10 @@ Ref create_editor_theme(const Ref p_theme) { theme->set_color("selection_color", "LineEdit", selection_color); theme->set_color("clear_button_color", "LineEdit", font_color); theme->set_color("clear_button_color_pressed", "LineEdit", accent_color); + + theme->set_constant("minimum_character_width", "LineEdit", 4); theme->set_constant("outline_size", "LineEdit", 0); + theme->set_constant("caret_width", "LineEdit", 1); // TextEdit theme->set_stylebox("normal", "TextEdit", style_line_edit); @@ -1456,6 +1459,7 @@ Ref create_editor_theme(const Ref p_theme) { theme->set_constant("line_spacing", "TextEdit", 4 * EDSCALE); theme->set_constant("outline_size", "TextEdit", 0); + theme->set_constant("caret_width", "TextEdit", 1); theme->set_icon("h_grabber", "SplitContainer", theme->get_icon(SNAME("GuiHsplitter"), SNAME("EditorIcons"))); theme->set_icon("v_grabber", "SplitContainer", theme->get_icon(SNAME("GuiVsplitter"), SNAME("EditorIcons"))); -- cgit v1.2.3 From 75f3ce618ec70e955829c17c131ed815f97ff7cd Mon Sep 17 00:00:00 2001 From: David Giardi Date: Sun, 16 Apr 2023 14:15:53 +0200 Subject: Fix blurry borders on antialiased FlatStyleBox This is a fix of the antialiasing logic of FlatStyleBox. It is now possible to have smooth rounded corners while keeping the edges sharp on the pixels. The antialiasing gradient positioning is ajusted so that the "hard" border corresponds to the middle of that gradient instead of one end. Checked against rendering of rounded rectangles in a vector graphics software. (cherry picked from commit 2ef20045b1282369585c3395ff9f9ae418394817) --- doc/classes/StyleBoxFlat.xml | 5 +-- scene/resources/style_box.cpp | 72 ++++++++++++++++++++++++------------------- scene/resources/style_box.h | 2 +- 3 files changed, 44 insertions(+), 35 deletions(-) diff --git a/doc/classes/StyleBoxFlat.xml b/doc/classes/StyleBoxFlat.xml index 6bcc3c5ea6..87a5773f95 100644 --- a/doc/classes/StyleBoxFlat.xml +++ b/doc/classes/StyleBoxFlat.xml @@ -103,8 +103,9 @@ Antialiasing draws a small ring around the edges, which fades to transparency. As a result, edges look much smoother. This is only noticeable when using rounded corners or [member skew]. [b]Note:[/b] When using beveled corners with 45-degree angles ([member corner_detail] = 1), it is recommended to set [member anti_aliasing] to [code]false[/code] to ensure crisp visuals and avoid possible visual glitches. - - This changes the size of the faded ring. Higher values can be used to achieve a "blurry" effect. + + This changes the size of the antialiasing effect. [code]1.0[/code] is recommended for an optimal result at 100% scale, identical to how rounded rectangles are rendered in web browsers and most vector drawing software. + [b]Note:[/b] Higher values may produce a blur effect but can also create undesired artifacts on small boxes with large-radius corners. The background color of the stylebox. diff --git a/scene/resources/style_box.cpp b/scene/resources/style_box.cpp index 9e0b856ecd..27ae83908e 100644 --- a/scene/resources/style_box.cpp +++ b/scene/resources/style_box.cpp @@ -757,76 +757,84 @@ void StyleBoxFlat::draw(RID p_canvas_item, const Rect2 &p_rect) const { } // Create infill (no AA). - if (draw_center && (!aa_on || blend_on || !draw_border)) { + if (draw_center && (!aa_on || blend_on)) { draw_ring(verts, indices, colors, border_style_rect, adapted_corner, infill_rect, infill_rect, bg_color, bg_color, corner_detail, skew, true); } if (aa_on) { real_t aa_border_width[4]; + real_t aa_border_width_half[4]; real_t aa_fill_width[4]; + real_t aa_fill_width_half[4]; if (draw_border) { for (int i = 0; i < 4; i++) { if (border_width[i] > 0) { aa_border_width[i] = aa_size; + aa_border_width_half[i] = aa_size / 2; aa_fill_width[i] = 0; + aa_fill_width_half[i] = 0; } else { aa_border_width[i] = 0; + aa_border_width_half[i] = 0; aa_fill_width[i] = aa_size; + aa_fill_width_half[i] = aa_size / 2; } } } else { for (int i = 0; i < 4; i++) { aa_border_width[i] = 0; + aa_border_width_half[i] = 0; aa_fill_width[i] = aa_size; + aa_fill_width_half[i] = aa_size / 2; } } - Rect2 infill_inner_rect = infill_rect.grow_individual(-aa_border_width[SIDE_LEFT], -aa_border_width[SIDE_TOP], - -aa_border_width[SIDE_RIGHT], -aa_border_width[SIDE_BOTTOM]); - if (draw_center) { - if (!blend_on && draw_border) { - Rect2 infill_inner_rect_aa = infill_inner_rect.grow_individual(aa_border_width[SIDE_LEFT], aa_border_width[SIDE_TOP], - aa_border_width[SIDE_RIGHT], aa_border_width[SIDE_BOTTOM]); - // Create infill within AA border. + // Infill rect, transparent side of antialiasing gradient (base infill rect enlarged by AA size) + Rect2 infill_rect_aa_transparent = infill_rect.grow_individual(aa_fill_width_half[SIDE_LEFT], aa_fill_width_half[SIDE_TOP], + aa_fill_width_half[SIDE_RIGHT], aa_fill_width_half[SIDE_BOTTOM]); + // Infill rect, colored side of antialiasing gradient (base infill rect shrunk by AA size) + Rect2 infill_rect_aa_colored = infill_rect_aa_transparent.grow_individual(-aa_fill_width[SIDE_LEFT], -aa_fill_width[SIDE_TOP], + -aa_fill_width[SIDE_RIGHT], -aa_fill_width[SIDE_BOTTOM]); + if (!blend_on) { + // Create center fill, not antialiased yet draw_ring(verts, indices, colors, border_style_rect, adapted_corner, - infill_inner_rect_aa, infill_inner_rect_aa, bg_color, bg_color, corner_detail, skew, true); + infill_rect_aa_colored, infill_rect_aa_colored, bg_color, bg_color, corner_detail, skew, true); } - if (!blend_on || !draw_border) { - Rect2 infill_rect_aa = infill_rect.grow_individual(aa_fill_width[SIDE_LEFT], aa_fill_width[SIDE_TOP], - aa_fill_width[SIDE_RIGHT], aa_fill_width[SIDE_BOTTOM]); - Color alpha_bg = Color(bg_color.r, bg_color.g, bg_color.b, 0); - - // Create infill fake AA gradient. - draw_ring(verts, indices, colors, style_rect, adapted_corner, - infill_rect_aa, infill_rect, bg_color, alpha_bg, corner_detail, skew); + // Add antialiasing on the center fill + draw_ring(verts, indices, colors, border_style_rect, adapted_corner, + infill_rect_aa_transparent, infill_rect_aa_colored, bg_color, alpha_bg, corner_detail, skew); } } if (draw_border) { - Rect2 infill_rect_aa = infill_rect.grow_individual(aa_border_width[SIDE_LEFT], aa_border_width[SIDE_TOP], - aa_border_width[SIDE_RIGHT], aa_border_width[SIDE_BOTTOM]); - Rect2 style_rect_aa = style_rect.grow_individual(aa_border_width[SIDE_LEFT], aa_border_width[SIDE_TOP], - aa_border_width[SIDE_RIGHT], aa_border_width[SIDE_BOTTOM]); - Rect2 border_style_rect_aa = border_style_rect.grow_individual(aa_border_width[SIDE_LEFT], aa_border_width[SIDE_TOP], - aa_border_width[SIDE_RIGHT], aa_border_width[SIDE_BOTTOM]); - - // Create border. + // Inner border recct, fully colored side of antialiasing gradient (base inner rect enlarged by AA size) + Rect2 inner_rect_aa_colored = infill_rect.grow_individual(aa_border_width_half[SIDE_LEFT], aa_border_width_half[SIDE_TOP], + aa_border_width_half[SIDE_RIGHT], aa_border_width_half[SIDE_BOTTOM]); + // Inner border rect, transparent side of antialiasing gradient (base inner rect shrunk by AA size) + Rect2 inner_rect_aa_transparent = inner_rect_aa_colored.grow_individual(-aa_border_width[SIDE_LEFT], -aa_border_width[SIDE_TOP], + -aa_border_width[SIDE_RIGHT], -aa_border_width[SIDE_BOTTOM]); + // Outer border rect, transparent side of antialiasing gradient (base outer rect enlarged by AA size) + Rect2 outer_rect_aa_transparent = style_rect.grow_individual(aa_border_width_half[SIDE_LEFT], aa_border_width_half[SIDE_TOP], + aa_border_width_half[SIDE_RIGHT], aa_border_width_half[SIDE_BOTTOM]); + // Outer border rect, colored side of antialiasing gradient (base outer rect shrunk by AA size) + Rect2 outer_rect_aa_colored = border_style_rect.grow_individual(aa_border_width_half[SIDE_LEFT], aa_border_width_half[SIDE_TOP], + aa_border_width_half[SIDE_RIGHT], aa_border_width_half[SIDE_BOTTOM]); + + // Create border ring, not antialiased yet draw_ring(verts, indices, colors, border_style_rect, adapted_corner, - border_style_rect_aa, ((blend_on) ? infill_rect : infill_rect_aa), border_color_inner, border_color, corner_detail, skew); - + outer_rect_aa_colored, ((blend_on) ? infill_rect : inner_rect_aa_colored), border_color_inner, border_color, corner_detail, skew); if (!blend_on) { - // Create inner border fake AA gradient. + // Add antialiasing on the ring inner border draw_ring(verts, indices, colors, border_style_rect, adapted_corner, - infill_rect_aa, infill_rect, border_color_blend, border_color, corner_detail, skew); + inner_rect_aa_colored, inner_rect_aa_transparent, border_color_blend, border_color, corner_detail, skew); } - - // Create outer border fake AA gradient. + // Add antialiasing on the ring outer border draw_ring(verts, indices, colors, border_style_rect, adapted_corner, - style_rect_aa, border_style_rect_aa, border_color, border_color_alpha, corner_detail, skew); + outer_rect_aa_transparent, outer_rect_aa_colored, border_color, border_color_alpha, corner_detail, skew); } } diff --git a/scene/resources/style_box.h b/scene/resources/style_box.h index 17acfd773e..9d96e9a3b7 100644 --- a/scene/resources/style_box.h +++ b/scene/resources/style_box.h @@ -163,7 +163,7 @@ class StyleBoxFlat : public StyleBox { int corner_detail = 8; int shadow_size = 0; Point2 shadow_offset; - real_t aa_size = 0.625; + real_t aa_size = 1; protected: virtual float get_style_margin(Side p_side) const override; -- cgit v1.2.3 From 32dc3b66ab6453d2ab1863b40d03aa8a776d27d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82?= Date: Mon, 17 Apr 2023 21:45:30 +0200 Subject: Remove double thes from documentation (cherry picked from commit 4431cdd154b8fa0494148980646903e824c0bdb1) --- doc/classes/AnimationPlayer.xml | 2 +- doc/classes/Area3D.xml | 2 +- doc/classes/Curve3D.xml | 2 +- doc/classes/Object.xml | 2 +- doc/classes/ProjectSettings.xml | 4 ++-- doc/classes/TabBar.xml | 2 +- doc/classes/TextureLayered.xml | 2 +- doc/classes/Vector2i.xml | 2 +- doc/classes/Vector3i.xml | 2 +- doc/classes/Viewport.xml | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml index 25e4a4549d..daf25834d9 100644 --- a/doc/classes/AnimationPlayer.xml +++ b/doc/classes/AnimationPlayer.xml @@ -230,7 +230,7 @@ - If playing, the the current animation's key, otherwise, the animation last played. When set, this changes the animation, but will not play it unless already playing. See also [member current_animation]. + If playing, the current animation's key, otherwise, the animation last played. When set, this changes the animation, but will not play it unless already playing. See also [member current_animation]. The number of possible simultaneous sounds for each of the assigned AudioStreamPlayers. diff --git a/doc/classes/Area3D.xml b/doc/classes/Area3D.xml index cf9e865064..69c7ce48eb 100644 --- a/doc/classes/Area3D.xml +++ b/doc/classes/Area3D.xml @@ -128,7 +128,7 @@ The magnitude of area-specific wind force. - The [Node3D] which is used to specify the the direction and origin of an area-specific wind force. The direction is opposite to the z-axis of the [Node3D]'s local transform, and its origin is the origin of the [Node3D]'s local transform. + The [Node3D] which is used to specify the direction and origin of an area-specific wind force. The direction is opposite to the z-axis of the [Node3D]'s local transform, and its origin is the origin of the [Node3D]'s local transform. diff --git a/doc/classes/Curve3D.xml b/doc/classes/Curve3D.xml index 72ac95a700..c4b64c5982 100644 --- a/doc/classes/Curve3D.xml +++ b/doc/classes/Curve3D.xml @@ -138,7 +138,7 @@ - Similar with [code]interpolate_baked()[/code]. The the return value is [code]Transform3D[/code], with [code]origin[/code] as point position, [code]basis.x[/code] as sideway vector, [code]basis.y[/code] as up vector, [code]basis.z[/code] as forward vector. When the curve length is 0, there is no reasonable way to calculate the rotation, all vectors aligned with global space axes. + Similar with [code]interpolate_baked()[/code]. The return value is [code]Transform3D[/code], with [code]origin[/code] as point position, [code]basis.x[/code] as sideway vector, [code]basis.y[/code] as up vector, [code]basis.z[/code] as forward vector. When the curve length is 0, there is no reasonable way to calculate the rotation, all vectors aligned with global space axes. diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml index 226a1948e1..9407ffbd63 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -662,7 +662,7 @@ - Returns [code]true[/code] if the the given [param method] name exists in the object. + Returns [code]true[/code] if the given [param method] name exists in the object. [b]Note:[/b] In C#, [param method] must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the [code]MethodName[/code] class to avoid allocating a new [StringName] on each call. diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 78b7e073c7..16c485c0bc 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -1004,7 +1004,7 @@ macOS specific override for the shortcut to add a caret below every caret. - Default [InputEventAction] to move the text cursor the the end of the text. + Default [InputEventAction] to move the text cursor to the end of the text. [b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified. @@ -2384,7 +2384,7 @@ [b]Note:[/b] Changing this setting does [i]not[/i] impact textures that were already imported before. To make this setting apply to textures that were already imported, exit the editor, remove the [code].godot/imported/[/code] folder located inside the project folder then restart the editor (see [member application/config/use_hidden_project_data_directory]). - If [code]true[/code], the texture importer will import VRAM-compressed textures using the S3 Texture Compression algorithm (DXT1-5) for lower quality textures and the the BPTC algorithm (BC6H and BC7) for high quality textures. This algorithm is only supported on PC desktop platforms and consoles. + If [code]true[/code], the texture importer will import VRAM-compressed textures using the S3 Texture Compression algorithm (DXT1-5) for lower quality textures and the BPTC algorithm (BC6H and BC7) for high quality textures. This algorithm is only supported on PC desktop platforms and consoles. [b]Note:[/b] Changing this setting does [i]not[/i] impact textures that were already imported before. To make this setting apply to textures that were already imported, exit the editor, remove the [code].godot/imported/[/code] folder located inside the project folder then restart the editor (see [member application/config/use_hidden_project_data_directory]). diff --git a/doc/classes/TabBar.xml b/doc/classes/TabBar.xml index 3c7191392a..ec69e86f62 100644 --- a/doc/classes/TabBar.xml +++ b/doc/classes/TabBar.xml @@ -197,7 +197,7 @@ Sets the maximum width which all tabs should be limited to. Unlimited if set to [code]0[/code]. - If [code]true[/code], the tab offset will be changed to keep the the currently selected tab visible. + If [code]true[/code], the tab offset will be changed to keep the currently selected tab visible. if [code]true[/code], the mouse's scroll wheel can be used to navigate the scroll view. diff --git a/doc/classes/TextureLayered.xml b/doc/classes/TextureLayered.xml index f240f0a009..aa025c4e24 100644 --- a/doc/classes/TextureLayered.xml +++ b/doc/classes/TextureLayered.xml @@ -22,7 +22,7 @@ - Called when the the [TextureLayered]'s height is queried. + Called when the [TextureLayered]'s height is queried. diff --git a/doc/classes/Vector2i.xml b/doc/classes/Vector2i.xml index 8c429e86f1..e08a203d90 100644 --- a/doc/classes/Vector2i.xml +++ b/doc/classes/Vector2i.xml @@ -159,7 +159,7 @@ - Gets the remainder of each component of the [Vector2i] with the the given [int]. This operation uses truncated division, which is often not desired as it does not work well with negative numbers. Consider using [method @GlobalScope.posmod] instead if you want to handle negative numbers. + Gets the remainder of each component of the [Vector2i] with the given [int]. This operation uses truncated division, which is often not desired as it does not work well with negative numbers. Consider using [method @GlobalScope.posmod] instead if you want to handle negative numbers. [codeblock] print(Vector2i(10, -20) % 7) # Prints "(3, -6)" [/codeblock] diff --git a/doc/classes/Vector3i.xml b/doc/classes/Vector3i.xml index ce411d954e..dd8d0defb1 100644 --- a/doc/classes/Vector3i.xml +++ b/doc/classes/Vector3i.xml @@ -166,7 +166,7 @@ - Gets the remainder of each component of the [Vector3i] with the the given [int]. This operation uses truncated division, which is often not desired as it does not work well with negative numbers. Consider using [method @GlobalScope.posmod] instead if you want to handle negative numbers. + Gets the remainder of each component of the [Vector3i] with the given [int]. This operation uses truncated division, which is often not desired as it does not work well with negative numbers. Consider using [method @GlobalScope.posmod] instead if you want to handle negative numbers. [codeblock] print(Vector3i(10, -20, 30) % 7) # Prints "(3, -6, 2)" [/codeblock] diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index 8d92616d6f..1a2d0a1a98 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -258,7 +258,7 @@ If [code]true[/code], the GUI controls on the viewport will lay pixel perfectly. - If [code]true[/code], this viewport will mark incoming input events as handled by itself. If [code]false[/code], this is instead done by the the first parent viewport that is set to handle input locally. + If [code]true[/code], this viewport will mark incoming input events as handled by itself. If [code]false[/code], this is instead done by the first parent viewport that is set to handle input locally. A [SubViewportContainer] will automatically set this property to [code]false[/code] for the [Viewport] contained inside of it. See also [method set_input_as_handled] and [method is_input_handled]. -- cgit v1.2.3 From 2eb29d0684dd57212a33856a147ef59408d6ce26 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Tue, 18 Apr 2023 19:53:47 +0800 Subject: Fix various typos in the classref (cherry picked from commit 766807506c4f40bca1fafd16ac467a33694f6269) --- doc/classes/DisplayServer.xml | 2 +- doc/classes/RenderingServer.xml | 6 +++--- doc/classes/ScriptLanguageExtension.xml | 2 +- doc/classes/ShapeCast2D.xml | 2 +- doc/classes/ShapeCast3D.xml | 2 +- doc/classes/SkeletonModification2DFABRIK.xml | 2 +- doc/classes/SkeletonModification2DPhysicalBones.xml | 2 +- doc/classes/TextServer.xml | 2 +- doc/classes/TileSet.xml | 4 ++-- doc/classes/Viewport.xml | 4 ++-- doc/classes/VisualInstance3D.xml | 2 +- doc/classes/VisualShaderNodeTextureParameter.xml | 2 +- doc/classes/Window.xml | 2 +- doc/classes/XRInterface.xml | 4 ++-- doc/classes/XRInterfaceExtension.xml | 4 ++-- 15 files changed, 21 insertions(+), 21 deletions(-) diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml index 6586d9b314..5e898de976 100644 --- a/doc/classes/DisplayServer.xml +++ b/doc/classes/DisplayServer.xml @@ -1711,7 +1711,7 @@ The window can't be focused. No-focus window will ignore all input, except mouse clicks. - Window is part of menu or [OptionButton] dropdown. This flag can't be changed when the window is visible. An active popup window will exclusively receive all input, without stealing focus from its parent. Popup windows are automatically closed when uses click outside it, or when an application is switched. Popup window must have [code]transient parent[/code] set (see [method window_set_transient]). + Window is part of menu or [OptionButton] dropdown. This flag can't be changed when the window is visible. An active popup window will exclusively receive all input, without stealing focus from its parent. Popup windows are automatically closed when uses click outside it, or when an application is switched. Popup window must have transient parent set (see [method window_set_transient]). Window content is expanded to the full size of the window. Unlike borderless window, the frame is left intact and can be used to resize the window, title bar is transparent, but have minimize/maximize/close buttons. diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index ec338cb729..08c1cc4bd3 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -1852,7 +1852,7 @@ - Creates a lightmap GI and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]instance_*[/code] RenderingServer functions. + Creates a lightmap GI and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]lightmap_*[/code] RenderingServer functions. Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. This is the internal equivalent of the [LightmapGI] node. @@ -4171,10 +4171,10 @@ - Use bilinear scaling for the viewport's 3D buffer. The amount of scaling can be set using [member Viewport.scaling_3d_scale]. Values less then [code]1.0[/code] will result in undersampling while values greater than [code]1.0[/code] will result in supersampling. A value of [code]1.0[/code] disables scaling. + Use bilinear scaling for the viewport's 3D buffer. The amount of scaling can be set using [member Viewport.scaling_3d_scale]. Values less than [code]1.0[/code] will result in undersampling while values greater than [code]1.0[/code] will result in supersampling. A value of [code]1.0[/code] disables scaling. - Use AMD FidelityFX Super Resolution 1.0 upscaling for the viewport's 3D buffer. The amount of scaling can be set using [member Viewport.scaling_3d_scale]. Values less then [code]1.0[/code] will be result in the viewport being upscaled using FSR. Values greater than [code]1.0[/code] are not supported and bilinear downsampling will be used instead. A value of [code]1.0[/code] disables scaling. + Use AMD FidelityFX Super Resolution 1.0 upscaling for the viewport's 3D buffer. The amount of scaling can be set using [member Viewport.scaling_3d_scale]. Values less than [code]1.0[/code] will be result in the viewport being upscaled using FSR. Values greater than [code]1.0[/code] are not supported and bilinear downsampling will be used instead. A value of [code]1.0[/code] disables scaling. diff --git a/doc/classes/ScriptLanguageExtension.xml b/doc/classes/ScriptLanguageExtension.xml index d67fe5d255..00adbba1ad 100644 --- a/doc/classes/ScriptLanguageExtension.xml +++ b/doc/classes/ScriptLanguageExtension.xml @@ -361,7 +361,7 @@ The option is local to the location of the code completion query - e.g. a local variable. - The option is from the containing class or a parent class, relative to the location of the code completion query. Perform a bitwise OR with the class depth (e.g. 0 for the local class, 1 for the parent, 2 for the grandparent, etc) to store the depth of an option in a the class or a parent class. + The option is from the containing class or a parent class, relative to the location of the code completion query. Perform a bitwise OR with the class depth (e.g. 0 for the local class, 1 for the parent, 2 for the grandparent, etc) to store the depth of an option in the class or a parent class. The option is from user code which is not local and not in a derived class (e.g. Autoload Singletons). diff --git a/doc/classes/ShapeCast2D.xml b/doc/classes/ShapeCast2D.xml index 5a8eec3921..22894380ab 100644 --- a/doc/classes/ShapeCast2D.xml +++ b/doc/classes/ShapeCast2D.xml @@ -5,7 +5,7 @@ Shape casting allows to detect collision objects by sweeping the [member shape] along the cast direction determined by [member target_position] (useful for things like beam weapons). - Immediate collision overlaps can be done with the [member target_position] set to [code]Vector2(0, 0)[/code] and by calling [method force_shapecast_update] within the same [b]physics_frame[/b]. This also helps to overcome some limitations of [Area2D] when used as a continuous detection area, often requiring waiting a couple of frames before collision information is available to [Area2D] nodes, and when using the signals creates unnecessary complexity. + Immediate collision overlaps can be done with the [member target_position] set to [code]Vector2(0, 0)[/code] and by calling [method force_shapecast_update] within the same [b]physics frame[/b]. This also helps to overcome some limitations of [Area2D] when used as a continuous detection area, often requiring waiting a couple of frames before collision information is available to [Area2D] nodes, and when using the signals creates unnecessary complexity. The node can detect multiple collision objects, but it's usually used to detect the first collision. [b]Note:[/b] shape casting is more computationally expensive compared to ray casting. diff --git a/doc/classes/ShapeCast3D.xml b/doc/classes/ShapeCast3D.xml index 907ae73055..6adf033528 100644 --- a/doc/classes/ShapeCast3D.xml +++ b/doc/classes/ShapeCast3D.xml @@ -5,7 +5,7 @@ Shape casting allows to detect collision objects by sweeping the [member shape] along the cast direction determined by [member target_position] (useful for things like beam weapons). - Immediate collision overlaps can be done with the [member target_position] set to [code]Vector3(0, 0, 0)[/code] and by calling [method force_shapecast_update] within the same [b]physics_frame[/b]. This also helps to overcome some limitations of [Area3D] when used as a continuous detection area, often requiring waiting a couple of frames before collision information is available to [Area3D] nodes, and when using the signals creates unnecessary complexity. + Immediate collision overlaps can be done with the [member target_position] set to [code]Vector3(0, 0, 0)[/code] and by calling [method force_shapecast_update] within the same [b]physics frame[/b]. This also helps to overcome some limitations of [Area3D] when used as a continuous detection area, often requiring waiting a couple of frames before collision information is available to [Area3D] nodes, and when using the signals creates unnecessary complexity. The node can detect multiple collision objects, but it's usually used to detect the first collision. [b]Note:[/b] Shape casting is more computationally expensive compared to ray casting. diff --git a/doc/classes/SkeletonModification2DFABRIK.xml b/doc/classes/SkeletonModification2DFABRIK.xml index 8d1cd4b4d4..f4cd3302ee 100644 --- a/doc/classes/SkeletonModification2DFABRIK.xml +++ b/doc/classes/SkeletonModification2DFABRIK.xml @@ -5,7 +5,7 @@ This [SkeletonModification2D] uses an algorithm called Forward And Backward Reaching Inverse Kinematics, or FABRIK, to rotate a bone chain so that it reaches a target. - FABRIK works by knowing the positions and lengths of a series of bones, typically called a "bone chain". It first starts by running a forward pass, which places the final bone at the target's position. Then all other bones are moved towards the tip bone, so they stay at the defined bone length away. Then a backwards pass is performed, where the root/first bone in the FABRIK chain is placed back at the origin. then all other bones are moved so they stay at the defined bone length away. This positions the bone chain so that it reaches the target when possible, but all of the bones stay the correct length away from each other. + FABRIK works by knowing the positions and lengths of a series of bones, typically called a "bone chain". It first starts by running a forward pass, which places the final bone at the target's position. Then all other bones are moved towards the tip bone, so they stay at the defined bone length away. Then a backwards pass is performed, where the root/first bone in the FABRIK chain is placed back at the origin. Then all other bones are moved so they stay at the defined bone length away. This positions the bone chain so that it reaches the target when possible, but all of the bones stay the correct length away from each other. Because of how FABRIK works, it often gives more natural results than those seen in [SkeletonModification2DCCDIK]. FABRIK also supports angle constraints, which are fully taken into account when solving. [b]Note:[/b] The FABRIK modifier has [code]fabrik_joints[/code], which are the data objects that hold the data for each joint in the FABRIK chain. This is different from [Bone2D] nodes! FABRIK joints hold the data needed for each [Bone2D] in the bone chain used by FABRIK. To help control how the FABRIK joints move, a magnet vector can be passed, which can nudge the bones in a certain direction prior to solving, giving a level of control over the final result. diff --git a/doc/classes/SkeletonModification2DPhysicalBones.xml b/doc/classes/SkeletonModification2DPhysicalBones.xml index 209602e974..2513b5e622 100644 --- a/doc/classes/SkeletonModification2DPhysicalBones.xml +++ b/doc/classes/SkeletonModification2DPhysicalBones.xml @@ -13,7 +13,7 @@ - Empties the list of [PhysicalBone2D] nodes and populates it will all [PhysicalBone2D] nodes that are children of the [Skeleton2D]. + Empties the list of [PhysicalBone2D] nodes and populates it with all [PhysicalBone2D] nodes that are children of the [Skeleton2D]. diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml index 608fef8f37..98f08f23a0 100644 --- a/doc/classes/TextServer.xml +++ b/doc/classes/TextServer.xml @@ -1007,7 +1007,7 @@ - Returns [code]true[/code] is [param string] is a valid identifier. + Returns [code]true[/code] if [param string] is a valid identifier. If the text server supports the [constant FEATURE_UNICODE_IDENTIFIERS] feature, a valid identifier must: - Conform to normalization form C. - Begin with a Unicode character of class XID_Start or [code]"_"[/code]. diff --git a/doc/classes/TileSet.xml b/doc/classes/TileSet.xml index c371fc3ca2..23f2623cff 100644 --- a/doc/classes/TileSet.xml +++ b/doc/classes/TileSet.xml @@ -67,7 +67,7 @@ Adds a [TileSetSource] to the TileSet. If [param atlas_source_id_override] is not -1, also set its source ID. Otherwise, a unique identifier is automatically generated. - The function returns the added source source ID or -1 if the source could not be added. + The function returns the added source ID or -1 if the source could not be added. @@ -578,7 +578,7 @@ - Creates a source-level proxy for the given source ID. A proxy will map set of tile identifiers to another set of identifiers. Both the atlac coordinates ID and the alternative tile ID are kept the same when using source-level proxies. + Creates a source-level proxy for the given source ID. A proxy will map set of tile identifiers to another set of identifiers. Both the atlas coordinates ID and the alternative tile ID are kept the same when using source-level proxies. This can be used to replace a source in all TileMaps using this TileSet, as TileMap nodes will find and use the proxy's target source when one is available. Proxied tiles can be automatically replaced in TileMap nodes using the editor. diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index 1a2d0a1a98..35253dc9ef 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -410,10 +410,10 @@ Represents the size of the [enum PositionalShadowAtlasQuadrantSubdiv] enum. - Use bilinear scaling for the viewport's 3D buffer. The amount of scaling can be set using [member scaling_3d_scale]. Values less then [code]1.0[/code] will result in undersampling while values greater than [code]1.0[/code] will result in supersampling. A value of [code]1.0[/code] disables scaling. + Use bilinear scaling for the viewport's 3D buffer. The amount of scaling can be set using [member scaling_3d_scale]. Values less than [code]1.0[/code] will result in undersampling while values greater than [code]1.0[/code] will result in supersampling. A value of [code]1.0[/code] disables scaling. - Use AMD FidelityFX Super Resolution 1.0 upscaling for the viewport's 3D buffer. The amount of scaling can be set using [member scaling_3d_scale]. Values less then [code]1.0[/code] will be result in the viewport being upscaled using FSR. Values greater than [code]1.0[/code] are not supported and bilinear downsampling will be used instead. A value of [code]1.0[/code] disables scaling. + Use AMD FidelityFX Super Resolution 1.0 upscaling for the viewport's 3D buffer. The amount of scaling can be set using [member scaling_3d_scale]. Values less than [code]1.0[/code] will be result in the viewport being upscaled using FSR. Values greater than [code]1.0[/code] are not supported and bilinear downsampling will be used instead. A value of [code]1.0[/code] disables scaling. Represents the size of the [enum Scaling3DMode] enum. diff --git a/doc/classes/VisualInstance3D.xml b/doc/classes/VisualInstance3D.xml index b2bc6709a0..3713ca48c6 100644 --- a/doc/classes/VisualInstance3D.xml +++ b/doc/classes/VisualInstance3D.xml @@ -58,7 +58,7 @@ The render layer(s) this [VisualInstance3D] is drawn on. - This object will only be visible for [Camera3D]s whose cull mask includes the render object this [VisualInstance3D] is set to. + This object will only be visible for [Camera3D]s whose cull mask includes any of the render layers this [VisualInstance3D] is set to. For [Light3D]s, this can be used to control which [VisualInstance3D]s are affected by a specific light. For [GPUParticles3D], this can be used to control which particles are effected by a specific attractor. For [Decal]s, this can be used to control which [VisualInstance3D]s are affected by a specific decal. diff --git a/doc/classes/VisualShaderNodeTextureParameter.xml b/doc/classes/VisualShaderNodeTextureParameter.xml index 8a08bea659..76a46ea313 100644 --- a/doc/classes/VisualShaderNodeTextureParameter.xml +++ b/doc/classes/VisualShaderNodeTextureParameter.xml @@ -19,7 +19,7 @@ Sets the texture repeating mode. See [enum TextureRepeat] for options. - Sets the texture source mode. Used for reading from the screen, depth, or normal_roughness texture. see [enum TextureSource] for options. + Sets the texture source mode. Used for reading from the screen, depth, or normal_roughness texture. See [enum TextureSource] for options. Defines the type of data provided by the source texture. See [enum TextureType] for options. diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml index a8237efd16..deef703e0d 100644 --- a/doc/classes/Window.xml +++ b/doc/classes/Window.xml @@ -730,7 +730,7 @@ The window can't be focused. No-focus window will ignore all input, except mouse clicks. Set with [member unfocusable]. - Window is part of menu or [OptionButton] dropdown. This flag can't be changed when the window is visible. An active popup window will exclusively receive all input, without stealing focus from its parent. Popup windows are automatically closed when uses click outside it, or when an application is switched. Popup window must have [code]transient parent[/code] set (see [member transient]). + Window is part of menu or [OptionButton] dropdown. This flag can't be changed when the window is visible. An active popup window will exclusively receive all input, without stealing focus from its parent. Popup windows are automatically closed when uses click outside it, or when an application is switched. Popup window must have transient parent set (see [member transient]). Window content is expanded to the full size of the window. Unlike borderless window, the frame is left intact and can be used to resize the window, title bar is transparent, but have minimize/maximize/close buttons. Set with [member extend_to_title]. diff --git a/doc/classes/XRInterface.xml b/doc/classes/XRInterface.xml index 96a6f5decd..223953ff79 100644 --- a/doc/classes/XRInterface.xml +++ b/doc/classes/XRInterface.xml @@ -70,7 +70,7 @@ Returns the transform for a view/eye. [param view] is the view/eye index. - [param cam_transform] is the transform that maps device coordinates to scene coordinates, typically the global_transform of the current XROrigin3D. + [param cam_transform] is the transform that maps device coordinates to scene coordinates, typically the [member Node3D.global_transform] of the current XROrigin3D. @@ -246,7 +246,7 @@ Player is free to move around, full positional tracking. - Same as roomscale but origin point is fixed to the center of the physical space, XRServer.center_on_hmd disabled. + Same as [constant XR_PLAY_AREA_ROOMSCALE] but origin point is fixed to the center of the physical space, [method XRServer.center_on_hmd] disabled. Opaque blend mode. This is typically used for VR devices. diff --git a/doc/classes/XRInterfaceExtension.xml b/doc/classes/XRInterfaceExtension.xml index b74ac1e469..a2ef6f6437 100644 --- a/doc/classes/XRInterfaceExtension.xml +++ b/doc/classes/XRInterfaceExtension.xml @@ -159,13 +159,13 @@ - Called if this [XRInterfaceExtension] is active before rendering starts, most XR interfaces will sync tracking at this point in time. + Called if this [XRInterfaceExtension] is active before rendering starts. Most XR interfaces will sync tracking at this point in time. - Called if this [XRInterfaceExtension] is active before our physics and game process is called. most XR interfaces will update its [XRPositionalTracker]s at this point in time. + Called if this [XRInterfaceExtension] is active before our physics and game process is called. Most XR interfaces will update its [XRPositionalTracker]s at this point in time. -- cgit v1.2.3 From e6478f5be398e1fd83aeb46188f37e9c4373494e Mon Sep 17 00:00:00 2001 From: Adam Scott Date: Sat, 15 Apr 2023 09:01:51 -0400 Subject: Fix typo when parsing LSP function parameters (cherry picked from commit 879791e305128bcb3c1bf4c6420c9fd0f7c7df0b) --- modules/gdscript/language_server/gdscript_extend_parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gdscript/language_server/gdscript_extend_parser.cpp b/modules/gdscript/language_server/gdscript_extend_parser.cpp index 146ed10ceb..1bf9f85831 100644 --- a/modules/gdscript/language_server/gdscript_extend_parser.cpp +++ b/modules/gdscript/language_server/gdscript_extend_parser.cpp @@ -337,7 +337,7 @@ void ExtendGDScriptParser::parse_function_symbol(const GDScriptParser::FunctionN symbol.kind = lsp::SymbolKind::Variable; symbol.name = parameter->identifier->name; symbol.range.start.line = LINE_NUMBER_TO_INDEX(parameter->start_line); - symbol.range.start.character = LINE_NUMBER_TO_INDEX(parameter->start_line); + symbol.range.start.character = LINE_NUMBER_TO_INDEX(parameter->start_column); symbol.range.end.line = LINE_NUMBER_TO_INDEX(parameter->end_line); symbol.range.end.character = LINE_NUMBER_TO_INDEX(parameter->end_column); symbol.uri = uri; -- cgit v1.2.3 From b5bd99d9e6062f5820e7e51cdaee8d799c85f701 Mon Sep 17 00:00:00 2001 From: Yuri Sizov Date: Mon, 24 Apr 2023 18:10:21 +0200 Subject: Update changelog for 4.0.3 --- CHANGELOG.md | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 088ea5e477..4ae09441cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ See the [release announcement](https://godotengine.org/article/maintenance-relea - Remember directory when installing templates file ([GH-74735](https://github.com/godotengine/godot/pull/74735)). - Improve editor state initialization ([GH-75563](https://github.com/godotengine/godot/pull/75563)). +#### GUI + +- Allow entering named colors in ColorPicker's hex field ([GH-75905](https://github.com/godotengine/godot/pull/75905)). + #### Navigation - Navigation: Expose NavigationAgent path postprocessing and pathfinding algorithm options ([GH-75326](https://github.com/godotengine/godot/pull/75326)). @@ -40,21 +44,49 @@ See the [release announcement](https://godotengine.org/article/maintenance-relea - Truncate instead of round in Vector2/3/4 to Vector2I/3I/4I conversion ([GH-75477](https://github.com/godotengine/godot/pull/75477)). +#### Core + +- Lift restriction that resource load thread requester has to be the initiator ([GH-73862](https://github.com/godotengine/godot/pull/73862)). +- Use HashMap instead of RBMap for ids in Windows TTS ([GH-75933](https://github.com/godotengine/godot/pull/75933)). +- Rename internal root canvas group to start with underscore ([GH-76149](https://github.com/godotengine/godot/pull/76149)). + #### Editor +- Make EditorToaster's handler thread-safe ([GH-71670](https://github.com/godotengine/godot/pull/71670)). - Prevent off-screen controls in editor ([GH-73646](https://github.com/godotengine/godot/pull/73646)). - Re-enable script editor File menu shortcuts when the menu is hidden ([GH-74319](https://github.com/godotengine/godot/pull/74319)). - Prevent color conversion of the big Godot logo ([GH-75653](https://github.com/godotengine/godot/pull/75653)). +- Set font sizes for various styles in editor output panel ([GH-75780](https://github.com/godotengine/godot/pull/75780)). +- Remove unnecessary zero multiplications ([GH-75822](https://github.com/godotengine/godot/pull/75822)). +- Adjust size of some dialogs ([GH-75895](https://github.com/godotengine/godot/pull/75895)). +- Change cursor consistently when panning in the 2D Editor ([GH-75997](https://github.com/godotengine/godot/pull/75997)). #### GUI - Ignore invisible children of GraphNode for minimum size ([GH-72240](https://github.com/godotengine/godot/pull/72240)). - Update `TextureProgressBar` upon texture changes ([GH-75532](https://github.com/godotengine/godot/pull/75532)). - Keep a copy of UTF-8 XML source string during the SVG font processing ([GH-75675](https://github.com/godotengine/godot/pull/75675)). +- Always cache parent visibility in `CanvasItem` ([GH-75890](https://github.com/godotengine/godot/pull/75890)). +- Improve BiDi error handling in TextServer ([GH-75922](https://github.com/godotengine/godot/pull/75922)). +- Use dedicated flag for object replacement characters in TextServer ([GH-75974](https://github.com/godotengine/godot/pull/75974)). +- Improve line BiDi handling, prevent crash on recursive log updates ([GH-75975](https://github.com/godotengine/godot/pull/75975)). +- Don't apply scale to autohide theme property ([GH-75993](https://github.com/godotengine/godot/pull/75993)). +- Use Point2 consistently in Control methods ([GH-76029](https://github.com/godotengine/godot/pull/76029)). #### Import - gltf: Remove obsolete hack to embed gltf textures in advanced import ([GH-75636](https://github.com/godotengine/godot/pull/75636)). +- Expose more compression formats in Image and fix compress check ([GH-76014](https://github.com/godotengine/godot/pull/76014)). + +#### Network + +- Poll LSP/DAP clients for connection status updates ([GH-75850](https://github.com/godotengine/godot/pull/75850)). + +#### Particles + +- Translate inactive GPUParticles3D particles to -INF ([GH-75162](https://github.com/godotengine/godot/pull/75162)). +- Use angle_rand to calculate base_angle in particles process material ([GH-75999](https://github.com/godotengine/godot/pull/75999)). +- Don't store instance transform origin in RD 3D renderer unless requested ([GH-76003](https://github.com/godotengine/godot/pull/76003)). #### Physics @@ -63,6 +95,12 @@ See the [release announcement](https://godotengine.org/article/maintenance-relea #### Rendering - Recreate swap chain when suboptimal to avoid error spam ([GH-72859](https://github.com/godotengine/godot/pull/72859)). +- Use MODELVIEW_MATRIX when on double precision ([GH-75462](https://github.com/godotengine/godot/pull/75462)). +- Check for instancing without relying on instance_count when drawing 2D meshes ([GH-75954](https://github.com/godotengine/godot/pull/75954)). + +#### Shaders + +- Write out render_mode even when mode is set to default in VisualShaders ([GH-75957](https://github.com/godotengine/godot/pull/75957)). #### Thirdparty @@ -74,6 +112,10 @@ See the [release announcement](https://godotengine.org/article/maintenance-relea - Fix RemoteTransform2D could fail to update AnimatableBody2D's position or rotation ([GH-75487](https://github.com/godotengine/godot/pull/75487)). +#### Animation + +- Fix blend_shape (shapekey) empty name import ([GH-75990](https://github.com/godotengine/godot/pull/75990)). + #### Audio - Fix AudioStreamPlayer2D crash when PhysicsServer2D runs on thread ([GH-75728](https://github.com/godotengine/godot/pull/75728)). @@ -81,6 +123,7 @@ See the [release announcement](https://godotengine.org/article/maintenance-relea #### Buildsystem - Fix the Python type error when creating the .sln file ([GH-75309](https://github.com/godotengine/godot/pull/75309)). +- Fix forced optimization in dev_build ([GH-75909](https://github.com/godotengine/godot/pull/75909)). #### Core @@ -89,36 +132,72 @@ See the [release announcement](https://godotengine.org/article/maintenance-relea #### Editor - Fix off-by-one issue where "Go to Line" dialog shows the incorrect line number ([GH-75523](https://github.com/godotengine/godot/pull/75523)). +- Fix deserializing resource usage debug data ([GH-75782](https://github.com/godotengine/godot/pull/75782)). +- Initialize editor values on first launch ([GH-75799](https://github.com/godotengine/godot/pull/75799)). +- Fix connect signal dialog not allowing Unicode method name ([GH-75814](https://github.com/godotengine/godot/pull/75814)). +- Fix method dialog label ([GH-75844](https://github.com/godotengine/godot/pull/75844)). + +#### Export + +- Fix validation of codesigning certificate password on macOS ([GH-74326](https://github.com/godotengine/godot/pull/74326)). + +#### GDScript + +- Add missing member type check when resolving `extends` ([GH-75879](https://github.com/godotengine/godot/pull/75879)). +- Fix typo in LSP parse function parameters ([GH-76090](https://github.com/godotengine/godot/pull/76090)). #### GUI +- Fixed RichTextLabel wrong selection offset in padded table cell ([GH-71742](https://github.com/godotengine/godot/pull/71742)). - Fix commenting collapsed function issue ([GH-75070](https://github.com/godotengine/godot/pull/75070)). - Fix fill align and trim with enabled dropcap in `RichTextLabel` ([GH-75504](https://github.com/godotengine/godot/pull/75504)). - Fix descriptions not showing for theme properties ([GH-75559](https://github.com/godotengine/godot/pull/75559)). - Fix some theme values affect the editor by setting a default value for them ([GH-75566](https://github.com/godotengine/godot/pull/75566)). - Fix several GraphEdit operations at zoom levels other than 100% ([GH-75595](https://github.com/godotengine/godot/pull/75595)). +- Fix uninitialized member in CodeEdit ([GH-75829](https://github.com/godotengine/godot/pull/75829)). +- Fix offset calculation in Tree when there are hidden items ([GH-75977](https://github.com/godotengine/godot/pull/75977)). +- Add missing LineEdit constants in editor theme ([GH-76123](https://github.com/godotengine/godot/pull/76123)). +- Fix blurry borders on antialiased StyleBoxFlat ([GH-76132](https://github.com/godotengine/godot/pull/76132)). #### Import - SVG: fix tvg::Picture->size() and scale based errors. ([GH-75034](https://github.com/godotengine/godot/pull/75034)). +- Fix OBJ mesh importer smoothing handling ([GH-75315](https://github.com/godotengine/godot/pull/75315)). #### Input - Fix guide button detection with XInput and Xbox Series controllers ([GH-73200](https://github.com/godotengine/godot/pull/73200)). - Fix the issue preventing dragging in the 2D editor ([GH-75113](https://github.com/godotengine/godot/pull/75113)). - Fix keycode/physical keycode mix up on web ([GH-75738](https://github.com/godotengine/godot/pull/75738)). +- Fix potential null in android text entry system ([GH-75991](https://github.com/godotengine/godot/pull/75991)). #### Navigation - Navigation: Fix NavigationObstacles not being added to avoidance simulation ([GH-75756](https://github.com/godotengine/godot/pull/75756)). +#### Particles + +- Properly calculate lifetime_split for particles ([GH-73313](https://github.com/godotengine/godot/pull/73313)). +- Fix "error X3708: continue cannot be used in a switch" in HTML export ([GH-75795](https://github.com/godotengine/godot/pull/75795)). + +#### Physics + +- Fix typo bug in convex-convex separating axis test ([GH-75835](https://github.com/godotengine/godot/pull/75835)). + #### Porting - Windows: Fix clipboard relying on focused window ([GH-73878](https://github.com/godotengine/godot/pull/73878)). +- Windows: Fix StringFileInfo structure ([GH-76001](https://github.com/godotengine/godot/pull/76001)). #### Rendering - Fix interpolation of R0 for metallic and calculation of the Fresnel Shlick term in SSR ([GH-75368](https://github.com/godotengine/godot/pull/75368)). +- Fix `get_test_texture()` returning an almost fully white texture ([GH-75632](https://github.com/godotengine/godot/pull/75632)). +- Ensure that depth write state is updated before transparent pass in OpenGL3 renderer ([GH-75968](https://github.com/godotengine/godot/pull/75968)). + +#### Shaders + +- Fix crashes caused due to missing type specifier on visual shader editor ([GH-75809](https://github.com/godotengine/godot/pull/75809)). ## [4.0.2] - 2023-04-04 -- cgit v1.2.3