Skip to content

Commit 04d7fd2

Browse files
authored
Merge branch 'godotengine:master' into anim_tweaks
2 parents cc87b83 + 23c1389 commit 04d7fd2

30 files changed

+235
-85
lines changed

core/os/os.cpp

+17
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,23 @@ uint64_t OS::get_embedded_pck_offset() const {
222222
return 0;
223223
}
224224

225+
// Default boot screen rect scale mode is "Keep Aspect Centered"
226+
Rect2 OS::calculate_boot_screen_rect(const Size2 &p_window_size, const Size2 &p_imgrect_size) const {
227+
Rect2 screenrect;
228+
if (p_window_size.width > p_window_size.height) {
229+
// Scale horizontally.
230+
screenrect.size.y = p_window_size.height;
231+
screenrect.size.x = p_imgrect_size.x * p_window_size.height / p_imgrect_size.y;
232+
screenrect.position.x = (p_window_size.width - screenrect.size.x) / 2;
233+
} else {
234+
// Scale vertically.
235+
screenrect.size.x = p_window_size.width;
236+
screenrect.size.y = p_imgrect_size.y * p_window_size.width / p_imgrect_size.x;
237+
screenrect.position.y = (p_window_size.height - screenrect.size.y) / 2;
238+
}
239+
return screenrect;
240+
}
241+
225242
// Helper function to ensure that a dir name/path will be valid on the OS
226243
String OS::get_safe_dir_name(const String &p_dir_name, bool p_allow_paths) const {
227244
String safe_dir_name = p_dir_name;

core/os/os.h

+2
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ class OS {
161161
virtual void open_midi_inputs();
162162
virtual void close_midi_inputs();
163163

164+
virtual Rect2 calculate_boot_screen_rect(const Size2 &p_window_size, const Size2 &p_imgrect_size) const;
165+
164166
virtual void alert(const String &p_alert, const String &p_title = "ALERT!");
165167

166168
struct GDExtensionData {

doc/classes/BaseMaterial3D.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@
219219
</member>
220220
<member name="grow" type="bool" setter="set_grow_enabled" getter="is_grow_enabled" default="false">
221221
If [code]true[/code], enables the vertex grow setting. This can be used to create mesh-based outlines using a second material pass and its [member cull_mode] set to [constant CULL_FRONT]. See also [member grow_amount].
222-
[b]Note:[/b] Vertex growth cannot create new vertices, which means that visible gaps may occur in sharp corners. This can be alleviated by designing the mesh to use smooth normals exclusively using [url=https://wiki.polycount.com/wiki/Face_weighted_normals]face weighted normals[/url] in the 3D authoring software. In this case, grow will be able to join every outline together, just like in the original mesh.
222+
[b]Note:[/b] Vertex growth cannot create new vertices, which means that visible gaps may occur in sharp corners. This can be alleviated by designing the mesh to use smooth normals exclusively using [url=http://wiki.polycount.com/wiki/Face_weighted_normals]face weighted normals[/url] in the 3D authoring software. In this case, grow will be able to join every outline together, just like in the original mesh.
223223
</member>
224224
<member name="grow_amount" type="float" setter="set_grow" getter="get_grow" default="0.0">
225225
Grows object vertices in the direction of their normals. Only effective if [member grow] is [code]true[/code].

doc/classes/Control.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,7 @@
13721372
Automatic layout direction, determined from the parent control layout direction.
13731373
</constant>
13741374
<constant name="LAYOUT_DIRECTION_APPLICATION_LOCALE" value="1" enum="LayoutDirection">
1375-
Automatic layout direction, determined from the current locale. Right-to-left layout direction is automatically used for languages that require it such as Arabic and Hebrew., but only if a valid translation file is loaded for the given language. For all other languages (or if no valid translation file is found by Godot), left-to-right layout direction is used. If using [TextServerFallback] ([member ProjectSettings.internationalization/rendering/text_driver]), left-to-right layout direction is always used regardless of the language.
1375+
Automatic layout direction, determined from the current locale. Right-to-left layout direction is automatically used for languages that require it such as Arabic and Hebrew, but only if a valid translation file is loaded for the given language (unless said language is configured as a fallback in [member ProjectSettings.internationalization/locale/fallback]). For all other languages (or if no valid translation file is found by Godot), left-to-right layout direction is used. If using [TextServerFallback] ([member ProjectSettings.internationalization/rendering/text_driver]), left-to-right layout direction is always used regardless of the language. Right-to-left layout direction can also be forced using [member ProjectSettings.internationalization/rendering/force_right_to_left_layout_direction].
13761376
</constant>
13771377
<constant name="LAYOUT_DIRECTION_LTR" value="2" enum="LayoutDirection">
13781378
Left-to-right layout direction.

doc/classes/HTTPClient.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
<param index="3" name="body" type="String" default="&quot;&quot;" />
144144
<description>
145145
Sends a request to the connected host.
146-
The URL parameter is usually just the part after the host, so for [code]https://somehost.com/index.php[/code], it is [code]/index.php[/code]. When sending requests to an HTTP proxy server, it should be an absolute URL. For [constant HTTPClient.METHOD_OPTIONS] requests, [code]*[/code] is also allowed. For [constant HTTPClient.METHOD_CONNECT] requests, it should be the authority component ([code]host:port[/code]).
146+
The URL parameter is usually just the part after the host, so for [code]https://example.com/index.php[/code], it is [code]/index.php[/code]. When sending requests to an HTTP proxy server, it should be an absolute URL. For [constant HTTPClient.METHOD_OPTIONS] requests, [code]*[/code] is also allowed. For [constant HTTPClient.METHOD_CONNECT] requests, it should be the authority component ([code]host:port[/code]).
147147
Headers are HTTP request headers. For available HTTP methods, see [enum Method].
148148
To create a POST request with query strings to push to the server, do:
149149
[codeblocks]
@@ -171,7 +171,7 @@
171171
<param index="3" name="body" type="PackedByteArray" />
172172
<description>
173173
Sends a raw request to the connected host.
174-
The URL parameter is usually just the part after the host, so for [code]https://somehost.com/index.php[/code], it is [code]/index.php[/code]. When sending requests to an HTTP proxy server, it should be an absolute URL. For [constant HTTPClient.METHOD_OPTIONS] requests, [code]*[/code] is also allowed. For [constant HTTPClient.METHOD_CONNECT] requests, it should be the authority component ([code]host:port[/code]).
174+
The URL parameter is usually just the part after the host, so for [code]https://example.com/index.php[/code], it is [code]/index.php[/code]. When sending requests to an HTTP proxy server, it should be an absolute URL. For [constant HTTPClient.METHOD_OPTIONS] requests, [code]*[/code] is also allowed. For [constant HTTPClient.METHOD_CONNECT] requests, it should be the authority component ([code]host:port[/code]).
175175
Headers are HTTP request headers. For available HTTP methods, see [enum Method].
176176
Sends the body data raw, as a byte array and does not encode it in any way.
177177
</description>

doc/classes/HTTPRequest.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
http_request.request_completed.connect(self._http_request_completed)
9191

9292
# Perform the HTTP request. The URL below returns a PNG image as of writing.
93-
var error = http_request.request("https://via.placeholder.com/512")
93+
var error = http_request.request("https://placehold.co/512")
9494
if error != OK:
9595
push_error("An error occurred in the HTTP request.")
9696

@@ -120,7 +120,7 @@
120120
httpRequest.RequestCompleted += HttpRequestCompleted;
121121

122122
// Perform the HTTP request. The URL below returns a PNG image as of writing.
123-
Error error = httpRequest.Request("https://via.placeholder.com/512");
123+
Error error = httpRequest.Request("https://placehold.co/512");
124124
if (error != Error.Ok)
125125
{
126126
GD.PushError("An error occurred in the HTTP request.");

doc/classes/ProjectSettings.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1480,7 +1480,7 @@
14801480
The expansion ratio to use during pseudolocalization. A value of [code]0.3[/code] is sufficient for most practical purposes, and will increase the length of each string by 30%.
14811481
</member>
14821482
<member name="internationalization/pseudolocalization/fake_bidi" type="bool" setter="" getter="" default="false">
1483-
If [code]true[/code], emulate bidirectional (right-to-left) text when pseudolocalization is enabled. This can be used to spot issues with RTL layout and UI mirroring that will crop up if the project is localized to RTL languages such as Arabic or Hebrew.
1483+
If [code]true[/code], emulate bidirectional (right-to-left) text when pseudolocalization is enabled. This can be used to spot issues with RTL layout and UI mirroring that will crop up if the project is localized to RTL languages such as Arabic or Hebrew. See also [member internationalization/rendering/force_right_to_left_layout_direction].
14841484
</member>
14851485
<member name="internationalization/pseudolocalization/override" type="bool" setter="" getter="" default="false">
14861486
Replace all characters in the string with [code]*[/code]. Useful for finding non-localizable strings.
@@ -1502,7 +1502,7 @@
15021502
[b]Note:[/b] This property is only read when the project starts. To toggle pseudolocalization at run-time, use [member TranslationServer.pseudolocalization_enabled] instead.
15031503
</member>
15041504
<member name="internationalization/rendering/force_right_to_left_layout_direction" type="bool" setter="" getter="" default="false">
1505-
Force layout direction and text writing direction to RTL for all controls.
1505+
Force layout direction and text writing direction to RTL for all controls, even if the current locale is intended to use a left-to-right layout and text writing direction. This should be enabled for testing purposes only. See also [member internationalization/pseudolocalization/fake_bidi].
15061506
</member>
15071507
<member name="internationalization/rendering/root_node_auto_translate" type="bool" setter="" getter="" default="true">
15081508
If [code]true[/code], root node will use [constant Node.AUTO_TRANSLATE_MODE_ALWAYS], otherwise [constant Node.AUTO_TRANSLATE_MODE_DISABLED] will be used.

doc/classes/RenderingDevice.xml

+18-9
Original file line numberDiff line numberDiff line change
@@ -703,11 +703,10 @@
703703
<param index="1" name="format" type="int" enum="RenderingDevice.IndexBufferFormat" />
704704
<param index="2" name="data" type="PackedByteArray" default="PackedByteArray()" />
705705
<param index="3" name="use_restart_indices" type="bool" default="false" />
706-
<param index="4" name="enable_device_address" type="bool" default="false" />
706+
<param index="4" name="creation_bits" type="int" enum="RenderingDevice.BufferCreationBits" is_bitfield="true" default="0" />
707707
<description>
708708
Creates a new index buffer. It can be accessed with the RID that is returned.
709709
Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method.
710-
Optionally, set [param enable_device_address] if you wish to use [method buffer_get_device_address] functionality and the GPU supports it.
711710
</description>
712711
</method>
713712
<method name="limit_get" qualifiers="const">
@@ -847,6 +846,7 @@
847846
<param index="0" name="size_bytes" type="int" />
848847
<param index="1" name="data" type="PackedByteArray" default="PackedByteArray()" />
849848
<param index="2" name="usage" type="int" enum="RenderingDevice.StorageBufferUsage" is_bitfield="true" default="0" />
849+
<param index="3" name="creation_bits" type="int" enum="RenderingDevice.BufferCreationBits" is_bitfield="true" default="0" />
850850
<description>
851851
Creates a [url=https://vkguide.dev/docs/chapter-4/storage_buffers/]storage buffer[/url] with the specified [param data] and [param usage]. It can be accessed with the RID that is returned.
852852
Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method.
@@ -1073,11 +1073,10 @@
10731073
<return type="RID" />
10741074
<param index="0" name="size_bytes" type="int" />
10751075
<param index="1" name="data" type="PackedByteArray" default="PackedByteArray()" />
1076-
<param index="2" name="enable_device_address" type="bool" default="false" />
1076+
<param index="2" name="creation_bits" type="int" enum="RenderingDevice.BufferCreationBits" is_bitfield="true" default="0" />
10771077
<description>
10781078
Creates a new uniform buffer. It can be accessed with the RID that is returned.
10791079
Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method.
1080-
Optionally, set [param enable_device_address] if you wish to use [method buffer_get_device_address] functionality and the GPU supports it.
10811080
</description>
10821081
</method>
10831082
<method name="uniform_set_create">
@@ -1111,12 +1110,10 @@
11111110
<return type="RID" />
11121111
<param index="0" name="size_bytes" type="int" />
11131112
<param index="1" name="data" type="PackedByteArray" default="PackedByteArray()" />
1114-
<param index="2" name="use_as_storage" type="bool" default="false" />
1115-
<param index="3" name="enable_device_address" type="bool" default="false" />
1113+
<param index="2" name="creation_bits" type="int" enum="RenderingDevice.BufferCreationBits" is_bitfield="true" default="0" />
11161114
<description>
11171115
It can be accessed with the RID that is returned.
11181116
Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method.
1119-
Optionally, set [param enable_device_address] if you wish to use [method buffer_get_device_address] functionality and the GPU supports it.
11201117
</description>
11211118
</method>
11221119
<method name="vertex_format_create">
@@ -2068,8 +2065,20 @@
20682065
</constant>
20692066
<constant name="STORAGE_BUFFER_USAGE_DISPATCH_INDIRECT" value="1" enum="StorageBufferUsage" is_bitfield="true">
20702067
</constant>
2071-
<constant name="STORAGE_BUFFER_USAGE_DEVICE_ADDRESS" value="2" enum="StorageBufferUsage" is_bitfield="true">
2072-
Allows usage of [method buffer_get_device_address] on supported GPUs.
2068+
<constant name="BUFFER_CREATION_DEVICE_ADDRESS_BIT" value="1" enum="BufferCreationBits" is_bitfield="true">
2069+
Optionally, set this flag if you wish to use [method buffer_get_device_address] functionality. You must first check the GPU supports it:
2070+
[codeblocks]
2071+
[gdscript]
2072+
rd = RenderingServer.get_rendering_device()
2073+
2074+
if rd.has_feature(RenderingDevice.SUPPORTS_BUFFER_DEVICE_ADDRESS):
2075+
storage_buffer = rd.storage_buffer_create(bytes.size(), bytes, RenderingDevice.STORAGE_BUFFER_USAGE_SHADER_DEVICE_ADDRESS):
2076+
storage_buffer_address = rd.buffer_get_device_address(storage_buffer)
2077+
[/gdscript]
2078+
[/codeblocks]
2079+
</constant>
2080+
<constant name="BUFFER_CREATION_AS_STORAGE_BIT" value="2" enum="BufferCreationBits" is_bitfield="true">
2081+
Set this flag so that it is created as storage. This is useful if Compute Shaders need access (for reading or writing) to the buffer, e.g. skeletal animations are processed in Compute Shaders which need access to vertex buffers, to be later consumed by vertex shaders as part of the regular rasterization pipeline.
20732082
</constant>
20742083
<constant name="UNIFORM_TYPE_SAMPLER" value="0" enum="UniformType">
20752084
Sampler uniform.

doc/classes/TileMap.xml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
Node for 2D tile-based maps. Tilemaps use a [TileSet] which contain a list of tiles which are used to create grid-based maps. A TileMap may have several layers, layouting tiles on top of each other.
88
For performance reasons, all TileMap updates are batched at the end of a frame. Notably, this means that scene tiles from a [TileSetScenesCollectionSource] may be initialized after their parent. This is only queued when inside the scene tree.
99
To force an update earlier on, call [method update_internals].
10+
[b]Note:[/b] For performance and compatibility reasons, the coordinates serialized by [TileMap] are limited to 16-bit signed integers, i.e. the range for X and Y coordinates is from [code]-32768[/code] to [code]32767[/code]. When saving tile data, tiles outside this range are wrapped.
1011
</description>
1112
<tutorials>
1213
<link title="Using Tilemaps">$DOCS_URL/tutorials/2d/using_tilemaps.html</link>

doc/classes/TileMapLayer.xml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
Node for 2D tile-based maps. A [TileMapLayer] uses a [TileSet] which contain a list of tiles which are used to create grid-based maps. Unlike the [TileMap] node, which is deprecated, [TileMapLayer] has only one layer of tiles. You can use several [TileMapLayer] to achieve the same result as a [TileMap] node.
88
For performance reasons, all TileMap updates are batched at the end of a frame. Notably, this means that scene tiles from a [TileSetScenesCollectionSource] may be initialized after their parent. This is only queued when inside the scene tree.
99
To force an update earlier on, call [method update_internals].
10+
[b]Note:[/b] For performance and compatibility reasons, the coordinates serialized by [TileMapLayer] are limited to 16-bit signed integers, i.e. the range for X and Y coordinates is from [code]-32768[/code] to [code]32767[/code]. When saving tile data, tiles outside this range are wrapped.
1011
</description>
1112
<tutorials>
1213
<link title="Using Tilemaps">$DOCS_URL/tutorials/2d/using_tilemaps.html</link>

editor/export/editor_export_platform.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1525,7 +1525,7 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> &
15251525
custom_list.append_array(export_plugins[i]->_get_export_features(Ref<EditorExportPlatform>(this), p_debug));
15261526
}
15271527

1528-
ProjectSettings::CustomMap custom_map;
1528+
ProjectSettings::CustomMap custom_map = get_custom_project_settings(p_preset);
15291529
if (path_remaps.size()) {
15301530
if (true) { //new remap mode, use always as it's friendlier with multiple .pck exports
15311531
for (int i = 0; i < path_remaps.size(); i += 2) {

editor/export/editor_export_platform.h

+1
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ class EditorExportPlatform : public RefCounted {
336336
virtual void get_platform_features(List<String> *r_features) const = 0;
337337
virtual void resolve_platform_feature_priorities(const Ref<EditorExportPreset> &p_preset, HashSet<String> &p_features) {}
338338
virtual String get_debug_protocol() const { return "tcp://"; }
339+
virtual HashMap<String, Variant> get_custom_project_settings(const Ref<EditorExportPreset> &p_preset) const { return HashMap<String, Variant>(); }
339340

340341
EditorExportPlatform();
341342
};

editor/plugins/polygon_3d_editor_plugin.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -535,12 +535,14 @@ Polygon3DEditor::Polygon3DEditor() {
535535

536536
button_create = memnew(Button);
537537
button_create->set_theme_type_variation(SceneStringName(FlatButton));
538+
button_create->set_tooltip_text(TTRC("Create Polygon"));
538539
add_child(button_create);
539540
button_create->connect(SceneStringName(pressed), callable_mp(this, &Polygon3DEditor::_menu_option).bind(MODE_CREATE));
540541
button_create->set_toggle_mode(true);
541542

542543
button_edit = memnew(Button);
543544
button_edit->set_theme_type_variation(SceneStringName(FlatButton));
545+
button_edit->set_tooltip_text(TTRC("Edit Polygon"));
544546
add_child(button_edit);
545547
button_edit->connect(SceneStringName(pressed), callable_mp(this, &Polygon3DEditor::_menu_option).bind(MODE_EDIT));
546548
button_edit->set_toggle_mode(true);

main/main.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,11 @@ void Main::test_cleanup() {
864864

865865
int Main::test_entrypoint(int argc, char *argv[], bool &tests_need_run) {
866866
for (int x = 0; x < argc; x++) {
867+
// Early return to ignore a possible user-provided "--test" argument.
868+
if ((strlen(argv[x]) == 2) && ((strncmp(argv[x], "--", 2) == 0) || (strncmp(argv[x], "++", 2) == 0))) {
869+
tests_need_run = false;
870+
return EXIT_SUCCESS;
871+
}
867872
if ((strncmp(argv[x], "--test", 6) == 0) && (strlen(argv[x]) == 6)) {
868873
tests_need_run = true;
869874
#ifdef TESTS_ENABLED

misc/extension_api_validation/4.3-stable.expected

+5-2
Original file line numberDiff line numberDiff line change
@@ -294,13 +294,16 @@ Validate extension JSON: Error: Field 'classes/RichTextLabel/methods/set_table_c
294294
Added optional "shrink" argument. Compatibility method registered.
295295

296296

297-
GH-100062
297+
GH-101561
298298
--------
299299
Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/index_buffer_create/arguments': size changed value in new API, from 4 to 5.
300300
Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/uniform_buffer_create/arguments': size changed value in new API, from 2 to 3.
301+
Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/storage_buffer_create/arguments': size changed value in new API, from 3 to 4.
301302
Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/vertex_buffer_create/arguments': size changed value in new API, from 3 to 4.
303+
Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/vertex_buffer_create/arguments/2': default_value changed value in new API, from "false" to "0".
304+
Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/vertex_buffer_create/arguments/2': type changed value in new API, from "bool" to "bitfield::RenderingDevice.BufferCreationBits".
302305

303-
Optional argument added. Compatibility methods registered.
306+
Optional argument (creation flags) added. Compatibility methods registered.
304307

305308

306309
GH-101531

0 commit comments

Comments
 (0)