diff options
-rw-r--r-- | core/image.cpp | 6 | ||||
-rw-r--r-- | doc/classes/@GlobalScope.xml | 4 | ||||
-rw-r--r-- | doc/classes/Camera3D.xml | 1 | ||||
-rw-r--r-- | doc/classes/CanvasItem.xml | 8 | ||||
-rw-r--r-- | doc/classes/ImageTextureLayered.xml | 31 | ||||
-rw-r--r-- | doc/classes/Lightmapper.xml | 13 | ||||
-rw-r--r-- | doc/classes/ProjectSettings.xml | 24 | ||||
-rw-r--r-- | drivers/vulkan/rendering_device_vulkan.cpp | 6 | ||||
-rw-r--r-- | editor/editor_spin_slider.cpp | 1 | ||||
-rw-r--r-- | editor/icons/CameraEffects.svg | 1 | ||||
-rw-r--r-- | editor/icons/Cubemap.svg (renamed from editor/icons/CubeMap.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CubemapArray.svg | 1 | ||||
-rw-r--r-- | editor/icons/LightmapProbe.svg | 1 | ||||
-rw-r--r-- | editor/icons/PanoramaSky.svg | 1 | ||||
-rw-r--r-- | editor/icons/PanoramaSkyMaterial.svg | 1 | ||||
-rw-r--r-- | editor/icons/PhysicalSkyMaterial.svg | 1 | ||||
-rw-r--r-- | editor/icons/ProceduralSky.svg | 1 | ||||
-rw-r--r-- | editor/icons/ProceduralSkyMaterial.svg | 1 | ||||
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 35 | ||||
-rw-r--r-- | modules/gdscript/gdscript_parser.h | 2 | ||||
-rw-r--r-- | thirdparty/oidn/0001-window.h-case-sensitive.patch | 13 | ||||
-rw-r--r-- | thirdparty/oidn/common/platform.h | 2 |
22 files changed, 122 insertions, 32 deletions
diff --git a/core/image.cpp b/core/image.cpp index 29be2ff5eb..f99e8a636f 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -1993,7 +1993,7 @@ void Image::create(const char **p_xpm) { HashMap<String, Color> colormap; int colormap_size = 0; uint32_t pixel_size = 0; - uint8_t *w; + uint8_t *data_write = nullptr; while (status != DONE) { const char *line_ptr = p_xpm[line]; @@ -2089,7 +2089,7 @@ void Image::create(const char **p_xpm) { if (line == colormap_size) { status = READING_PIXELS; create(size_width, size_height, false, has_alpha ? FORMAT_RGBA8 : FORMAT_RGB8); - w = data.ptrw(); + data_write = data.ptrw(); pixel_size = has_alpha ? 4 : 3; } } break; @@ -2107,7 +2107,7 @@ void Image::create(const char **p_xpm) { for (uint32_t i = 0; i < pixel_size; i++) { pixel[i] = CLAMP((*colorptr)[i] * 255, 0, 255); } - _put_pixelb(x, y, pixel_size, w, pixel); + _put_pixelb(x, y, pixel_size, data_write, pixel); } if (y == (size_height - 1)) { diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index bf2ce321ac..03eb733e54 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -1063,10 +1063,10 @@ <constant name="JOY_XBOX_RB" value="10" enum="JoyButtonList"> Xbox game controller right bumper button maps to SDL right shoulder button. </constant> - <constant name="JOY_BUTTON_MAX" value="36" enum="JoyAxisList"> + <constant name="JOY_BUTTON_MAX" value="36" enum="JoyButtonList"> The maximum number of game controller buttons. </constant> - <constant name="JOY_INVALID_BUTTON" value="-1" enum="JoyButtonList"> + <constant name="JOY_INVALID_AXIS" value="-1" enum="JoyAxisList"> An invalid game controller axis. </constant> <constant name="JOY_AXIS_LEFT_X" value="0" enum="JoyAxisList"> diff --git a/doc/classes/Camera3D.xml b/doc/classes/Camera3D.xml index 6ff4875364..598b4bd685 100644 --- a/doc/classes/Camera3D.xml +++ b/doc/classes/Camera3D.xml @@ -176,6 +176,7 @@ If not [constant DOPPLER_TRACKING_DISABLED], this camera will simulate the [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] for objects changed in particular [code]_process[/code] methods. See [enum DopplerTracking] for possible values. </member> <member name="effects" type="CameraEffects" setter="set_effects" getter="get_effects"> + The [CameraEffects] to use for this camera. </member> <member name="environment" type="Environment" setter="set_environment" getter="get_environment"> The [Environment] to use for this camera. diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index 38e4453cf2..b3a3722836 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -608,8 +608,10 @@ If [code]true[/code], the object draws on top of its parent. </member> <member name="texture_filter" type="int" setter="set_texture_filter" getter="get_texture_filter" enum="CanvasItem.TextureFilter" default="0"> + The texture filtering mode to use on this [CanvasItem]. </member> <member name="texture_repeat" type="int" setter="set_texture_repeat" getter="get_texture_repeat" enum="CanvasItem.TextureRepeat" default="0"> + The texture repeating mode to use on this [CanvasItem]. </member> <member name="use_parent_material" type="bool" setter="set_use_parent_material" getter="get_use_parent_material" default="false"> If [code]true[/code], the parent [CanvasItem]'s [member material] property is used as this one's material. @@ -666,12 +668,18 @@ The texture filter blends between the nearest four pixels. Use this for most cases where you want to avoid a pixelated style. </constant> <constant name="TEXTURE_FILTER_NEAREST_WITH_MIPMAPS" value="3" enum="TextureFilter"> + The texture filter reads from the nearest pixel in the nearest mipmap. This is the fastest way to read from textures with mipmaps. </constant> <constant name="TEXTURE_FILTER_LINEAR_WITH_MIPMAPS" value="4" enum="TextureFilter"> + The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps. Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to [Camera2D] zoom), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels. </constant> <constant name="TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC" value="5" enum="TextureFilter"> + The texture filter reads from the nearest pixel, but selects a mipmap based on the angle between the surface and the camera view. This reduces artifacts on surfaces that are almost in line with the camera. + [b]Note:[/b] This texture filter is rarely useful in 2D projects. [constant TEXTURE_FILTER_NEAREST_WITH_MIPMAPS] is usually more appropriate. </constant> <constant name="TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC" value="6" enum="TextureFilter"> + The texture filter blends between the nearest 4 pixels and selects a mipmap based on the angle between the surface and the camera view. This reduces artifacts on surfaces that are almost in line with the camera. This is the slowest of the filtering options, but results in the highest quality texturing. + [b]Note:[/b] This texture filter is rarely useful in 2D projects. [constant TEXTURE_FILTER_LINEAR_WITH_MIPMAPS] is usually more appropriate. </constant> <constant name="TEXTURE_FILTER_MAX" value="7" enum="TextureFilter"> Represents the size of the [enum TextureFilter] enum. diff --git a/doc/classes/ImageTextureLayered.xml b/doc/classes/ImageTextureLayered.xml new file mode 100644 index 0000000000..d06b44afa9 --- /dev/null +++ b/doc/classes/ImageTextureLayered.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="ImageTextureLayered" inherits="TextureLayered" version="4.0"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + <method name="create_from_images"> + <return type="int" enum="Error"> + </return> + <argument index="0" name="images" type="Array"> + </argument> + <description> + </description> + </method> + <method name="update_layer"> + <return type="void"> + </return> + <argument index="0" name="image" type="Image"> + </argument> + <argument index="1" name="layer" type="int"> + </argument> + <description> + </description> + </method> + </methods> + <constants> + </constants> +</class> diff --git a/doc/classes/Lightmapper.xml b/doc/classes/Lightmapper.xml new file mode 100644 index 0000000000..e80194858a --- /dev/null +++ b/doc/classes/Lightmapper.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="Lightmapper" inherits="Reference" version="4.0"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <constants> + </constants> +</class> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 92f116c7ec..055af18e25 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -844,30 +844,6 @@ <member name="network/limits/webrtc/max_channel_in_buffer_kb" type="int" setter="" getter="" default="64"> Maximum size (in kiB) for the [WebRTCDataChannel] input buffer. </member> - <member name="network/limits/websocket_client/max_in_buffer_kb" type="int" setter="" getter="" default="64"> - Maximum size (in kiB) for the [WebSocketClient] input buffer. - </member> - <member name="network/limits/websocket_client/max_in_packets" type="int" setter="" getter="" default="1024"> - Maximum number of concurrent input packets for [WebSocketClient]. - </member> - <member name="network/limits/websocket_client/max_out_buffer_kb" type="int" setter="" getter="" default="64"> - Maximum size (in kiB) for the [WebSocketClient] output buffer. - </member> - <member name="network/limits/websocket_client/max_out_packets" type="int" setter="" getter="" default="1024"> - Maximum number of concurrent output packets for [WebSocketClient]. - </member> - <member name="network/limits/websocket_server/max_in_buffer_kb" type="int" setter="" getter="" default="64"> - Maximum size (in kiB) for the [WebSocketServer] input buffer. - </member> - <member name="network/limits/websocket_server/max_in_packets" type="int" setter="" getter="" default="1024"> - Maximum number of concurrent input packets for [WebSocketServer]. - </member> - <member name="network/limits/websocket_server/max_out_buffer_kb" type="int" setter="" getter="" default="64"> - Maximum size (in kiB) for the [WebSocketServer] output buffer. - </member> - <member name="network/limits/websocket_server/max_out_packets" type="int" setter="" getter="" default="1024"> - Maximum number of concurrent output packets for [WebSocketServer]. - </member> <member name="network/remote_fs/page_read_ahead" type="int" setter="" getter="" default="4"> Amount of read ahead used by remote filesystem. Higher values decrease the effects of latency at the cost of higher bandwidth usage. </member> diff --git a/drivers/vulkan/rendering_device_vulkan.cpp b/drivers/vulkan/rendering_device_vulkan.cpp index ea99594810..efd4f057fd 100644 --- a/drivers/vulkan/rendering_device_vulkan.cpp +++ b/drivers/vulkan/rendering_device_vulkan.cpp @@ -4431,6 +4431,12 @@ RID RenderingDeviceVulkan::uniform_set_create(const Vector<Uniform> &p_uniforms, write.pNext = nullptr; write.dstSet = VK_NULL_HANDLE; //will assign afterwards when everything is valid write.dstBinding = set_uniform.binding; + write.dstArrayElement = 0; + write.descriptorCount = 0; + write.descriptorType = VK_DESCRIPTOR_TYPE_MAX_ENUM; //Invalid value. + write.pImageInfo = nullptr; + write.pBufferInfo = nullptr; + write.pTexelBufferView = nullptr; uint32_t type_size = 1; switch (uniform.type) { diff --git a/editor/editor_spin_slider.cpp b/editor/editor_spin_slider.cpp index 39e6746797..67d92c4839 100644 --- a/editor/editor_spin_slider.cpp +++ b/editor/editor_spin_slider.cpp @@ -186,6 +186,7 @@ void EditorSpinSlider::_notification(int p_what) { p_what == NOTIFICATION_WM_FOCUS_IN || p_what == NOTIFICATION_EXIT_TREE) { if (grabbing_spinner) { + grabber->hide(); Input::get_singleton()->set_mouse_mode(Input::MOUSE_MODE_VISIBLE); grabbing_spinner = false; grabbing_spinner_attempt = false; diff --git a/editor/icons/CameraEffects.svg b/editor/icons/CameraEffects.svg new file mode 100644 index 0000000000..2f6dad5fd8 --- /dev/null +++ b/editor/icons/CameraEffects.svg @@ -0,0 +1 @@ +<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m5.9492188 2a3 3 0 0 0 -2.9492188 3 3 3 0 0 0 1 2.2304688v1.7695312l-3-2v6l3-2v1c0 .554.44599 1 1 1h3c.0076117-.045309.0115938-.096059.0214844-.134766.0773621-.302758.1860981-.478282.2832031-.625.1397097-.211089.2814954-.338835.4257813-.480468-.1445165-.141692-.2879205-.269839-.4277344-.480469-.0971224-.146315-.2052562-.321748-.2832032-.623047-.0777157-.300405-.1044198-.8152648.1640626-1.2910156.2700589-.4775976.7340166-.7239536 1.0371093-.8105469.3037241-.0867737.5108695-.0808838.6875-.0703125.2608449.0156115.4500479.0763383.6503909.1328125.049596-.1859081.086921-.3641449.195312-.5800781.078477-.1563394.174637-.3364783.396485-.5527344.221847-.2162561.652628-.4930277 1.195312-.4980469a1.6124973 1.6124973 0 0 1 .033203 0c.542861.0056205.97185.2837448 1.19336.5.146452.1429781.230167.265896.298828.3808594a3 3 0 0 0 .128906-.8671875 3 3 0 0 0 -3-3 3 3 0 0 0 -2.0117188.7773438 3 3 0 0 0 -2.9882812-2.7773438 3 3 0 0 0 -.0507812 0z" fill="#e0e0e0"/><path d="m12.36062 8.59795a.53334 3.2001 0 0 0 -.50976 2.2754 3.2001.53334 30 0 0 -2.2656-.71484 3.2001.53334 30 0 0 1.75 1.6016.53334 3.2001 60 0 0 -1.7461 1.5996.53334 3.2001 60 0 0 2.2578-.71094.53334 3.2001 0 0 0 .51367 2.3496.53334 3.2001 0 0 0 .51367-2.3516 3.2001.53334 30 0 0 2.2539.71094 3.2001.53334 30 0 0 -1.7441-1.5977.53334 3.2001 60 0 0 1.748-1.5996.53334 3.2001 60 0 0 -2.2617.71484.53334 3.2001 0 0 0 -.50977-2.2773z" fill="#cea4f1" stroke-width="1.0667"/></svg>
\ No newline at end of file diff --git a/editor/icons/CubeMap.svg b/editor/icons/Cubemap.svg index c9e6f1fa7d..c9e6f1fa7d 100644 --- a/editor/icons/CubeMap.svg +++ b/editor/icons/Cubemap.svg diff --git a/editor/icons/CubemapArray.svg b/editor/icons/CubemapArray.svg new file mode 100644 index 0000000000..350a64f9c2 --- /dev/null +++ b/editor/icons/CubemapArray.svg @@ -0,0 +1 @@ +<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m2 6v4h2v-4zm6 0v4h4v-4z" fill="#84ffb1"/><path d="m4 6v4h4v-4zm8 0v4h2v-4z" fill="#ff8484"/><path d="m4 2v4h4v-4zm0 8v4h4v-4z" fill="#84c2ff"/><path d="m-.00000002 2v12h4.00000002v-2h-2v-8h2v-2h-2zm12.00000002 0v2h2.000001v8h-2.000001v2h4.000001v-12h-2z" fill="#e0e0e0"/></svg>
\ No newline at end of file diff --git a/editor/icons/LightmapProbe.svg b/editor/icons/LightmapProbe.svg new file mode 100644 index 0000000000..0972220fda --- /dev/null +++ b/editor/icons/LightmapProbe.svg @@ -0,0 +1 @@ +<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m1 9h3v-2h-3zm2.050781 2.535156 1.414063 1.414063 1.414062-1.414063-1.414062-1.414062zm0-7.070312 1.414063 1.414062 1.414062-1.414062-1.414062-1.414063zm1.949219 3.535156c0 1.6569 1.3432 3 3 3s3-1.3431 3-3-1.3432-3-3-3-3 1.3431-3 3zm3 7c3.865993 0 7-3.134007 7-7s-3.134007-7-7-7v2.333984c2.577329 0 4.666016 2.088687 4.666016 4.666016s-2.088687 4.666016-4.666016 4.666016z" fill="#fc9c9c" fill-opacity=".996078" stroke-width="1.16667"/></svg>
\ No newline at end of file diff --git a/editor/icons/PanoramaSky.svg b/editor/icons/PanoramaSky.svg deleted file mode 100644 index bfff6840bd..0000000000 --- a/editor/icons/PanoramaSky.svg +++ /dev/null @@ -1 +0,0 @@ -<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><linearGradient id="a" gradientTransform="matrix(1.0096 0 0 1.0227 -.009615 -22.593)" gradientUnits="userSpaceOnUse" x1="8" x2="8" y1="1038.4" y2="1050.4"><stop offset="0" stop-color="#1ec3ff"/><stop offset="1" stop-color="#b2e1ff"/></linearGradient><g transform="translate(0 -1037.4)"><path d="m1 1039.4c4.2749 2.6091 10.765 2.7449 14 0v12c-3.5849-2.6849-9.7929-2.6544-14 0z" fill="url(#a)" stroke-width="15.242"/><path d="m11 6c-.554 0-1 .446-1 1h-1c-.554 0-1 .446-1 1s.446 1 1 1h2c.554 0 1-.446 1-1h1c.554 0 1-.446 1-1s-.446-1-1-1zm-8 3c-.554 0-1 .446-1 1s.446 1 1 1h1c.554 0 1-.446 1-1s-.446-1-1-1z" fill="#fff" transform="translate(0 1037.4)"/></g></svg>
\ No newline at end of file diff --git a/editor/icons/PanoramaSkyMaterial.svg b/editor/icons/PanoramaSkyMaterial.svg new file mode 100644 index 0000000000..9f40ffb63c --- /dev/null +++ b/editor/icons/PanoramaSkyMaterial.svg @@ -0,0 +1 @@ +<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m1 5v2h8 1c0-.554.446-1 1-1h2c.554 0 1 .446 1 1h1v-2z" fill="#9dff70"/><path d="m1 3v2h14v-2h-1.589844c-2.86436 1.357608-6.9481434 1.30996-10.347656 0z" fill="#ffeb70"/><path d="m1 2v1h2.0625c-.7241713-.2790504-1.419865-.6077805-2.0625-1zm14 0c-.465784.3952185-1.005424.7230054-1.589844 1h1.589844z" fill="#ff7070"/><path d="m1 7v2h2 1 5c-.554 0-1-.446-1-1s.446-1 1-1zm13 0c0 .554-.446 1-1 1h-1c0 .554-.446 1-1 1h4v-2z" fill="#70ffb9"/><path d="m1 9v2h2c-.554 0-1-.446-1-1s.446-1 1-1zm3 0c.554 0 1 .446 1 1s-.446 1-1 1h11v-2h-4-2z" fill="#70deff"/><path d="m1 13v-2h14v2h-1.589844c-2.86436-1.357608-6.9481434-1.30996-10.347656 0z" fill="#9f70ff"/><path d="m1 14v-1h2.0625c-.7241713.27905-1.419865.60778-2.0625 1zm14 0c-.465784-.395219-1.005424-.723005-1.589844-1h1.589844z" fill="#ff70ac"/></svg>
\ No newline at end of file diff --git a/editor/icons/PhysicalSkyMaterial.svg b/editor/icons/PhysicalSkyMaterial.svg new file mode 100644 index 0000000000..5831cb2c63 --- /dev/null +++ b/editor/icons/PhysicalSkyMaterial.svg @@ -0,0 +1 @@ +<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m1 5v2h8 1c0-.554.446-1 1-1h2c.554 0 1 .446 1 1h1v-2z" fill="#9dff70"/><path d="m1 7v2h2 1 5c-.554 0-1-.446-1-1s.446-1 1-1zm13 0c0 .554-.446 1-1 1h-1c0 .554-.446 1-1 1h4v-2z" fill="#70ffb9"/><path d="m1 9v2h2c-.554 0-1-.446-1-1s.446-1 1-1zm3 0c.554 0 1 .446 1 1s-.446 1-1 1h11v-2h-4-2z" fill="#70deff"/><path d="m1 3v2h14v-2z" fill="#ffeb70"/><path d="m1 11v2h14v-2z" fill="#9f70ff"/></svg>
\ No newline at end of file diff --git a/editor/icons/ProceduralSky.svg b/editor/icons/ProceduralSky.svg deleted file mode 100644 index 356a966fe9..0000000000 --- a/editor/icons/ProceduralSky.svg +++ /dev/null @@ -1 +0,0 @@ -<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><linearGradient id="a" gradientUnits="userSpaceOnUse" x1="8" x2="8" y1="1040.4" y2="1050.4"><stop offset="0" stop-color="#1ec3ff"/><stop offset="1" stop-color="#b2e1ff"/></linearGradient><g transform="translate(0 -1037.4)"><path d="m8 1040.4a7 7 0 0 0 -7 7 7 7 0 0 0 .68555 3h12.631a7 7 0 0 0 .68359-3 7 7 0 0 0 -7-7z" fill="url(#a)"/><path d="m10 7c-.554 0-1 .446-1 1h-1c-.554 0-1 .446-1 1s.446 1 1 1h2c.554 0 1-.446 1-1h1c.554 0 1-.446 1-1s-.446-1-1-1zm-7 3c-.554 0-1 .446-1 1s.446 1 1 1h1c.554 0 1-.446 1-1s-.446-1-1-1z" fill="#fff" transform="translate(0 1037.4)"/></g></svg>
\ No newline at end of file diff --git a/editor/icons/ProceduralSkyMaterial.svg b/editor/icons/ProceduralSkyMaterial.svg new file mode 100644 index 0000000000..f7a3944671 --- /dev/null +++ b/editor/icons/ProceduralSkyMaterial.svg @@ -0,0 +1 @@ +<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m1.0761719 11a7 7 0 0 0 .609375 2h12.6308591a7 7 0 0 0 .609375-2h-9.925781c0 .554-.446 1-1 1h-1c-.554 0-1-.446-1-1z" fill="#9f70ff"/><path d="m1.0722656 9a7 7 0 0 0 -.0722656 1 7 7 0 0 0 .0761719 1h.9238281c0-.554.446-1 1-1h1c.554 0 1 .446 1 1h9.925781a7 7 0 0 0 .074219-1 7 7 0 0 0 -.072266-1h-2.927734-1c0 .554-.446 1-1 1h-2c-.554 0-1-.446-1-1z" fill="#70deff"/><path d="m1.6757812 7a7 7 0 0 0 -.6035156 2h5.9277344c0-.554.446-1 1-1h1c0-.554.446-1 1-1zm10.3242188 0c.554 0 1 .446 1 1s-.446 1-1 1h2.927734a7 7 0 0 0 -.603515-2z" fill="#70ffb9"/><path d="m3.1035156 5a7 7 0 0 0 -1.4277344 2h12.6484378a7 7 0 0 0 -1.425781-2z" fill="#9dff70"/><path d="m8 3a7 7 0 0 0 -4.8964844 2h9.7949224a7 7 0 0 0 -4.898438-2z" fill="#ffeb70"/></svg>
\ No newline at end of file diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 57531ed13b..fbb5f91139 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -3151,6 +3151,8 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) { cf_while->body = alloc_node<BlockNode>(); cf_while->body->parent_block = p_block; + cf_while->body->can_break = true; + cf_while->body->can_continue = true; p_block->sub_blocks.push_back(cf_while->body); if (!_enter_indent_block(cf_while->body)) { @@ -3278,6 +3280,8 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) { cf_for->body = alloc_node<BlockNode>(); cf_for->body->parent_block = p_block; + cf_for->body->can_break = true; + cf_for->body->can_continue = true; p_block->sub_blocks.push_back(cf_for->body); if (!_enter_indent_block(cf_for->body)) { @@ -3308,6 +3312,21 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) { p_block->statements.push_back(cf_for); } break; case GDScriptTokenizer::TK_CF_CONTINUE: { + BlockNode *upper_block = p_block; + bool is_continue_valid = false; + while (upper_block) { + if (upper_block->can_continue) { + is_continue_valid = true; + break; + } + upper_block = upper_block->parent_block; + } + + if (!is_continue_valid) { + _set_error("Unexpected keyword \"continue\" outside a loop."); + return; + } + _mark_line_as_safe(tokenizer->get_token_line()); tokenizer->advance(); ControlFlowNode *cf_continue = alloc_node<ControlFlowNode>(); @@ -3319,6 +3338,21 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) { } } break; case GDScriptTokenizer::TK_CF_BREAK: { + BlockNode *upper_block = p_block; + bool is_break_valid = false; + while (upper_block) { + if (upper_block->can_break) { + is_break_valid = true; + break; + } + upper_block = upper_block->parent_block; + } + + if (!is_break_valid) { + _set_error("Unexpected keyword \"break\" outside a loop."); + return; + } + _mark_line_as_safe(tokenizer->get_token_line()); tokenizer->advance(); ControlFlowNode *cf_break = alloc_node<ControlFlowNode>(); @@ -3384,6 +3418,7 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) { BlockNode *compiled_branches = alloc_node<BlockNode>(); compiled_branches->parent_block = p_block; compiled_branches->parent_class = p_block->parent_class; + compiled_branches->can_continue = true; p_block->sub_blocks.push_back(compiled_branches); diff --git a/modules/gdscript/gdscript_parser.h b/modules/gdscript/gdscript_parser.h index cfcca9584e..7dedb6d6f9 100644 --- a/modules/gdscript/gdscript_parser.h +++ b/modules/gdscript/gdscript_parser.h @@ -231,6 +231,8 @@ public: List<Node *> statements; Map<StringName, LocalVarNode *> variables; bool has_return = false; + bool can_break = false; + bool can_continue = false; Node *if_condition = nullptr; //tiny hack to improve code completion on if () blocks diff --git a/thirdparty/oidn/0001-window.h-case-sensitive.patch b/thirdparty/oidn/0001-window.h-case-sensitive.patch new file mode 100644 index 0000000000..7b9c8e96c1 --- /dev/null +++ b/thirdparty/oidn/0001-window.h-case-sensitive.patch @@ -0,0 +1,13 @@ +diff --git a/thirdparty/oidn/common/platform.h b/thirdparty/oidn/common/platform.h +index 205ac8981d..9373b617b5 100644 +--- a/thirdparty/oidn/common/platform.h ++++ b/thirdparty/oidn/common/platform.h +@@ -19,7 +19,7 @@ + #if defined(_WIN32) + #define WIN32_LEAN_AND_MEAN + #define NOMINMAX +- #include <Windows.h> ++ #include <windows.h> + #elif defined(__APPLE__) + #include <sys/sysctl.h> + #endif diff --git a/thirdparty/oidn/common/platform.h b/thirdparty/oidn/common/platform.h index 205ac8981d..9373b617b5 100644 --- a/thirdparty/oidn/common/platform.h +++ b/thirdparty/oidn/common/platform.h @@ -19,7 +19,7 @@ #if defined(_WIN32) #define WIN32_LEAN_AND_MEAN #define NOMINMAX - #include <Windows.h> + #include <windows.h> #elif defined(__APPLE__) #include <sys/sysctl.h> #endif |