summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/os/os.h3
-rw-r--r--core/variant/variant_parser.cpp9
-rw-r--r--doc/classes/ArrayMesh.xml3
-rw-r--r--doc/classes/CodeEdit.xml2
-rw-r--r--doc/classes/Image.xml2
-rw-r--r--doc/classes/ImporterMesh.xml5
-rw-r--r--doc/classes/PackedScene.xml2
-rw-r--r--doc/classes/ProjectSettings.xml22
-rw-r--r--doc/classes/RenderingServer.xml3
-rw-r--r--doc/classes/TextLine.xml3
-rw-r--r--doc/classes/TextParagraph.xml6
-rw-r--r--doc/classes/TextServer.xml3
-rw-r--r--editor/doc_tools.cpp14
-rw-r--r--editor/editor_node.cpp15
-rw-r--r--editor/editor_node.h2
-rw-r--r--editor/editor_run.cpp18
-rw-r--r--editor/editor_toaster.cpp8
-rw-r--r--editor/editor_toaster.h1
-rw-r--r--editor/icons/Notification.svg2
-rw-r--r--editor/icons/NotificationDisabled.svg2
-rw-r--r--editor/import/resource_importer_scene.cpp77
-rw-r--r--editor/import/resource_importer_scene.h2
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp4
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp2
-rw-r--r--main/main.cpp50
-rw-r--r--modules/webrtc/doc_classes/WebRTCPeerConnection.xml6
-rw-r--r--platform/android/export/export_plugin.cpp2
-rw-r--r--scene/2d/camera_2d.cpp2
-rw-r--r--scene/gui/control.cpp2
-rw-r--r--thirdparty/README.md2
-rw-r--r--thirdparty/thorvg/patches/thorvg-pr1159-mingw-fix.patch73
-rw-r--r--thirdparty/thorvg/src/loaders/svg/tvgSvgLoader.cpp1
-rw-r--r--thirdparty/thorvg/src/loaders/svg/tvgSvgPath.cpp1
-rw-r--r--thirdparty/thorvg/src/loaders/svg/tvgSvgSceneBuilder.cpp1
-rw-r--r--thirdparty/thorvg/src/loaders/svg/tvgSvgUtil.cpp1
-rw-r--r--thirdparty/thorvg/src/loaders/svg/tvgXmlParser.cpp1
-rw-r--r--thirdparty/thorvg/src/savers/tvg/tvgTvgSaver.cpp2
37 files changed, 241 insertions, 113 deletions
diff --git a/core/os/os.h b/core/os/os.h
index 6b4e2798bd..36d85da70b 100644
--- a/core/os/os.h
+++ b/core/os/os.h
@@ -295,6 +295,9 @@ public:
virtual void debug_break();
virtual int get_exit_code() const;
+ // `set_exit_code` should only be used from `SceneTree` (or from a similar
+ // level, e.g. from the `Main::start` if leaving without creating a `SceneTree`).
+ // For other components, `SceneTree.quit()` should be used instead.
virtual void set_exit_code(int p_code);
virtual int get_processor_count() const;
diff --git a/core/variant/variant_parser.cpp b/core/variant/variant_parser.cpp
index 571181f665..57875bf50f 100644
--- a/core/variant/variant_parser.cpp
+++ b/core/variant/variant_parser.cpp
@@ -1649,12 +1649,13 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str
dict.get_key_list(&keys);
keys.sort();
+ if (keys.is_empty()) { // Avoid unnecessary line break.
+ p_store_string_func(p_store_string_ud, "{}");
+ break;
+ }
+
p_store_string_func(p_store_string_ud, "{\n");
for (List<Variant>::Element *E = keys.front(); E; E = E->next()) {
- /*
- if (!_check_type(dict[E->get()]))
- continue;
- */
write(E->get(), p_store_string_func, p_store_string_ud, p_encode_res_func, p_encode_res_ud, recursion_count);
p_store_string_func(p_store_string_ud, ": ");
write(dict[E->get()], p_store_string_func, p_store_string_ud, p_encode_res_func, p_encode_res_ud, recursion_count);
diff --git a/doc/classes/ArrayMesh.xml b/doc/classes/ArrayMesh.xml
index c986947dfb..fa980d9f75 100644
--- a/doc/classes/ArrayMesh.xml
+++ b/doc/classes/ArrayMesh.xml
@@ -62,8 +62,7 @@
<argument index="0" name="primitive" type="int" enum="Mesh.PrimitiveType" />
<argument index="1" name="arrays" type="Array" />
<argument index="2" name="blend_shapes" type="Array" default="[]" />
- <argument index="3" name="lods" type="Dictionary" default="{
-}" />
+ <argument index="3" name="lods" type="Dictionary" default="{}" />
<argument index="4" name="compress_flags" type="int" default="0" />
<description>
Creates a new surface.
diff --git a/doc/classes/CodeEdit.xml b/doc/classes/CodeEdit.xml
index 697b0443f1..4a9d79978c 100644
--- a/doc/classes/CodeEdit.xml
+++ b/doc/classes/CodeEdit.xml
@@ -442,7 +442,7 @@
<member name="auto_brace_completion_highlight_matching" type="bool" setter="set_highlight_matching_braces_enabled" getter="is_highlight_matching_braces_enabled" default="false">
Highlight mismatching brace pairs.
</member>
- <member name="auto_brace_completion_pairs" type="Dictionary" setter="set_auto_brace_completion_pairs" getter="get_auto_brace_completion_pairs" default="{&quot;\&quot;&quot;: &quot;\&quot;&quot;,&quot;&apos;&quot;: &quot;&apos;&quot;,&quot;(&quot;: &quot;)&quot;,&quot;[&quot;: &quot;]&quot;,&quot;{&quot;: &quot;}&quot;}">
+ <member name="auto_brace_completion_pairs" type="Dictionary" setter="set_auto_brace_completion_pairs" getter="get_auto_brace_completion_pairs" default="{ &quot;\&quot;&quot;: &quot;\&quot;&quot;, &quot;&apos;&quot;: &quot;&apos;&quot;, &quot;(&quot;: &quot;)&quot;, &quot;[&quot;: &quot;]&quot;, &quot;{&quot;: &quot;}&quot; }">
Sets the brace pairs to be autocompleted.
</member>
<member name="code_completion_enabled" type="bool" setter="set_code_completion_enabled" getter="is_code_completion_enabled" default="false">
diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml
index e7bb1b9825..60d4b664d2 100644
--- a/doc/classes/Image.xml
+++ b/doc/classes/Image.xml
@@ -452,7 +452,7 @@
</method>
</methods>
<members>
- <member name="data" type="Dictionary" setter="_set_data" getter="_get_data" default="{&quot;data&quot;: PackedByteArray(),&quot;format&quot;: &quot;Lum8&quot;,&quot;height&quot;: 0,&quot;mipmaps&quot;: false,&quot;width&quot;: 0}">
+ <member name="data" type="Dictionary" setter="_set_data" getter="_get_data" default="{ &quot;data&quot;: PackedByteArray(), &quot;format&quot;: &quot;Lum8&quot;, &quot;height&quot;: 0, &quot;mipmaps&quot;: false, &quot;width&quot;: 0 }">
Holds all the image's color data in a given format. See [enum Format] constants.
</member>
</members>
diff --git a/doc/classes/ImporterMesh.xml b/doc/classes/ImporterMesh.xml
index ab344f908c..4c323156c9 100644
--- a/doc/classes/ImporterMesh.xml
+++ b/doc/classes/ImporterMesh.xml
@@ -23,8 +23,7 @@
<argument index="0" name="primitive" type="int" enum="Mesh.PrimitiveType" />
<argument index="1" name="arrays" type="Array" />
<argument index="2" name="blend_shapes" type="Array" default="[]" />
- <argument index="3" name="lods" type="Dictionary" default="{
-}" />
+ <argument index="3" name="lods" type="Dictionary" default="{}" />
<argument index="4" name="material" type="Material" default="null" />
<argument index="5" name="name" type="String" default="&quot;&quot;" />
<argument index="6" name="flags" type="int" default="0" />
@@ -178,7 +177,7 @@
</method>
</methods>
<members>
- <member name="_data" type="Dictionary" setter="_set_data" getter="_get_data" default="{&quot;surfaces&quot;: []}">
+ <member name="_data" type="Dictionary" setter="_set_data" getter="_get_data" default="{ &quot;surfaces&quot;: [] }">
</member>
</members>
</class>
diff --git a/doc/classes/PackedScene.xml b/doc/classes/PackedScene.xml
index d3a770b35b..4bba6563bb 100644
--- a/doc/classes/PackedScene.xml
+++ b/doc/classes/PackedScene.xml
@@ -104,7 +104,7 @@
</method>
</methods>
<members>
- <member name="_bundled" type="Dictionary" setter="_set_bundled_scene" getter="_get_bundled_scene" default="{&quot;conn_count&quot;: 0,&quot;conns&quot;: PackedInt32Array(),&quot;editable_instances&quot;: [],&quot;names&quot;: PackedStringArray(),&quot;node_count&quot;: 0,&quot;node_paths&quot;: [],&quot;nodes&quot;: PackedInt32Array(),&quot;variants&quot;: [],&quot;version&quot;: 2}">
+ <member name="_bundled" type="Dictionary" setter="_set_bundled_scene" getter="_get_bundled_scene" default="{ &quot;conn_count&quot;: 0, &quot;conns&quot;: PackedInt32Array(), &quot;editable_instances&quot;: [], &quot;names&quot;: PackedStringArray(), &quot;node_count&quot;: 0, &quot;node_paths&quot;: [], &quot;nodes&quot;: PackedInt32Array(), &quot;variants&quot;: [], &quot;version&quot;: 2 }">
A dictionary representation of the scene contents.
Available keys include "rnames" and "variants" for resources, "node_count", "nodes", "node_paths" for nodes, "editable_instances" for base scene children overrides, "conn_count" and "conns" for signal connections, and "version" for the format style of the PackedScene.
</member>
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index 9e2d789076..357186b917 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -487,7 +487,7 @@
</member>
<member name="display/window/handheld/orientation" type="int" setter="" getter="" default="0">
The default screen orientation to use on mobile devices. See [enum DisplayServer.ScreenOrientation] for possible values.
- [b]Note:[/b] When set to a portrait orientation, this project setting does not flip the project resolution's width and height automatically. Instead, you have to set [member display/window/size/width] and [member display/window/size/height] accordingly.
+ [b]Note:[/b] When set to a portrait orientation, this project setting does not flip the project resolution's width and height automatically. Instead, you have to set [member display/window/size/viewport_width] and [member display/window/size/viewport_height] accordingly.
</member>
<member name="display/window/ios/hide_home_indicator" type="bool" setter="" getter="" default="true">
If [code]true[/code], the home indicator is hidden automatically. This only affects iOS devices without a physical home button.
@@ -505,21 +505,23 @@
Regardless of the platform, enabling fullscreen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=$DOCS_URL/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling fullscreen mode.
[b]Note:[/b] This setting is ignored on iOS, Android, and HTML5.
</member>
- <member name="display/window/size/height" type="int" setter="" getter="" default="600">
- Sets the game's main viewport height. On desktop platforms, this is the default window size. Stretch mode settings also use this as a reference when enabled.
- </member>
<member name="display/window/size/resizable" type="bool" setter="" getter="" default="true">
Allows the window to be resizable by default.
[b]Note:[/b] This setting is ignored on iOS and Android.
</member>
- <member name="display/window/size/test_height" type="int" setter="" getter="" default="0">
- If greater than zero, overrides the window height when running the game. Useful for testing stretch modes.
+ <member name="display/window/size/viewport_height" type="int" setter="" getter="" default="600">
+ Sets the game's main viewport height. On desktop platforms, this is also the initial window height.
+ </member>
+ <member name="display/window/size/viewport_width" type="int" setter="" getter="" default="1024">
+ Sets the game's main viewport width. On desktop platforms, this is also the initial window width.
</member>
- <member name="display/window/size/test_width" type="int" setter="" getter="" default="0">
- If greater than zero, overrides the window width when running the game. Useful for testing stretch modes.
+ <member name="display/window/size/window_height_override" type="int" setter="" getter="" default="0">
+ On desktop platforms, sets the game's initial window height.
+ [b]Note:[/b] By default, or when set to 0, the initial window height is the [member display/window/size/viewport_height]. This setting is ignored on iOS, Android, and HTML5.
</member>
- <member name="display/window/size/width" type="int" setter="" getter="" default="1024">
- Sets the game's main viewport width. On desktop platforms, this is the default window size. Stretch mode settings also use this as a reference when enabled.
+ <member name="display/window/size/window_width_override" type="int" setter="" getter="" default="0">
+ On desktop platforms, sets the game's initial window width.
+ [b]Note:[/b] By default, or when set to 0, the initial window width is the viewport [member display/window/size/viewport_width]. This setting is ignored on iOS, Android, and HTML5.
</member>
<member name="display/window/vsync/vsync_mode" type="int" setter="" getter="" default="1">
Sets the VSync mode for the main game window.
diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml
index 5127455b4d..b91f3595f1 100644
--- a/doc/classes/RenderingServer.xml
+++ b/doc/classes/RenderingServer.xml
@@ -1838,8 +1838,7 @@
<argument index="1" name="primitive" type="int" enum="RenderingServer.PrimitiveType" />
<argument index="2" name="arrays" type="Array" />
<argument index="3" name="blend_shapes" type="Array" default="[]" />
- <argument index="4" name="lods" type="Dictionary" default="{
-}" />
+ <argument index="4" name="lods" type="Dictionary" default="{}" />
<argument index="5" name="compress_format" type="int" default="0" />
<description>
</description>
diff --git a/doc/classes/TextLine.xml b/doc/classes/TextLine.xml
index 1eaccf4604..bf1abf86ae 100644
--- a/doc/classes/TextLine.xml
+++ b/doc/classes/TextLine.xml
@@ -24,8 +24,7 @@
<argument index="0" name="text" type="String" />
<argument index="1" name="fonts" type="Font" />
<argument index="2" name="size" type="int" />
- <argument index="3" name="opentype_features" type="Dictionary" default="{
-}" />
+ <argument index="3" name="opentype_features" type="Dictionary" default="{}" />
<argument index="4" name="language" type="String" default="&quot;&quot;" />
<description>
Adds text span and font to draw it.
diff --git a/doc/classes/TextParagraph.xml b/doc/classes/TextParagraph.xml
index ff193a0e4b..3d3c0dd6ff 100644
--- a/doc/classes/TextParagraph.xml
+++ b/doc/classes/TextParagraph.xml
@@ -24,8 +24,7 @@
<argument index="0" name="text" type="String" />
<argument index="1" name="fonts" type="Font" />
<argument index="2" name="size" type="int" />
- <argument index="3" name="opentype_features" type="Dictionary" default="{
-}" />
+ <argument index="3" name="opentype_features" type="Dictionary" default="{}" />
<argument index="4" name="language" type="String" default="&quot;&quot;" />
<description>
Adds text span and font to draw it.
@@ -259,8 +258,7 @@
<argument index="1" name="fonts" type="Font" />
<argument index="2" name="size" type="int" />
<argument index="3" name="dropcap_margins" type="Rect2" default="Rect2(0, 0, 0, 0)" />
- <argument index="4" name="opentype_features" type="Dictionary" default="{
-}" />
+ <argument index="4" name="opentype_features" type="Dictionary" default="{}" />
<argument index="5" name="language" type="String" default="&quot;&quot;" />
<description>
Sets drop cap, overrides previously set drop cap. Drop cap (dropped capital) is a decorative element at the beginning of a paragraph that is larger than the rest of the text.
diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml
index 5be6113dda..61024ef0c8 100644
--- a/doc/classes/TextServer.xml
+++ b/doc/classes/TextServer.xml
@@ -913,8 +913,7 @@
<argument index="1" name="text" type="String" />
<argument index="2" name="fonts" type="Array" />
<argument index="3" name="size" type="int" />
- <argument index="4" name="opentype_features" type="Dictionary" default="{
-}" />
+ <argument index="4" name="opentype_features" type="Dictionary" default="{}" />
<argument index="5" name="language" type="String" default="&quot;&quot;" />
<description>
Adds text span and font to draw it to the text buffer.
diff --git a/editor/doc_tools.cpp b/editor/doc_tools.cpp
index a71e16b66c..6804ec32ac 100644
--- a/editor/doc_tools.cpp
+++ b/editor/doc_tools.cpp
@@ -410,7 +410,7 @@ void DocTools::generate(bool p_basic_types) {
//used to track uninitialized values using valgrind
//print_line("getting default value for " + String(name) + "." + String(E.name));
if (default_value_valid && default_value.get_type() != Variant::OBJECT) {
- prop.default_value = default_value.get_construct_string().replace("\n", "");
+ prop.default_value = default_value.get_construct_string().replace("\n", " ");
}
StringName setter = ClassDB::get_property_setter(name, E.name);
@@ -522,7 +522,7 @@ void DocTools::generate(bool p_basic_types) {
int darg_idx = i - (E.arguments.size() - E.default_arguments.size());
if (darg_idx >= 0) {
Variant default_arg = E.default_arguments[darg_idx];
- argument.default_value = default_arg.get_construct_string();
+ argument.default_value = default_arg.get_construct_string().replace("\n", " ");
}
method.arguments.push_back(argument);
@@ -585,7 +585,7 @@ void DocTools::generate(bool p_basic_types) {
tid.name = E;
tid.type = "Color";
tid.data_type = "color";
- tid.default_value = Variant(Theme::get_default()->get_color(E, cname)).get_construct_string();
+ tid.default_value = Variant(Theme::get_default()->get_color(E, cname)).get_construct_string().replace("\n", " ");
c.theme_properties.push_back(tid);
}
@@ -757,7 +757,7 @@ void DocTools::generate(bool p_basic_types) {
int darg_idx = mi.default_arguments.size() - mi.arguments.size() + j;
if (darg_idx >= 0) {
Variant default_arg = mi.default_arguments[darg_idx];
- ad.default_value = default_arg.get_construct_string();
+ ad.default_value = default_arg.get_construct_string().replace("\n", " ");
}
method.arguments.push_back(ad);
@@ -801,7 +801,7 @@ void DocTools::generate(bool p_basic_types) {
DocData::PropertyDoc property;
property.name = pi.name;
property.type = Variant::get_type_name(pi.type);
- property.default_value = v.get(pi.name).get_construct_string();
+ property.default_value = v.get(pi.name).get_construct_string().replace("\n", " ");
c.properties.push_back(property);
}
@@ -813,7 +813,7 @@ void DocTools::generate(bool p_basic_types) {
DocData::ConstantDoc constant;
constant.name = E;
Variant value = Variant::get_constant_value(Variant::Type(i), E);
- constant.value = value.get_type() == Variant::INT ? itos(value) : value.get_construct_string();
+ constant.value = value.get_type() == Variant::INT ? itos(value) : value.get_construct_string().replace("\n", " ");
constant.is_value_valid = true;
c.constants.push_back(constant);
}
@@ -930,7 +930,7 @@ void DocTools::generate(bool p_basic_types) {
int darg_idx = j - (mi.arguments.size() - mi.default_arguments.size());
if (darg_idx >= 0) {
Variant default_arg = mi.default_arguments[darg_idx];
- ad.default_value = default_arg.get_construct_string();
+ ad.default_value = default_arg.get_construct_string().replace("\n", " ");
}
md.arguments.push_back(ad);
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 11efe7202e..cc92d391d9 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -957,9 +957,10 @@ void EditorNode::_fs_changed() {
if (!export_error.is_empty()) {
ERR_PRINT(export_error);
- OS::get_singleton()->set_exit_code(EXIT_FAILURE);
+ _exit_editor(EXIT_FAILURE);
+ } else {
+ _exit_editor(EXIT_SUCCESS);
}
- _exit_editor();
}
}
@@ -1775,7 +1776,7 @@ void EditorNode::restart_editor() {
to_reopen = get_tree()->get_edited_scene_root()->get_scene_file_path();
}
- _exit_editor();
+ _exit_editor(EXIT_SUCCESS);
List<String> args;
args.push_back("--path");
@@ -3000,7 +3001,7 @@ int EditorNode::_next_unsaved_scene(bool p_valid_filename, int p_start) {
return -1;
}
-void EditorNode::_exit_editor() {
+void EditorNode::_exit_editor(int p_exit_code) {
exiting = true;
resource_preview->stop(); // stop early to avoid crashes
_save_docks();
@@ -3008,7 +3009,7 @@ void EditorNode::_exit_editor() {
// Dim the editor window while it's quitting to make it clearer that it's busy
dim_editor(true);
- get_tree()->quit();
+ get_tree()->quit(p_exit_code);
}
void EditorNode::_discard_changes(const String &p_str) {
@@ -3058,12 +3059,12 @@ void EditorNode::_discard_changes(const String &p_str) {
} break;
case FILE_QUIT: {
_menu_option_confirm(RUN_STOP, true);
- _exit_editor();
+ _exit_editor(EXIT_SUCCESS);
} break;
case RUN_PROJECT_MANAGER: {
_menu_option_confirm(RUN_STOP, true);
- _exit_editor();
+ _exit_editor(EXIT_SUCCESS);
String exec = OS::get_singleton()->get_executable_path();
List<String> args;
diff --git a/editor/editor_node.h b/editor/editor_node.h
index 7f5d23dbde..ff56040297 100644
--- a/editor/editor_node.h
+++ b/editor/editor_node.h
@@ -535,7 +535,7 @@ private:
void _add_dropped_files_recursive(const Vector<String> &p_files, String to_path);
String _recent_scene;
- void _exit_editor();
+ void _exit_editor(int p_exit_code);
bool convert_old;
diff --git a/editor/editor_run.cpp b/editor/editor_run.cpp
index 3c1799d80c..574abf85ea 100644
--- a/editor/editor_run.cpp
+++ b/editor/editor_run.cpp
@@ -98,15 +98,15 @@ Error EditorRun::run(const String &p_scene) {
screen_rect.position = DisplayServer::get_singleton()->screen_get_position(screen);
screen_rect.size = DisplayServer::get_singleton()->screen_get_size(screen);
+ Size2 window_size;
+ window_size.x = ProjectSettings::get_singleton()->get("display/window/size/viewport_width");
+ window_size.y = ProjectSettings::get_singleton()->get("display/window/size/viewport_height");
+
Size2 desired_size;
- desired_size.x = ProjectSettings::get_singleton()->get("display/window/size/width");
- desired_size.y = ProjectSettings::get_singleton()->get("display/window/size/height");
-
- Size2 test_size;
- test_size.x = ProjectSettings::get_singleton()->get("display/window/size/test_width");
- test_size.y = ProjectSettings::get_singleton()->get("display/window/size/test_height");
- if (test_size.x > 0 && test_size.y > 0) {
- desired_size = test_size;
+ desired_size.x = ProjectSettings::get_singleton()->get("display/window/size/window_width_override");
+ desired_size.y = ProjectSettings::get_singleton()->get("display/window/size/window_height_override");
+ if (desired_size.x > 0 && desired_size.y > 0) {
+ window_size = desired_size;
}
int window_placement = EditorSettings::get_singleton()->get("run/window_placement/rect");
@@ -136,7 +136,7 @@ Error EditorRun::run(const String &p_scene) {
args.push_back(itos(screen_rect.position.x) + "," + itos(screen_rect.position.y));
} break;
case 1: { // centered
- Vector2 pos = (screen_rect.position) + ((screen_rect.size - desired_size) / 2).floor();
+ Vector2 pos = (screen_rect.position) + ((screen_rect.size - window_size) / 2).floor();
args.push_back("--position");
args.push_back(itos(pos.x) + "," + itos(pos.y));
} break;
diff --git a/editor/editor_toaster.cpp b/editor/editor_toaster.cpp
index df0588c641..6c9e4ab0fc 100644
--- a/editor/editor_toaster.cpp
+++ b/editor/editor_toaster.cpp
@@ -362,6 +362,7 @@ Control *EditorToaster::popup(Control *p_control, Severity p_severity, double p_
close_button->set_flat(true);
close_button->set_icon(get_theme_icon("Close", "EditorIcons"));
close_button->connect("pressed", callable_bind(callable_mp(this, &EditorToaster::close), panel));
+ close_button->connect("theme_changed", callable_bind(callable_mp(this, &EditorToaster::_close_button_theme_changed), close_button));
hbox_container->add_child(close_button);
}
@@ -438,6 +439,13 @@ void EditorToaster::close(Control *p_control) {
toasts[p_control].popped = false;
}
+void EditorToaster::_close_button_theme_changed(Control *p_close_button) {
+ Button *close_button = Object::cast_to<Button>(p_close_button);
+ if (close_button) {
+ close_button->set_icon(get_theme_icon("Close", "EditorIcons"));
+ }
+}
+
EditorToaster *EditorToaster::get_singleton() {
return singleton;
}
diff --git a/editor/editor_toaster.h b/editor/editor_toaster.h
index b626a47d0c..5f220e98c4 100644
--- a/editor/editor_toaster.h
+++ b/editor/editor_toaster.h
@@ -95,6 +95,7 @@ private:
void _set_notifications_enabled(bool p_enabled);
void _repop_old();
void _popup_str(String p_message, Severity p_severity, String p_tooltip);
+ void _close_button_theme_changed(Control *p_close_button);
protected:
static EditorToaster *singleton;
diff --git a/editor/icons/Notification.svg b/editor/icons/Notification.svg
index 1f1f9c3e15..15695e22a8 100644
--- a/editor/icons/Notification.svg
+++ b/editor/icons/Notification.svg
@@ -1 +1 @@
-<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m12.089506 1.2353795c-.498141-.2384823-1.095292-.027987-1.333775.4701537-.01372.028981-.02341.059557-.03428.089693-.01467.023016-.02777.046925-.04071.071459-.04899-.00527-.09728-.00862-.146087-.011473-1.4730257-.6255101-3.1777024.0153376-3.8738627 1.4563251l-1.7272425 3.6078572s-.3364181.7034345-.8079671 1.1268133c-.00105.0009371-.00239.00174-.00344.00268-.2721193.1337295-.5707545.185826-.8605632.0470816-.4981411-.2384824-1.0952924-.0279876-1.3337749.4701537-.01605.033526-.029907.066894-.041944.1011828-.018769.030371-.036749.06319-.052515.096122-.2384825.4981412-.027988 1.0952923.4701537 1.3337751l9.0196437 4.318106c.498141.238482 1.095292.02799 1.333775-.470154.01577-.03293.0301-.0675.04191-.1012.0192-.03086.0365-.06257.05255-.0961.238483-.498141.02799-1.095292-.470153-1.333775-.901965-.43181-.03834-2.235739-.03834-2.235739l1.727237-3.6078618c.715447-1.4944233.08396-3.2858776-1.410461-4.0013247.238482-.4981411.02799-1.0952926-.470154-1.333775zm-5.5145786 11.3714015c-.322341.673306-.037829 1.480435.6354753 1.802775.6733031.32234 1.4804334.03783 1.8027749-.635476z" fill="#e6e6e6"/></svg>
+<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m12.089506 1.2353795c-.498141-.2384823-1.095292-.027987-1.333775.4701537-.01372.028981-.02341.059557-.03428.089693-.01467.023016-.02777.046925-.04071.071459-.04899-.00527-.09728-.00862-.146087-.011473-1.4730257-.6255101-3.1777024.0153376-3.8738627 1.4563251l-1.7272425 3.6078572s-.3364181.7034345-.8079671 1.1268133c-.00105.0009371-.00239.00174-.00344.00268-.2721193.1337295-.5707545.185826-.8605632.0470816-.4981411-.2384824-1.0952924-.0279876-1.3337749.4701537-.01605.033526-.029907.066894-.041944.1011828-.018769.030371-.036749.06319-.052515.096122-.2384825.4981412-.027988 1.0952923.4701537 1.3337751l9.0196437 4.318106c.498141.238482 1.095292.02799 1.333775-.470154.01577-.03293.0301-.0675.04191-.1012.0192-.03086.0365-.06257.05255-.0961.238483-.498141.02799-1.095292-.470153-1.333775-.901965-.43181-.03834-2.235739-.03834-2.235739l1.727237-3.6078618c.715447-1.4944233.08396-3.2858776-1.410461-4.0013247.238482-.4981411.02799-1.0952926-.470154-1.333775zm-5.5145786 11.3714015c-.322341.673306-.037829 1.480435.6354753 1.802775.6733031.32234 1.4804334.03783 1.8027749-.635476z" fill="#e0e0e0"/></svg>
diff --git a/editor/icons/NotificationDisabled.svg b/editor/icons/NotificationDisabled.svg
index 0e4465bee8..294682a42c 100644
--- a/editor/icons/NotificationDisabled.svg
+++ b/editor/icons/NotificationDisabled.svg
@@ -1 +1 @@
-<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m11.705078 1.1386719c-.389281-.0180576-.770356.1928007-.949219.5664062-.01372.028981-.024286.0597078-.035156.0898438-.01467.023016-.026122.0477316-.039062.0722656-.04899-.00527-.097678-.0088657-.146485-.0117187-1.4730253-.6255102-3.1788394.0160437-3.8749998 1.4570312l-1.7265624 3.6074219s-.3370448.7035743-.8085938 1.1269531l-.0019531.0019531c-.2721193.1337295-.5715196.1856194-.8613281.046875-.4981413-.2384824-1.0955019-.0274382-1.3339844.4707031-.01605.0335262-.0289787.0672737-.0410156.1015626-.0187691.0303709-.0369684.0627711-.0527344.0957031-.2384825.4981412-.0293917 1.0955019.46875 1.3339841l.3398437.16211 10.8984379-6.9394535c-.263272-.3070418-.592225-.5660832-.980469-.7519531.238482-.4981411.027441-1.0935489-.470703-1.3320313-.124536-.0596206-.255006-.091637-.384766-.0976562zm2.435547 2.8652343a.94188849 1 0 0 0 -.566406.1386719l-12.1171878 7.7148439a.94188849 1 0 0 0 -.3222656 1.373047.94188849 1 0 0 0 1.2910156.341797l12.1171878-7.7148441a.94188849 1 0 0 0 .322265-1.3710938.94188849 1 0 0 0 -.724609-.4824219zm-.509766 3.2753907-7.3867184 4.7050781 5.0781254 2.431641c.498141.238482 1.095501.027442 1.333984-.470704.01577-.03293.031159-.067862.042969-.101562.0192-.03086.036684-.062173.052734-.095703.238483-.498141.02744-1.095501-.470703-1.333985-.901965-.431809-.039063-2.236328-.039062-2.236328zm-7.0566402 5.3281251c-.322341.673306-.0365856 1.480394.6367187 1.802734.6733031.32234 1.4803929.036588 1.8027344-.636718z" fill="#e6e6e6"/></svg>
+<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m11.705078 1.1386719c-.389281-.0180576-.770356.1928007-.949219.5664062-.01372.028981-.024286.0597078-.035156.0898438-.01467.023016-.026122.0477316-.039062.0722656-.04899-.00527-.097678-.0088657-.146485-.0117187-1.4730253-.6255102-3.1788394.0160437-3.8749998 1.4570312l-1.7265624 3.6074219s-.3370448.7035743-.8085938 1.1269531l-.0019531.0019531c-.2721193.1337295-.5715196.1856194-.8613281.046875-.4981413-.2384824-1.0955019-.0274382-1.3339844.4707031-.01605.0335262-.0289787.0672737-.0410156.1015626-.0187691.0303709-.0369684.0627711-.0527344.0957031-.2384825.4981412-.0293917 1.0955019.46875 1.3339841l.3398437.16211 10.8984379-6.9394535c-.263272-.3070418-.592225-.5660832-.980469-.7519531.238482-.4981411.027441-1.0935489-.470703-1.3320313-.124536-.0596206-.255006-.091637-.384766-.0976562zm2.435547 2.8652343a.94188849 1 0 0 0 -.566406.1386719l-12.1171878 7.7148439a.94188849 1 0 0 0 -.3222656 1.373047.94188849 1 0 0 0 1.2910156.341797l12.1171878-7.7148441a.94188849 1 0 0 0 .322265-1.3710938.94188849 1 0 0 0 -.724609-.4824219zm-.509766 3.2753907-7.3867184 4.7050781 5.0781254 2.431641c.498141.238482 1.095501.027442 1.333984-.470704.01577-.03293.031159-.067862.042969-.101562.0192-.03086.036684-.062173.052734-.095703.238483-.498141.02744-1.095501-.470703-1.333985-.901965-.431809-.039063-2.236328-.039062-2.236328zm-7.0566402 5.3281251c-.322341.673306-.0365856 1.480394.6367187 1.802734.6733031.32234 1.4803929.036588 1.8027344-.636718z" fill="#e0e0e0"/></svg>
diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp
index e801cd4553..b6624a8cfa 100644
--- a/editor/import/resource_importer_scene.cpp
+++ b/editor/import/resource_importer_scene.cpp
@@ -370,16 +370,17 @@ static void _pre_gen_shape_list(Ref<ImporterMesh> &mesh, Vector<Ref<Shape3D>> &r
}
}
-Node *ResourceImporterScene::_pre_fix_node(Node *p_node, Node *p_root, Map<Ref<ImporterMesh>, Vector<Ref<Shape3D>>> &collision_map) {
- // children first
+Node *ResourceImporterScene::_pre_fix_node(Node *p_node, Node *p_root, Map<Ref<ImporterMesh>, Vector<Ref<Shape3D>>> &collision_map, List<Pair<NodePath, Node *>> &r_node_renames) {
+ // Children first.
for (int i = 0; i < p_node->get_child_count(); i++) {
- Node *r = _pre_fix_node(p_node->get_child(i), p_root, collision_map);
+ Node *r = _pre_fix_node(p_node->get_child(i), p_root, collision_map, r_node_renames);
if (!r) {
- i--; //was erased
+ i--; // Was erased.
}
}
String name = p_node->get_name();
+ NodePath original_path = p_root->get_path_to(p_node); // Used to detect renames due to import hints.
bool isroot = p_node == p_root;
@@ -414,14 +415,21 @@ Node *ResourceImporterScene::_pre_fix_node(Node *p_node, Node *p_root, Map<Ref<I
}
if (Object::cast_to<AnimationPlayer>(p_node)) {
- //remove animations referencing non-importable nodes
AnimationPlayer *ap = Object::cast_to<AnimationPlayer>(p_node);
+ // Node paths in animation tracks are relative to the following path (this is used to fix node paths below).
+ Node *ap_root = ap->get_node(ap->get_root());
+ NodePath path_prefix = p_root->get_path_to(ap_root);
+
+ bool nodes_were_renamed = r_node_renames.size() != 0;
+
List<StringName> anims;
ap->get_animation_list(&anims);
for (const StringName &E : anims) {
Ref<Animation> anim = ap->get_animation(E);
ERR_CONTINUE(anim.is_null());
+
+ // Remove animation tracks referencing non-importable nodes.
for (int i = 0; i < anim->get_track_count(); i++) {
NodePath path = anim->track_get_path(i);
@@ -435,6 +443,27 @@ Node *ResourceImporterScene::_pre_fix_node(Node *p_node, Node *p_root, Map<Ref<I
}
}
+ // Fix node paths in animations, in case nodes were renamed earlier due to import hints.
+ if (nodes_were_renamed) {
+ for (int i = 0; i < anim->get_track_count(); i++) {
+ NodePath path = anim->track_get_path(i);
+ // Convert track path to absolute node path without subnames (some manual work because we are not in the scene tree).
+ Vector<StringName> absolute_path_names = path_prefix.get_names();
+ absolute_path_names.append_array(path.get_names());
+ NodePath absolute_path(absolute_path_names, false);
+ absolute_path.simplify();
+ // Fix paths to renamed nodes.
+ for (const Pair<NodePath, Node *> &F : r_node_renames) {
+ if (F.first == absolute_path) {
+ NodePath new_path(ap_root->get_path_to(F.second).get_names(), path.get_subnames(), false);
+ print_verbose(vformat("Fix: Correcting node path in animation track: %s should be %s", path, new_path));
+ anim->track_set_path(i, new_path);
+ break; // Only one match is possible.
+ }
+ }
+ }
+ }
+
String animname = E;
const int loop_string_count = 3;
static const char *loop_strings[loop_string_count] = { "loop_mode", "loop", "cycle" };
@@ -452,13 +481,22 @@ Node *ResourceImporterScene::_pre_fix_node(Node *p_node, Node *p_root, Map<Ref<I
if (isroot) {
return p_node;
}
+
+ String fixed_name;
+ if (_teststr(name, "colonly")) {
+ fixed_name = _fixstr(name, "colonly");
+ } else if (_teststr(name, "convcolonly")) {
+ fixed_name = _fixstr(name, "convcolonly");
+ }
+
+ ERR_FAIL_COND_V(fixed_name.is_empty(), nullptr);
+
ImporterMeshInstance3D *mi = Object::cast_to<ImporterMeshInstance3D>(p_node);
if (mi) {
Ref<ImporterMesh> mesh = mi->get_mesh();
if (mesh.is_valid()) {
Vector<Ref<Shape3D>> shapes;
- String fixed_name;
if (collision_map.has(mesh)) {
shapes = collision_map[mesh];
} else if (_teststr(name, "colonly")) {
@@ -469,14 +507,6 @@ Node *ResourceImporterScene::_pre_fix_node(Node *p_node, Node *p_root, Map<Ref<I
collision_map[mesh] = shapes;
}
- if (_teststr(name, "colonly")) {
- fixed_name = _fixstr(name, "colonly");
- } else if (_teststr(name, "convcolonly")) {
- fixed_name = _fixstr(name, "convcolonly");
- }
-
- ERR_FAIL_COND_V(fixed_name.is_empty(), nullptr);
-
if (shapes.size()) {
StaticBody3D *col = memnew(StaticBody3D);
col->set_transform(mi->get_transform());
@@ -492,11 +522,11 @@ Node *ResourceImporterScene::_pre_fix_node(Node *p_node, Node *p_root, Map<Ref<I
} else if (p_node->has_meta("empty_draw_type")) {
String empty_draw_type = String(p_node->get_meta("empty_draw_type"));
StaticBody3D *sb = memnew(StaticBody3D);
- sb->set_name(_fixstr(name, "colonly"));
+ sb->set_name(fixed_name);
Object::cast_to<Node3D>(sb)->set_transform(Object::cast_to<Node3D>(p_node)->get_transform());
p_node->replace_by(sb);
memdelete(p_node);
- p_node = nullptr;
+ p_node = sb;
CollisionShape3D *colshape = memnew(CollisionShape3D);
if (empty_draw_type == "CUBE") {
BoxShape3D *boxShape = memnew(BoxShape3D);
@@ -635,6 +665,14 @@ Node *ResourceImporterScene::_pre_fix_node(Node *p_node, Node *p_root, Map<Ref<I
}
}
+ if (p_node) {
+ NodePath new_path = p_root->get_path_to(p_node);
+ if (new_path != original_path) {
+ print_verbose(vformat("Fix: Renamed %s to %s", original_path, new_path));
+ r_node_renames.push_back({ original_path, p_node });
+ }
+ }
+
return p_node;
}
@@ -1828,8 +1866,8 @@ Node *ResourceImporterScene::pre_import(const String &p_source_file) {
}
Map<Ref<ImporterMesh>, Vector<Ref<Shape3D>>> collision_map;
-
- _pre_fix_node(scene, scene, collision_map);
+ List<Pair<NodePath, Node *>> node_renames;
+ _pre_fix_node(scene, scene, collision_map, node_renames);
return scene;
}
@@ -1904,8 +1942,9 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p
Set<Ref<ImporterMesh>> scanned_meshes;
Map<Ref<ImporterMesh>, Vector<Ref<Shape3D>>> collision_map;
+ List<Pair<NodePath, Node *>> node_renames;
- _pre_fix_node(scene, scene, collision_map);
+ _pre_fix_node(scene, scene, collision_map, node_renames);
for (int i = 0; i < post_importer_plugins.size(); i++) {
post_importer_plugins.write[i]->pre_process(scene, p_options);
diff --git a/editor/import/resource_importer_scene.h b/editor/import/resource_importer_scene.h
index 00d095eac1..066e8b603b 100644
--- a/editor/import/resource_importer_scene.h
+++ b/editor/import/resource_importer_scene.h
@@ -261,7 +261,7 @@ public:
// Import scenes *after* everything else (such as textures).
virtual int get_import_order() const override { return ResourceImporter::IMPORT_ORDER_SCENE; }
- Node *_pre_fix_node(Node *p_node, Node *p_root, Map<Ref<ImporterMesh>, Vector<Ref<Shape3D>>> &collision_map);
+ Node *_pre_fix_node(Node *p_node, Node *p_root, Map<Ref<ImporterMesh>, Vector<Ref<Shape3D>>> &collision_map, List<Pair<NodePath, Node *>> &r_node_renames);
Node *_post_fix_node(Node *p_node, Node *p_root, Map<Ref<ImporterMesh>, Vector<Ref<Shape3D>>> &collision_map, Set<Ref<ImporterMesh>> &r_scanned_meshes, const Dictionary &p_node_data, const Dictionary &p_material_data, const Dictionary &p_animation_data, float p_animation_fps);
Ref<Animation> _save_animation_to_file(Ref<Animation> anim, bool p_save_to_file, String p_save_to_path, bool p_keep_custom_tracks);
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index cb84e7ea65..970d53a137 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -3517,7 +3517,7 @@ void CanvasItemEditor::_draw_axis() {
Color area_axis_color = EditorSettings::get_singleton()->get("editors/2d/viewport_border_color");
- Size2 screen_size = Size2(ProjectSettings::get_singleton()->get("display/window/size/width"), ProjectSettings::get_singleton()->get("display/window/size/height"));
+ Size2 screen_size = Size2(ProjectSettings::get_singleton()->get("display/window/size/viewport_width"), ProjectSettings::get_singleton()->get("display/window/size/viewport_height"));
Vector2 screen_endpoints[4] = {
transform.xform(Vector2(0, 0)),
@@ -4010,7 +4010,7 @@ void CanvasItemEditor::_update_scrollbars() {
Size2 vmin = v_scroll->get_minimum_size();
// Get the visible frame.
- Size2 screen_rect = Size2(ProjectSettings::get_singleton()->get("display/window/size/width"), ProjectSettings::get_singleton()->get("display/window/size/height"));
+ Size2 screen_rect = Size2(ProjectSettings::get_singleton()->get("display/window/size/viewport_width"), ProjectSettings::get_singleton()->get("display/window/size/viewport_height"));
Rect2 local_rect = Rect2(Point2(), viewport->get_size() - Size2(vmin.width, hmin.height));
// Calculate scrollable area.
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index 6ea8fba9b5..ef9c6a65e7 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -3064,7 +3064,7 @@ void Node3DEditorViewport::_draw() {
Math::round(2 * EDSCALE));
}
if (previewing) {
- Size2 ss = Size2(ProjectSettings::get_singleton()->get("display/window/size/width"), ProjectSettings::get_singleton()->get("display/window/size/height"));
+ Size2 ss = Size2(ProjectSettings::get_singleton()->get("display/window/size/viewport_width"), ProjectSettings::get_singleton()->get("display/window/size/viewport_height"));
float aspect = ss.aspect();
Size2 s = get_size();
diff --git a/main/main.cpp b/main/main.cpp
index 7350e15ef5..8b58641461 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -1306,47 +1306,47 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
// always convert to lower case for consistency in the code
rendering_driver = rendering_driver.to_lower();
- GLOBAL_DEF_BASIC("display/window/size/width", 1024);
- ProjectSettings::get_singleton()->set_custom_property_info("display/window/size/width",
- PropertyInfo(Variant::INT, "display/window/size/width",
+ GLOBAL_DEF_BASIC("display/window/size/viewport_width", 1024);
+ ProjectSettings::get_singleton()->set_custom_property_info("display/window/size/viewport_width",
+ PropertyInfo(Variant::INT, "display/window/size/viewport_width",
PROPERTY_HINT_RANGE,
"0,7680,or_greater")); // 8K resolution
- GLOBAL_DEF_BASIC("display/window/size/height", 600);
- ProjectSettings::get_singleton()->set_custom_property_info("display/window/size/height",
- PropertyInfo(Variant::INT, "display/window/size/height",
+ GLOBAL_DEF_BASIC("display/window/size/viewport_height", 600);
+ ProjectSettings::get_singleton()->set_custom_property_info("display/window/size/viewport_height",
+ PropertyInfo(Variant::INT, "display/window/size/viewport_height",
PROPERTY_HINT_RANGE,
"0,4320,or_greater")); // 8K resolution
GLOBAL_DEF_BASIC("display/window/size/resizable", true);
GLOBAL_DEF_BASIC("display/window/size/borderless", false);
GLOBAL_DEF_BASIC("display/window/size/fullscreen", false);
GLOBAL_DEF("display/window/size/always_on_top", false);
- GLOBAL_DEF("display/window/size/test_width", 0);
- ProjectSettings::get_singleton()->set_custom_property_info("display/window/size/test_width",
+ GLOBAL_DEF("display/window/size/window_width_override", 0);
+ ProjectSettings::get_singleton()->set_custom_property_info("display/window/size/window_width_override",
PropertyInfo(Variant::INT,
- "display/window/size/test_width",
+ "display/window/size/window_width_override",
PROPERTY_HINT_RANGE,
"0,7680,or_greater")); // 8K resolution
- GLOBAL_DEF("display/window/size/test_height", 0);
- ProjectSettings::get_singleton()->set_custom_property_info("display/window/size/test_height",
+ GLOBAL_DEF("display/window/size/window_height_override", 0);
+ ProjectSettings::get_singleton()->set_custom_property_info("display/window/size/window_height_override",
PropertyInfo(Variant::INT,
- "display/window/size/test_height",
+ "display/window/size/window_height_override",
PROPERTY_HINT_RANGE,
"0,4320,or_greater")); // 8K resolution
if (use_custom_res) {
if (!force_res) {
- window_size.width = GLOBAL_GET("display/window/size/width");
- window_size.height = GLOBAL_GET("display/window/size/height");
-
- if (globals->has_setting("display/window/size/test_width") &&
- globals->has_setting("display/window/size/test_height")) {
- int tw = globals->get("display/window/size/test_width");
- if (tw > 0) {
- window_size.width = tw;
+ window_size.width = GLOBAL_GET("display/window/size/viewport_width");
+ window_size.height = GLOBAL_GET("display/window/size/viewport_height");
+
+ if (globals->has_setting("display/window/size/window_width_override") &&
+ globals->has_setting("display/window/size/window_height_override")) {
+ int desired_width = globals->get("display/window/size/window_width_override");
+ if (desired_width > 0) {
+ window_size.width = desired_width;
}
- int th = globals->get("display/window/size/test_height");
- if (th > 0) {
- window_size.height = th;
+ int desired_height = globals->get("display/window/size/window_height_override");
+ if (desired_height > 0) {
+ window_size.height = desired_height;
}
}
}
@@ -2348,8 +2348,8 @@ bool Main::start() {
String stretch_mode = GLOBAL_DEF_BASIC("display/window/stretch/mode", "disabled");
String stretch_aspect = GLOBAL_DEF_BASIC("display/window/stretch/aspect", "keep");
- Size2i stretch_size = Size2i(GLOBAL_DEF_BASIC("display/window/size/width", 0),
- GLOBAL_DEF_BASIC("display/window/size/height", 0));
+ Size2i stretch_size = Size2i(GLOBAL_DEF_BASIC("display/window/size/viewport_width", 0),
+ GLOBAL_DEF_BASIC("display/window/size/viewport_height", 0));
real_t stretch_scale = GLOBAL_DEF_BASIC("display/window/stretch/scale", 1.0);
Window::ContentScaleMode cs_sm = Window::CONTENT_SCALE_MODE_DISABLED;
diff --git a/modules/webrtc/doc_classes/WebRTCPeerConnection.xml b/modules/webrtc/doc_classes/WebRTCPeerConnection.xml
index 618fe14137..2f2c2c379d 100644
--- a/modules/webrtc/doc_classes/WebRTCPeerConnection.xml
+++ b/modules/webrtc/doc_classes/WebRTCPeerConnection.xml
@@ -33,8 +33,7 @@
<method name="create_data_channel">
<return type="WebRTCDataChannel" />
<argument index="0" name="label" type="String" />
- <argument index="1" name="options" type="Dictionary" default="{
-}" />
+ <argument index="1" name="options" type="Dictionary" default="{}" />
<description>
Returns a new [WebRTCDataChannel] (or [code]null[/code] on failure) with given [code]label[/code] and optionally configured via the [code]options[/code] dictionary. This method can only be called when the connection is in state [constant STATE_NEW].
There are two ways to create a working data channel: either call [method create_data_channel] on only one of the peer and listen to [signal data_channel_received] on the other, or call [method create_data_channel] on both peers, with the same values, and the [code]negotiated[/code] option set to [code]true[/code].
@@ -70,8 +69,7 @@
</method>
<method name="initialize">
<return type="int" enum="Error" />
- <argument index="0" name="configuration" type="Dictionary" default="{
-}" />
+ <argument index="0" name="configuration" type="Dictionary" default="{}" />
<description>
Re-initialize this peer connection, closing any previously active connection, and going back to state [constant STATE_NEW]. A dictionary of [code]options[/code] can be passed to configure the peer connection.
Valid [code]options[/code] are:
diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp
index aa44183329..78155fbef3 100644
--- a/platform/android/export/export_plugin.cpp
+++ b/platform/android/export/export_plugin.cpp
@@ -1514,7 +1514,7 @@ String EditorExportPlatformAndroid::load_splash_refs(Ref<Image> &splash_image, R
}
if (scale_splash) {
- Size2 screen_size = Size2(ProjectSettings::get_singleton()->get("display/window/size/width"), ProjectSettings::get_singleton()->get("display/window/size/height"));
+ Size2 screen_size = Size2(ProjectSettings::get_singleton()->get("display/window/size/viewport_width"), ProjectSettings::get_singleton()->get("display/window/size/viewport_height"));
int width, height;
if (screen_size.width > screen_size.height) {
// scale horizontally
diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp
index f4c0665f36..e8dfaf9c2e 100644
--- a/scene/2d/camera_2d.cpp
+++ b/scene/2d/camera_2d.cpp
@@ -530,7 +530,7 @@ Point2 Camera2D::get_camera_screen_center() const {
Size2 Camera2D::_get_camera_screen_size() const {
// special case if the camera2D is in the root viewport
if (Engine::get_singleton()->is_editor_hint() && get_viewport()->get_parent_viewport() == get_tree()->get_root()) {
- return Size2(ProjectSettings::get_singleton()->get("display/window/size/width"), ProjectSettings::get_singleton()->get("display/window/size/height"));
+ return Size2(ProjectSettings::get_singleton()->get("display/window/size/viewport_width"), ProjectSettings::get_singleton()->get("display/window/size/viewport_height"));
}
return get_viewport_rect().size;
}
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index 69e6d74292..11d7946866 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -1306,7 +1306,7 @@ Rect2 Control::get_parent_anchorable_rect() const {
#ifdef TOOLS_ENABLED
Node *edited_root = get_tree()->get_edited_scene_root();
if (edited_root && (this == edited_root || edited_root->is_ancestor_of(this))) {
- parent_rect.size = Size2(ProjectSettings::get_singleton()->get("display/window/size/width"), ProjectSettings::get_singleton()->get("display/window/size/height"));
+ parent_rect.size = Size2(ProjectSettings::get_singleton()->get("display/window/size/viewport_width"), ProjectSettings::get_singleton()->get("display/window/size/viewport_height"));
} else {
parent_rect = get_viewport()->get_visible_rect();
}
diff --git a/thirdparty/README.md b/thirdparty/README.md
index 6183aaa03c..2cb5458952 100644
--- a/thirdparty/README.md
+++ b/thirdparty/README.md
@@ -613,6 +613,8 @@ Files extracted from upstream source:
See `thorvg/update-thorvg.sh` for extraction instructions. Set the version
number and run the script.
+Patches in the `patches` directory should be re-applied after updates.
+
## vhacd
diff --git a/thirdparty/thorvg/patches/thorvg-pr1159-mingw-fix.patch b/thirdparty/thorvg/patches/thorvg-pr1159-mingw-fix.patch
new file mode 100644
index 0000000000..a174880306
--- /dev/null
+++ b/thirdparty/thorvg/patches/thorvg-pr1159-mingw-fix.patch
@@ -0,0 +1,73 @@
+diff --git a/thirdparty/thorvg/src/loaders/svg/tvgSvgLoader.cpp b/thirdparty/thorvg/src/loaders/svg/tvgSvgLoader.cpp
+index def8ae169a..cf103774c5 100644
+--- a/thirdparty/thorvg/src/loaders/svg/tvgSvgLoader.cpp
++++ b/thirdparty/thorvg/src/loaders/svg/tvgSvgLoader.cpp
+@@ -51,6 +51,7 @@
+
+ #define _USE_MATH_DEFINES //Math Constants are not defined in Standard C/C++.
+
++#include <cstring>
+ #include <fstream>
+ #include <float.h>
+ #include <math.h>
+diff --git a/thirdparty/thorvg/src/loaders/svg/tvgSvgPath.cpp b/thirdparty/thorvg/src/loaders/svg/tvgSvgPath.cpp
+index 2b62315de8..32685ee620 100644
+--- a/thirdparty/thorvg/src/loaders/svg/tvgSvgPath.cpp
++++ b/thirdparty/thorvg/src/loaders/svg/tvgSvgPath.cpp
+@@ -50,6 +50,7 @@
+
+ #define _USE_MATH_DEFINES //Math Constants are not defined in Standard C/C++.
+
++#include <cstring>
+ #include <math.h>
+ #include <clocale>
+ #include <ctype.h>
+diff --git a/thirdparty/thorvg/src/loaders/svg/tvgSvgSceneBuilder.cpp b/thirdparty/thorvg/src/loaders/svg/tvgSvgSceneBuilder.cpp
+index 8701fe32b1..ae17634f31 100644
+--- a/thirdparty/thorvg/src/loaders/svg/tvgSvgSceneBuilder.cpp
++++ b/thirdparty/thorvg/src/loaders/svg/tvgSvgSceneBuilder.cpp
+@@ -49,6 +49,7 @@
+ */
+
+
++#include <cstring>
+ #include <string>
+ #include "tvgMath.h"
+ #include "tvgSvgLoaderCommon.h"
+diff --git a/thirdparty/thorvg/src/loaders/svg/tvgSvgUtil.cpp b/thirdparty/thorvg/src/loaders/svg/tvgSvgUtil.cpp
+index d5b9cdcf7b..9f269b29a2 100644
+--- a/thirdparty/thorvg/src/loaders/svg/tvgSvgUtil.cpp
++++ b/thirdparty/thorvg/src/loaders/svg/tvgSvgUtil.cpp
+@@ -20,6 +20,7 @@
+ * SOFTWARE.
+ */
+
++#include <cstring>
+ #include <math.h>
+ #include <memory.h>
+ #include "tvgSvgUtil.h"
+diff --git a/thirdparty/thorvg/src/loaders/svg/tvgXmlParser.cpp b/thirdparty/thorvg/src/loaders/svg/tvgXmlParser.cpp
+index 2e3d5928d9..1571aa4e25 100644
+--- a/thirdparty/thorvg/src/loaders/svg/tvgXmlParser.cpp
++++ b/thirdparty/thorvg/src/loaders/svg/tvgXmlParser.cpp
+@@ -20,6 +20,7 @@
+ * SOFTWARE.
+ */
+
++#include <cstring>
+ #include <ctype.h>
+ #include <string>
+
+diff --git a/thirdparty/thorvg/src/savers/tvg/tvgTvgSaver.cpp b/thirdparty/thorvg/src/savers/tvg/tvgTvgSaver.cpp
+index 9450d80e88..9dd57e5a89 100644
+--- a/thirdparty/thorvg/src/savers/tvg/tvgTvgSaver.cpp
++++ b/thirdparty/thorvg/src/savers/tvg/tvgTvgSaver.cpp
+@@ -24,6 +24,8 @@
+ #include "tvgTvgSaver.h"
+ #include "tvgLzw.h"
+
++#include <cstring>
++
+ #ifdef _WIN32
+ #include <malloc.h>
+ #else
diff --git a/thirdparty/thorvg/src/loaders/svg/tvgSvgLoader.cpp b/thirdparty/thorvg/src/loaders/svg/tvgSvgLoader.cpp
index def8ae169a..cf103774c5 100644
--- a/thirdparty/thorvg/src/loaders/svg/tvgSvgLoader.cpp
+++ b/thirdparty/thorvg/src/loaders/svg/tvgSvgLoader.cpp
@@ -51,6 +51,7 @@
#define _USE_MATH_DEFINES //Math Constants are not defined in Standard C/C++.
+#include <cstring>
#include <fstream>
#include <float.h>
#include <math.h>
diff --git a/thirdparty/thorvg/src/loaders/svg/tvgSvgPath.cpp b/thirdparty/thorvg/src/loaders/svg/tvgSvgPath.cpp
index 2b62315de8..32685ee620 100644
--- a/thirdparty/thorvg/src/loaders/svg/tvgSvgPath.cpp
+++ b/thirdparty/thorvg/src/loaders/svg/tvgSvgPath.cpp
@@ -50,6 +50,7 @@
#define _USE_MATH_DEFINES //Math Constants are not defined in Standard C/C++.
+#include <cstring>
#include <math.h>
#include <clocale>
#include <ctype.h>
diff --git a/thirdparty/thorvg/src/loaders/svg/tvgSvgSceneBuilder.cpp b/thirdparty/thorvg/src/loaders/svg/tvgSvgSceneBuilder.cpp
index 8701fe32b1..ae17634f31 100644
--- a/thirdparty/thorvg/src/loaders/svg/tvgSvgSceneBuilder.cpp
+++ b/thirdparty/thorvg/src/loaders/svg/tvgSvgSceneBuilder.cpp
@@ -49,6 +49,7 @@
*/
+#include <cstring>
#include <string>
#include "tvgMath.h"
#include "tvgSvgLoaderCommon.h"
diff --git a/thirdparty/thorvg/src/loaders/svg/tvgSvgUtil.cpp b/thirdparty/thorvg/src/loaders/svg/tvgSvgUtil.cpp
index d5b9cdcf7b..9f269b29a2 100644
--- a/thirdparty/thorvg/src/loaders/svg/tvgSvgUtil.cpp
+++ b/thirdparty/thorvg/src/loaders/svg/tvgSvgUtil.cpp
@@ -20,6 +20,7 @@
* SOFTWARE.
*/
+#include <cstring>
#include <math.h>
#include <memory.h>
#include "tvgSvgUtil.h"
diff --git a/thirdparty/thorvg/src/loaders/svg/tvgXmlParser.cpp b/thirdparty/thorvg/src/loaders/svg/tvgXmlParser.cpp
index 2e3d5928d9..1571aa4e25 100644
--- a/thirdparty/thorvg/src/loaders/svg/tvgXmlParser.cpp
+++ b/thirdparty/thorvg/src/loaders/svg/tvgXmlParser.cpp
@@ -20,6 +20,7 @@
* SOFTWARE.
*/
+#include <cstring>
#include <ctype.h>
#include <string>
diff --git a/thirdparty/thorvg/src/savers/tvg/tvgTvgSaver.cpp b/thirdparty/thorvg/src/savers/tvg/tvgTvgSaver.cpp
index 9450d80e88..9dd57e5a89 100644
--- a/thirdparty/thorvg/src/savers/tvg/tvgTvgSaver.cpp
+++ b/thirdparty/thorvg/src/savers/tvg/tvgTvgSaver.cpp
@@ -24,6 +24,8 @@
#include "tvgTvgSaver.h"
#include "tvgLzw.h"
+#include <cstring>
+
#ifdef _WIN32
#include <malloc.h>
#else