From 8d1f2dce08978a7fbb371aa8c2cf4e4c426d3cfa Mon Sep 17 00:00:00 2001 From: Naoki Date: Tue, 10 Dec 2024 16:05:03 +0100 Subject: [PATCH] Squashed commit of the following: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit a372214a4a047ccf63d23c4406337b30e55ff60b Merge: b4bd38444b 7d65d0a908 Author: Thaddeus Crews Date: Mon Dec 9 14:33:38 2024 -0600 Merge pull request #76020 from dalexeev/gds-warning-ignore-regions GDScript: Add `@warning_ignore_start` and `@warning_ignore_restore` annotations commit b4bd38444bd3fc024015e9da75e4c4da0c127393 Merge: 09dd5e6b20 8ab27a7ccf Author: Thaddeus Crews Date: Mon Dec 9 14:33:37 2024 -0600 Merge pull request #98545 from juanjp600/dotnet-generic-collections-set-typed Fix generic arrays and dictionaries in .NET not calling `set_typed` commit 09dd5e6b20f9ef46987d21e744b9f3e0cd6e3888 Merge: 4b1a51d3e3 3e30dd7954 Author: Thaddeus Crews Date: Mon Dec 9 14:33:36 2024 -0600 Merge pull request #98032 from zaevi/fix_drag_preview_position Fix incorrect drag preview position under transformed `CanvasLayer`. commit 4b1a51d3e3c70b958e8c184bd146e95ecca15687 Merge: 5b312d0e59 964e2b3a9e Author: Thaddeus Crews Date: Mon Dec 9 14:33:34 2024 -0600 Merge pull request #100075 from demolke/simplify Fix handling of leading `..` in simplify_path commit 5b312d0e5950a9023661d4ecde9fc44c1e73e667 Merge: a3656083ca e1c42392c2 Author: Thaddeus Crews Date: Mon Dec 9 14:33:33 2024 -0600 Merge pull request #99816 from Ivorforce/string-copy-from-optimizations Optimize `String::copy_from` and `String::copy_from_unchecked` implementations, improving String allocation speed. commit a3656083cab6cee017a38729509cea2bf248dcdb Merge: da8b9ba1ff deac37c464 Author: Thaddeus Crews Date: Mon Dec 9 14:33:32 2024 -0600 Merge pull request #100065 from clayjohn/mesh-aabb-clear Clear AABB when Mesh is cleared commit da8b9ba1ffc51d1b51a59142341dfa085f1e49d9 Merge: e9679a28ff a5caeeb664 Author: Thaddeus Crews Date: Mon Dec 9 14:33:31 2024 -0600 Merge pull request #99168 from RandomShaper/even_better_spinlock SpinLock: Overhaul false sharing prevention commit e9679a28ffe477a6c9592653384b43a2042a6cd1 Merge: 94711acfe1 e6a49ab6ac Author: Thaddeus Crews Date: Mon Dec 9 14:33:29 2024 -0600 Merge pull request #91604 from nongvantinh/implement-7946 Save color palette as resources to reuse later commit 94711acfe100a6f3485120e06406a3e7183bdd43 Merge: 7d4db793e6 803fa8f2e8 Author: Thaddeus Crews Date: Mon Dec 9 14:33:28 2024 -0600 Merge pull request #87375 from limbonaut/instantiate_property_editor Export `EditorInspector::instantiate_property_editor` for use by plugins commit 7d4db793e6e49902c30192e06cce7adb5039fe34 Merge: d6473dd3fa 98a23136d5 Author: Thaddeus Crews Date: Mon Dec 9 14:33:27 2024 -0600 Merge pull request #100044 from Yelloween10/fix-input-event-metadata Fix discarded input event metadata in `xformed_by` commit d6473dd3fa07ab47e453a96335a4fc7c7fdf4f51 Merge: 473c28b1ad 7558bed893 Author: Thaddeus Crews Date: Mon Dec 9 14:33:26 2024 -0600 Merge pull request #100167 from AshWolf/header-guards-crash-fix Fix crash within header_guards when a file is too short commit 473c28b1ad4c9f6b9066d8c840bd75e031222ede Merge: a607bca2fd 0d7027ea4c Author: Thaddeus Crews Date: Mon Dec 9 14:33:25 2024 -0600 Merge pull request #98118 from bruvzg/escape_colors Add support for 24-bit color escape sequences, simplify `print_rich` BBCode parsing. commit a607bca2fd852f02ae0a0beb5a4355b8309ddb28 Merge: 101b78fbea b5c31ebb41 Author: Thaddeus Crews Date: Mon Dec 9 14:33:24 2024 -0600 Merge pull request #100024 from Ivorforce/optimize-string-single-char Optimize string single char contains calls. commit 101b78fbea58530ec901074c8895147ba50e5d81 Merge: fb4d401933 b4c6f9b3d9 Author: Thaddeus Crews Date: Mon Dec 9 14:33:23 2024 -0600 Merge pull request #100020 from Lielay9/mend-round-primitives Mend gaps in meshes caused by trigonometric funcs. commit fb4d40193389162dca1eb5b0eb6a1a1129becc00 Merge: e06f699354 174e659a48 Author: Thaddeus Crews Date: Mon Dec 9 14:33:21 2024 -0600 Merge pull request #81714 from CreepGin/navigation_feel Add 3D translation sensitivity to Editor Settings commit e06f699354d6316356f7d1d06776dcd3a181e7cd Merge: 2256d6da34 1e62c7f53e Author: Thaddeus Crews Date: Mon Dec 9 14:33:20 2024 -0600 Merge pull request #99886 from ZhiyiHu93/update-sky-tests Add unit tests for Sky commit 2256d6da34d91e1fbde771be429a2f9201693963 Merge: cc59949cfe 2481632b3c Author: Thaddeus Crews Date: Mon Dec 9 14:33:18 2024 -0600 Merge pull request #100140 from Chubercik/thorvg_patches thorvg: Regenerate and apply patches commit cc59949cfe042f4923c99c57cda9ad8d1fe6138a Merge: 5f5f86bff0 4eba3d8377 Author: Thaddeus Crews Date: Mon Dec 9 14:33:17 2024 -0600 Merge pull request #100006 from Daylily-Zeleen/daylily-zeleen/hide_debug_instnce Hide `NavigationRegion2D`'s debug instance instead of freeing it, and hide it when `navigation_polygon` is set to null. commit 5f5f86bff0479aa47be3e156603723cdccd77e39 Merge: e7cdbf827b fce34f22a2 Author: Thaddeus Crews Date: Mon Dec 9 14:33:16 2024 -0600 Merge pull request #100128 from clayjohn/rd-shader-spam Avoid error spam when shaders fail to compile by freeing shader_data version when compilation fails commit e7cdbf827b50a919adc8db8c24ffa7f0a37761f8 Merge: 75a425f1d3 35faf99755 Author: Thaddeus Crews Date: Mon Dec 9 14:33:15 2024 -0600 Merge pull request #99871 from RossRothenstine/ross/fix-windows-sleep-underflow Windows: Fix underflow before `delay_usec` commit 75a425f1d3e238a6f8e8f3cdc07b44d2442f937a Merge: 3b8c459dae 0dfbf4a5df Author: Thaddeus Crews Date: Mon Dec 9 14:33:14 2024 -0600 Merge pull request #99995 from clayjohn/RD-batch-ptrw Optimize batch uniform set creation by caching ptrw when creating batch uniform commit 3b8c459dae41827f56a7ee1b06e0f966048bbb0c Merge: 6931930029 f3a3452bca Author: Thaddeus Crews Date: Mon Dec 9 14:33:13 2024 -0600 Merge pull request #99992 from yahkr/fix_control_orphan_startup Fix for `RuntimeNodeSelect` `selection_list` showing up as an orphaned node when editor is open during runtime commit 6931930029c9c1375ec8751d24f07c61c94d2056 Merge: 2654dbaf5c fbde06e4c8 Author: Thaddeus Crews Date: Mon Dec 9 14:33:12 2024 -0600 Merge pull request #99860 from akien-mga/basisu-clarify-encoder-only-deps basis_universal: Clarify encoder-only dependencies, only used in editor builds commit 2654dbaf5cf2c20bd0f382c617c3efd3ca897966 Merge: b91c38eaac d3c9bee653 Author: Thaddeus Crews Date: Mon Dec 9 14:33:11 2024 -0600 Merge pull request #99984 from KoBeWi/negative_diff_but_it's_deleting_whole_files Move singleton StringName definitions to header commit b91c38eaacf2d93e8ed36605534207bba9586090 Merge: 94caf59b71 1daa9a180b Author: Thaddeus Crews Date: Mon Dec 9 14:33:10 2024 -0600 Merge pull request #98443 from timoschwarzer/fix/control-offset-type Fix Control `offset_*` property types commit 94caf59b71819790a451f432458df957dc4e06b6 Merge: 533091ae22 4de615d1ae Author: Thaddeus Crews Date: Mon Dec 9 14:33:09 2024 -0600 Merge pull request #100105 from smix8/dirty_mold Fix avoidance dirty flag regression commit 533091ae22c8bbd3409cf0ad5ef6020641302b37 Merge: aa8d9b83f6 c7895ca226 Author: Thaddeus Crews Date: Mon Dec 9 14:33:08 2024 -0600 Merge pull request #99974 from Flarkk/improve_occlusion_jitter Optimize Occlusion culling jitter commit fce34f22a2a1f266b676e3371260b1039faca8f1 Author: clayjohn Date: Fri Dec 6 15:31:42 2024 -0800 Avoid error spam when shaders fail to compile by freeing shader_data version when compilation fails commit 7558bed89377bc7f9c9284a5bce5cf798e91b7ed Author: Andrew Date: Sun Dec 8 01:57:49 2024 -0500 fixed crash when file too short commit 8ab27a7ccf4e743d7ae8d40990211855f44ca812 Author: Juan Pablo Arce Date: Sun Oct 6 22:58:23 2024 -0300 Fix generic arrays and dictionaries not calling set_typed commit 803fa8f2e8ee60789413c0dd0fd46c8bd098e007 Author: Serhii Snitsaruk Date: Fri Jan 19 16:00:55 2024 +0100 Export `EditorInspector::instantiate_property_editor` for use by plugins And export useful properties and methods in the `EditorProperty` class. commit 2481632b3cbfde0948cf8984b2d625dbe836c0df Author: Jakub Marcowski Date: Sat Dec 7 13:11:37 2024 +0100 thorvg: Regenerate and apply patches commit e1c42392c20d53066f861c6f9f29dce8d1ac4729 Author: Lukas Tenbrink Date: Fri Nov 29 01:40:12 2024 +0100 Improve string copy_from and copy_from_unchecked implementations, by making use of caller contracts and language spec (NULL termination and casts). commit b5c31ebb41ad448e1f247a50f8860e51efeafaf0 Author: Lukas Tenbrink Date: Thu Dec 5 17:56:08 2024 +0100 Add contains_char() for single-character 'contains' calls. commit 98a23136d5058bda70f16e80801ef028bd09e40e Author: Yelloween <134299963+Yelloween10@users.noreply.github.com> Date: Thu Dec 5 15:51:59 2024 +0300 Fix missing event metadata in _input() with Input.parse_input_event() Use merge_meta_from() for metadata copying. Fixed include order Removed unnecessary line commit 1e62c7f53eef3e9ab7306e33d1100bfe6532f397 Author: Zhiyi Hu Date: Sat Nov 30 16:25:51 2024 -0500 Add unit tests to Sky commit 4de615d1ae2e63dffd36c1be9f5aa0681b34dc28 Author: smix8 <52464204+smix8@users.noreply.github.com> Date: Fri Dec 6 16:20:59 2024 +0100 Fix avoidance dirty flag regression The dirty flag can also still be set by some legacy functions triggered by the agents and obstacles. commit aa8d9b83f66488dbb2c9c918e9016ef80f821fb4 Merge: eb5103093c df2c2ca3c3 Author: Rémi Verschelde Date: Fri Dec 6 16:16:17 2024 +0100 Merge pull request #99960 from pafuent/fixing_tcp_server_flappy_disconnect_test Fix `TCPServer` "Should disconnect client" test commit b4c6f9b3d93c64f469e8a3c767b261eeb12ac239 Author: Hei <40064911+Lielay9@users.noreply.github.com> Date: Wed Dec 4 20:23:45 2024 +0200 Mend gaps in meshes caused by trigonometric funcs. commit e6a49ab6ac2b7faaa2bff8a46b8cbe566dfe13ef Author: Nông Văn Tình Date: Sat May 18 10:45:16 2024 +0700 Save color palette as resources to reuse later Co-authored-by: Micky <66727710+Mickeon@users.noreply.github.com> commit d3c9bee65318249f797951a5fce649ed864ff0ba Author: kobewi Date: Tue Dec 3 21:34:53 2024 +0100 Move singleton StringName definitions to header commit 7d65d0a908a0806f96a21e01528dbd8fff8a661f Author: Danil Alexeev Date: Fri Dec 6 10:25:59 2024 +0300 GDScript: Add `@warning_ignore_start` and `@warning_ignore_restore` annotations commit 1daa9a180b3fdeb2ed6df512c5103fac50c215e2 Author: Timo Schwarzer Date: Wed Oct 23 02:27:47 2024 +0200 Fix Control offset_* property types commit 964e2b3a9e35dc91c3c1b6688f743922f9660b87 Author: demolke Date: Thu Dec 5 23:23:53 2024 +0100 Fix handling of leading `..` in simplify_path Prior to this `..\..\texture.png` was incorrectly simplified to `texture.png` commit 174e659a4894751d72ca1154b47e47883d4fdc83 Author: David Date: Fri Sep 15 14:24:07 2023 -0700 Add 3D translation sensitivity to Editor Settings commit eb5103093c1bfd4d527ec1255d28e9bc8d3625b5 Merge: 4b91e98656 0a4dd371b7 Author: Thaddeus Crews Date: Thu Dec 5 14:12:26 2024 -0600 Merge pull request #99327 from colinator27/sync-bar-beats Implement `AudioStreamSynchronized::get_bar_beats()`, fix division by zero commit 4b91e98656f8943bae298ed8329c194a0ee83f63 Merge: 7bff6c827f 6cf1d3c13e Author: Thaddeus Crews Date: Thu Dec 5 14:12:25 2024 -0600 Merge pull request #99959 from fire/vsk-csg-error-and-ctd Print better manifold errors and avoid crash on non manifold csg input. commit 7bff6c827f75b7ebbaf7bc2ccfb9284af043a284 Merge: 637239e979 8c4a9ad626 Author: Thaddeus Crews Date: Thu Dec 5 14:12:24 2024 -0600 Merge pull request #99186 from PhairZ/wheels-of-the-bus-go-round-and-round Fix `fade_beats` defined as `int` in `audio_stream_interactive.h` commit 637239e9795189a95d5a05002e441c26708719f5 Merge: c153f963ce 1bffefb346 Author: Thaddeus Crews Date: Thu Dec 5 14:12:23 2024 -0600 Merge pull request #94193 from BastiaanOlij/buildin_includes Add ability to include built-in include files commit c153f963ce1b3406e44679350c3fd14d94066f51 Merge: 45734bd451 2336415623 Author: Thaddeus Crews Date: Thu Dec 5 14:12:22 2024 -0600 Merge pull request #99947 from Meorge/ignore-macosx-in-zip Ignore `__MACOSX` directory for export template and project ZIPs commit 45734bd451bfcd325aa8f4efed62198d27e2f672 Merge: 8e01601123 2b39314461 Author: Thaddeus Crews Date: Thu Dec 5 14:12:21 2024 -0600 Merge pull request #99817 from Ivorforce/strlen-char32_t Use `strlen()` 3 times instead of custom length check implementations in ustring commit 8e01601123ba6276084e3fd2e8f5278f3911bbbc Merge: 6588505aca 1b5a15d5d1 Author: Thaddeus Crews Date: Thu Dec 5 14:12:19 2024 -0600 Merge pull request #100064 from clayjohn/atlas-realloc-time Correctly check time since shadow was allocated in atlas to avoid unnecessary re-allocations commit 6588505aca3728930f9071cebf118f54c7cf525c Merge: 4d0ce3ce76 121e640637 Author: Thaddeus Crews Date: Thu Dec 5 14:12:18 2024 -0600 Merge pull request #96735 from bruvzg/rtl_frame_indent [RTL] Fix indent in tables and tables in indent. commit 4d0ce3ce7685393a84fa891552e45b5488c74b03 Merge: 85862ea718 329d25b1fa Author: Thaddeus Crews Date: Thu Dec 5 14:12:17 2024 -0600 Merge pull request #100060 from Rudolph-B/Issue-100032 Fixed occlusion culling buffer getting overwritten in larger scenes commit 85862ea718b81cb0bcf603cac3ca57ca46a82c94 Merge: b34a643404 d7d6251c30 Author: Thaddeus Crews Date: Thu Dec 5 14:12:16 2024 -0600 Merge pull request #100058 from DarioSamo/d3d12-texture-limits Add texture limits for D3D12 Driver. commit b34a64340409257b9878fc35c8e91e8f2ad1060f Merge: 30b32396de afd68d785b Author: Thaddeus Crews Date: Thu Dec 5 14:12:15 2024 -0600 Merge pull request #96346 from DeeJayLSP/qoa-opt Use `qoa.c` and custom compress procedure commit 30b32396de24eb1c2dde42369b737e28c4a0132c Merge: 370e5f3b0e 06cae04b87 Author: Thaddeus Crews Date: Thu Dec 5 14:12:14 2024 -0600 Merge pull request #100053 from bruvzg/font_change Change default Arabic font to Vazirmatn. commit 370e5f3b0edf332b60d5cbd05ee098640a36adfa Merge: 49e033f8e2 a694cd7120 Author: Thaddeus Crews Date: Thu Dec 5 14:12:12 2024 -0600 Merge pull request #99920 from lander-vr/reflection-probe-ui-improvements Clean up UI of ReflectionProbe commit 49e033f8e2d8a09ca03a0b9db2c311f078b4cb7f Merge: 63af934d74 6bc80effbb Author: Thaddeus Crews Date: Thu Dec 5 14:12:11 2024 -0600 Merge pull request #100047 from MBCX/fix-freebsd-compilation Make Godot compile on `FreeBSD` commit 63af934d74fe300bcffef36d0d6caafe80edd454 Merge: 09cbe05485 becf5d7ac3 Author: Thaddeus Crews Date: Thu Dec 5 14:12:10 2024 -0600 Merge pull request #98506 from 0xafbf/build-linux-with-spaces-in-path Fix linux builds with separate debug symbols file when there is a space in the path. commit 09cbe0548508bcf82417f385fc545c7ec4ad9280 Merge: f5d82af1fd e4106f8d61 Author: Thaddeus Crews Date: Thu Dec 5 14:12:09 2024 -0600 Merge pull request #76231 from Calinou/inspector-text-show-tooltip Show String properties' text in a tooltip in the inspector commit f5d82af1fd2b1f0f128964a0d45d847aeac1d7ee Merge: ef22b6fe82 0ce4c6dac3 Author: Thaddeus Crews Date: Thu Dec 5 14:12:08 2024 -0600 Merge pull request #99136 from DarioSamo/light-compute-attenuation-skip Improve performance of shader lighting code in Forward renderers. commit ef22b6fe82e4a382a88c03d7fc09a7a9326badbf Merge: a4c2e16c19 73f7e1379c Author: Thaddeus Crews Date: Thu Dec 5 14:12:06 2024 -0600 Merge pull request #100030 from passivestar/mainmenu-valign Fix vertical alignment of the main menu bar commit a4c2e16c199e9b3f4b10df2410123c6b2a676b61 Merge: 68cd7f2e97 e316739a13 Author: Thaddeus Crews Date: Thu Dec 5 14:12:05 2024 -0600 Merge pull request #100028 from clayjohn/rd-lights-array Use a vector instead of an array in canvas shader instance buffer commit 68cd7f2e971e583e7207c74928f196da49010109 Merge: ea12a08149 1ef3bd5768 Author: Thaddeus Crews Date: Thu Dec 5 14:12:04 2024 -0600 Merge pull request #100027 from timothyqiu/efd-improve Fix UI inconsistencies in `EditorFileDialog`'s toolbar commit ea12a08149322fabf46de013f9c889c08181c607 Merge: 06cce0e81a eaa0418deb Author: Thaddeus Crews Date: Thu Dec 5 14:12:02 2024 -0600 Merge pull request #100022 from DeeJayLSP/wav-load-test `TestAudioStreamWAV`: use runtime load instead of importer commit 06cce0e81abe6e0ce97eb6263125f47f8e0ba357 Merge: 3a948abdce 8d82933c7c Author: Thaddeus Crews Date: Thu Dec 5 14:11:59 2024 -0600 Merge pull request #100016 from Ivorforce/camelcase-to-underscore-rolling-cache Optimize `_camelcase_to_underscore` (and thus `String.capitalize`) commit 3a948abdce09f2ddd96baff53b44beb49836951b Merge: df94c00f6d 0d2e13bcb8 Author: Thaddeus Crews Date: Thu Dec 5 14:11:57 2024 -0600 Merge pull request #100015 from Ivorforce/is-valid-filename-cache Optimize `String::is_valid_filename()` and `String::validate_filename()` commit df94c00f6d35b3bc935313acf0be2bd27ef42c53 Merge: ec7ffdcb15 113621dd89 Author: Thaddeus Crews Date: Thu Dec 5 14:11:53 2024 -0600 Merge pull request #100010 from KoBeWi/directory_compass_for_navigating_sea_of_directories Don't rebuild tree when navigating to path commit ec7ffdcb155e2fb9b4701a57c34a509f9d8b0d65 Merge: a27d744506 5318008ce6 Author: Thaddeus Crews Date: Thu Dec 5 14:11:50 2024 -0600 Merge pull request #100008 from Chubercik/thorvg-0.15.5 thorvg: Update to 0.15.5 commit a27d7445062830cb09310a24b152d381a62ef4b3 Merge: 755f600173 8a5eef95aa Author: Thaddeus Crews Date: Thu Dec 5 14:11:48 2024 -0600 Merge pull request #100002 from wyvrtn/master Fix a very slight grammatical issue commit 755f60017361080217ad780cbb6e517eafd41753 Merge: 9951743adf 4051b43879 Author: Thaddeus Crews Date: Thu Dec 5 14:11:46 2024 -0600 Merge pull request #99999 from akien-mga/ufbx-0.15.0 ufbx: Update to upstream 0.15.0 commit 9951743adf406a69e2d52f49e44896f1793fe910 Merge: 4adf4bf58f f39614aa5a Author: Thaddeus Crews Date: Thu Dec 5 14:11:44 2024 -0600 Merge pull request #97822 from stdmnpkg/loongarch Add loongarch64 support for Linux/*BSD commit 4adf4bf58fdafb5e56d9999e57d5e82cf2a92198 Merge: e9cbfd3dad b0cee57d81 Author: Thaddeus Crews Date: Thu Dec 5 14:11:42 2024 -0600 Merge pull request #99987 from KoBeWi/preferred_mess Fix extensions when saving resource as commit e9cbfd3dad0e4ca3c1db0ccbbcf6703fe3a248ab Merge: 8c8bfce0f9 274064ae7f Author: Thaddeus Crews Date: Thu Dec 5 14:11:40 2024 -0600 Merge pull request #99982 from hakro/quiet_tiptool Ignore custom tooltip if its text is empty in signals tab commit 8c8bfce0f9e0d2e9914568059a400023c219c349 Merge: 1f47e4c4e3 fa7615be9e Author: Thaddeus Crews Date: Thu Dec 5 14:11:29 2024 -0600 Merge pull request #99978 from DarioSamo/more-mobile-scs Add specialization for directional light split blend and fog to mobile renderer. commit fbde06e4c8013c5432a5f1411938bd3b3feaa791 Author: Rémi Verschelde Date: Sat Nov 30 01:40:16 2024 +0100 basis_universal: Clarify encoder-only dependencies, only used in editor builds commit deac37c464b8736e00b25f72e95fd68b90c8650d Author: clayjohn Date: Thu Dec 5 11:40:44 2024 -0800 Clear AABB when Mesh is cleared commit 1b5a15d5d1696099bf06bee5775606a7a50f3267 Author: clayjohn Date: Thu Dec 5 11:08:59 2024 -0800 Correctly check time since shadow was allocated in atlas to avoid unnecessary re-allocations Co-authored-by: jitspoe commit d7d6251c30a9d54da6842d23e3bd6db4df8f8d8b Author: Dario Date: Thu Dec 5 13:55:57 2024 -0300 Add texture limits for D3D12 Driver. commit 329d25b1fafccf5e8059c494b6210f1805b0b4bb Author: Rudolph Bester Date: Thu Dec 5 18:54:13 2024 +0200 Fixed occlusion culling buffer getting overwritten in larger scenes commit 6bc80effbb9302c9aa14e0006826fc91fd863e30 Author: MBCX <63003002+MBCX@users.noreply.github.com> Date: Thu Dec 5 10:04:25 2024 -0400 Make Godot compile on FreeBSD commit afd68d785b7148ed25b6d48d28072e7827e43ece Author: DeeJayLSP Date: Wed Dec 4 00:53:14 2024 -0300 Use `qoa.c` and custom compress procedure commit f39614aa5aa0bae2355e3cab13f8f50b58cddc58 Author: Student Main Date: Sat Oct 5 03:56:14 2024 +0800 Ignore case when parse /proc/cpuinfo commit e0693f8ad8f432b384acf2af809c4199caf05f6f Author: Student Main Date: Sat Oct 5 02:24:15 2024 +0800 Add loongarch64 support commit becf5d7ac3f28e96cbb3ae83db72083707a80ed5 Author: Andrés Botero <0xafbf@gmail.com> Date: Thu Oct 24 20:50:43 2024 -0500 Fix linux builds with debug symbols when there is a space in the path. commit 06cae04b878c98e9cd89ed25e5f25421e973c9f0 Author: Pāvels Nadtočajevs <7645683+bruvzg@users.noreply.github.com> Date: Thu Dec 5 16:26:52 2024 +0200 Change default Arabic font to Vazirmatn. commit 8a5eef95aa32ccaa7473498adb3f404d89f1e6d8 Author: Wyv <181348033+wyvrtn@users.noreply.github.com> Date: Tue Dec 3 11:37:38 2024 -0500 Fix a very slight grammatical issue Changed the incorrect verb "have" into its correct form, "has." Fixes #99972 Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> commit 1ef3bd57688024a53fd583248a4e4afb041c81aa Author: Haoyu Qiu Date: Tue Dec 3 09:43:12 2024 +0800 Fix UI inconsistencies in EditorFileDialog's toolbar - Sort button has different stylebox compared to others - The top toolbar has a separator on the right side when in open mode - Update fav up/down buttons when fav list changes commit 35faf9975540fd8ea8520a1a26f80a090253a469 Author: Ross Rothenstine Date: Sat Nov 30 02:30:05 2024 -0800 windows: Fix underflow before delay_usec commit 73f7e1379c3431f9ee9c7eb55d87649a69758f85 Author: passivestar <60579014+passivestar@users.noreply.github.com> Date: Thu Dec 5 05:27:34 2024 +0400 Fix vertical alignment of the main menu bar commit e316739a134a3bbe07584a586023cd5bf5e826b4 Author: clayjohn Date: Wed Dec 4 16:36:46 2024 -0800 Use a vector instead of an array in canvas shader instance buffer. This avoids a pathological performance cliff on Adreno devices commit eaa0418debe9911b4aed2adf07465884cd905abb Author: DeeJayLSP Date: Wed Dec 4 16:46:18 2024 -0300 TestAudioStreamWAV: use runtime load instead of importer commit 2336415623189d2d63c5bce389156e618bdcc956 Author: Malcolm Anderson Date: Mon Dec 2 17:50:20 2024 -0800 Ignore `__MACOSX` directory in export template collection ZIP file and project import ZIP file Update editor/export/export_template_manager.cpp Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> commit 8d82933c7cfe4a16b0b5806e1f553fdcd1b8c57e Author: Lukas Tenbrink Date: Wed Dec 4 18:39:38 2024 +0100 Optimize _camelcase_to_underscore (and thus String.capitalize) by using a rolling cache of character attributes, instead of re-computing each iteration. commit 1f47e4c4e3a09a422e96880a7918d986dd575a63 Merge: 451fd7a436 cc5be8507c Author: Thaddeus Crews Date: Wed Dec 4 11:02:11 2024 -0600 Merge pull request #99990 from KoBeWi/update_tree_after_updating_tree Fix FileSystem dock filter reset when tree rebuilds commit 451fd7a436e024551aa0e4943404368cc38f8bb4 Merge: 9381479dd3 b91bacb43a Author: Thaddeus Crews Date: Wed Dec 4 11:02:09 2024 -0600 Merge pull request #99540 from dalexeev/core-dont-gen-json-uid-files Core: Do not generate `*.uid` files for JSON, certificates, and translations commit 9381479dd37747348b2b06101322bae46758fbd3 Merge: 610f4a2687 a80eb8c503 Author: Thaddeus Crews Date: Wed Dec 4 11:02:07 2024 -0600 Merge pull request #99988 from Hilderin/fix-regression-inspector-tooltip-blinking Fix Inspector tooltips are blinking commit 610f4a26872bcfda8d4ccf8d18c2b12e280bff48 Merge: 53f59619e2 ff6eea5042 Author: Thaddeus Crews Date: Wed Dec 4 11:02:06 2024 -0600 Merge pull request #97328 from AThousandShips/fix_recursive_draw Prevent infinite recursion in first `_draw` commit 53f59619e2b26eecb4b6e052038f49ea8e9ee208 Merge: 498d8f9aae 08a8f430f4 Author: Thaddeus Crews Date: Wed Dec 4 11:02:04 2024 -0600 Merge pull request #99983 from MewPurPur/followup Codestyle improvements in style_box_flat.cpp commit 498d8f9aae873d020d65017bf8fe641a846cced5 Merge: ab58a339df 6e490dadcd Author: Thaddeus Crews Date: Wed Dec 4 11:02:03 2024 -0600 Merge pull request #100012 from KoBeWi/rebuilding_the_file_tree_to_find_the_file_you_just_clicked_is_absolutely_crucial_trust_me Don't navigate to path when file is double-clicked commit ab58a339dffb57a11ab7efbf5c63a9516b460f9e Merge: 47bc374edf 67b95f341e Author: Thaddeus Crews Date: Wed Dec 4 11:02:02 2024 -0600 Merge pull request #99712 from KoBeWi/bug_spawner_spawns_new_bugs_to_fix Fix UID support in MultiplayerSpawner commit 0d2e13bcb8f25ab3ace44163eb82a5589ab87aa1 Author: Lukas Tenbrink Date: Wed Dec 4 17:50:40 2024 +0100 Optimize is_valid_filename and validate_filename by caching invalid filename characters, instead of re-splitting each call. commit c7895ca22686bb0c6873f265273503bea93cd69d Author: Florent Guiocheau Date: Mon Dec 2 13:16:44 2024 +0100 Optimize Occlusion jitter commit 5318008ce6a52fa3af7f466189a263d4905c76fa Author: Jakub Marcowski Date: Wed Dec 4 13:47:20 2024 +0100 thorvg: Update to 0.15.5 commit f3a3452bca3e97eeb26f9ab2550f6a422aa5008f Author: yahkr <62478788+yahkr@users.noreply.github.com> Date: Tue Dec 3 17:49:39 2024 -0500 Fix for `RuntimeNodeSelect` `selection_list` showing up as an orphaned node when editor is open during runtime commit 113621dd8998cc3f33281c8c420bcde678cfdb99 Author: kobewi Date: Wed Dec 4 15:10:05 2024 +0100 Don't rebuild tree when navigating to path commit 6e490dadcdc2c25b0e2cf997ad6ab84c4adf622f Author: kobewi Date: Wed Dec 4 15:19:01 2024 +0100 Don't navigate to path when file is double-clicked commit b91bacb43af4f797981c7933f944da2ad6c0c06d Author: Danil Alexeev Date: Fri Nov 22 16:13:58 2024 +0300 Core: Do not generate `*.uid` files for JSON, certificates, and translations commit 4eba3d837751ba61c129b9879d13c6eef955a9b1 Author: Daylily-Zeleen Date: Wed Dec 4 17:57:58 2024 +0800 Hide NavigationRegion2D debug instance instead of free it, and hide it when navigation_polygon is set to null. commit 6cf1d3c13e4ecc0f50f689e9001be954b7ae6eff Author: K. S. Ernest (iFire) Lee Date: Tue Dec 3 04:12:36 2024 -0800 Print better manifold errors and avoid crash on non manifold csg input. * Manifold does not have a snap property. * Tolerance means simplification amount. * CSG snap has been removed * Add better error messages. * Verbose print manifold meshgl64 properties as json. * Update manifold for error fixes commit 4051b43879fbc0070111bc93362d254c5a0946ef Author: Rémi Verschelde Date: Wed Dec 4 02:19:04 2024 +0100 ufbx: Update to upstream 0.15.0 commit 0dfbf4a5df27f5529a9d7a9b13976107bfdcd2b2 Author: clayjohn Date: Tue Dec 3 17:16:44 2024 -0800 Optimize batch uniform set creation by caching ptrw when creating batch uniform commit e4106f8d61fb1f0163c5b00b4585a8cae3d962ca Author: Hugo Locurcio Date: Tue Apr 18 19:45:48 2023 +0200 Show String properties' text in a tooltip in the inspector This allows previewing single-line or multipline strings that are too long too fit within the box in the inspector. commit cc5be8507c314f8dcdb8387d742dfe0a6c7910dd Author: kobewi Date: Tue Dec 3 23:36:51 2024 +0100 Fix FileSystem dock filter reset when tree rebuilds commit a80eb8c503a7f09a904ff7a51d7e4cfa811444ce Author: Hilderin <81109165+Hilderin@users.noreply.github.com> Date: Tue Dec 3 17:21:00 2024 -0500 Fix Inspector tooltips are blinking commit b0cee57d814109b4670e0ca51ec64b59e32a4f77 Author: kobewi Date: Tue Dec 3 22:54:54 2024 +0100 Fix extensions when saving resource as commit 121e6406370f5c9fe2b536bfc4e5de85a4b92a50 Author: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Mon Sep 9 00:04:07 2024 +0300 [RTL] Fix indent in tables and tables in indent. commit 67b95f341eb3eb024af6653a3fb061db67b796fa Author: kobewi Date: Tue Nov 26 16:22:05 2024 +0100 Fix UID support in MultiplayerSpawner commit 47bc374edf6d2e775a5e6b937dc3fd73cdc6f59b Merge: 44cda51110 4db9c112ff Author: Thaddeus Crews Date: Tue Dec 3 14:41:08 2024 -0600 Merge pull request #99325 from Calinou/doc-zipreader-extract-all Add a code sample that extracts all files to ZIPReader documentation commit 44cda51110942f522237e62a25f67c7e84d7c63c Merge: 1719f8ed3d d5e599f77e Author: Thaddeus Crews Date: Tue Dec 3 14:41:07 2024 -0600 Merge pull request #98812 from bruvzg/macos_bundles_as_file [macOS] Handle bundles as files in the embedded file dialogs. commit 1719f8ed3dd3391633affdcb6690571159f8790b Merge: e5d62fa120 83d4bde0a2 Author: Thaddeus Crews Date: Tue Dec 3 14:41:06 2024 -0600 Merge pull request #99834 from kiroxas/passLengthToParseUTF8 Ensure `parse_utf8` has length of string passed in when available commit e5d62fa1209ecfeb5fe5d45ef8d65130e217b54a Merge: 6472e9e961 8ca1605bbb Author: Thaddeus Crews Date: Tue Dec 3 14:41:04 2024 -0600 Merge pull request #99957 from StaydMcMuffin/preview_environment_sky_fix Editor: Fix default preview environment sky's horizon and brightness. commit 6472e9e961d22a30117700aea02eff4076b9ab5b Merge: ec333a8c32 7f64f230a7 Author: Thaddeus Crews Date: Tue Dec 3 14:41:03 2024 -0600 Merge pull request #99310 from syntaxerror247/filedialog_issue Android: Set default ACCESS_FILESYSTEM root commit ec333a8c32bf2ff39d840ec8a3a48b092c2d367c Merge: 87515ae1b1 95ca0aa7ad Author: Thaddeus Crews Date: Tue Dec 3 14:41:02 2024 -0600 Merge pull request #99564 from JekSun97/get_connetion_count_method_graphedit Add `get_connection_count` function to `GraphEdit` commit 87515ae1b12b2a5d5c2236ac0b31a56ff4c0c445 Merge: 156bc92282 6960b33cbb Author: Thaddeus Crews Date: Tue Dec 3 14:41:01 2024 -0600 Merge pull request #99941 from Flarkk/fix_occlusion_jitter Fix Occlusion culling jitter commit 156bc92282687f2da140234bd3a3dd49a337f550 Merge: 26e7b6bdd6 1b3e483899 Author: Thaddeus Crews Date: Tue Dec 3 14:40:59 2024 -0600 Merge pull request #98397 from adamscott/add-tmp-support Add temp utilities (alias `OS::get_temp_dir()`, `FileAccess::create_temp()`, and `DirAccess::create_temp()`) commit 26e7b6bdd67230686e064ed8d1f65aa12b47f4b4 Merge: 608cccc64e c5ca56f40b Author: Thaddeus Crews Date: Tue Dec 3 14:40:58 2024 -0600 Merge pull request #99164 from bruvzg/int_files [Export] Write text server data from memory, instead of using temporary file. commit 608cccc64e7c51da4ecd4f81e2e33b6210cd29d0 Merge: a135a6478a d97313cd7d Author: Thaddeus Crews Date: Tue Dec 3 14:40:57 2024 -0600 Merge pull request #99919 from bruvzg/ferror [FileAccess] Set `last_error` on file read/write errors. commit a135a6478a3519207c851c459dc515473dec0ec7 Merge: 70dae45dd0 a46ea9d064 Author: Thaddeus Crews Date: Tue Dec 3 14:40:56 2024 -0600 Merge pull request #98383 from RandomShaper/deprecate_unsafe_th_rend Deprecate the pointless unsafe threading model for rendering commit 70dae45dd0634c8833b10aa640ddbc910ca2a06f Merge: cebd37da8b 7caa039183 Author: Thaddeus Crews Date: Tue Dec 3 14:40:55 2024 -0600 Merge pull request #99905 from stuartcarnie/fix_external_texture Metal: Ensure `texture_create_from_extension` returns correct pixel format commit cebd37da8b92d5f516b95eb9ef20bd9e41d95654 Merge: 8a134c580c dd33e877aa Author: Thaddeus Crews Date: Tue Dec 3 14:40:54 2024 -0600 Merge pull request #99776 from peterdang1502/default-project-path-trailing-slash Strip any trailing slashes when reading the default project path commit 8a134c580c25856e06c51b376093cca2cdd3554b Merge: 6e8c0a43c3 87709cfdf2 Author: Thaddeus Crews Date: Tue Dec 3 14:40:53 2024 -0600 Merge pull request #97469 from Calinou/cameraserver-linux-remove-prints Remove verbose prints from CameraServer on Linux due to being printed every second commit 6e8c0a43c3b8fab1a25a8da7e804a8575b1cd6de Merge: 40a65e739d f767cf00fd Author: Thaddeus Crews Date: Tue Dec 3 14:40:52 2024 -0600 Merge pull request #99378 from syntaxerror247/optional_monochrome_icon Android: Refactor icon logic and make monochrome icon optional commit 40a65e739de1ffdaaa4dddb87b13c0e15a7053ae Merge: c72fe8e61f 84650f2018 Author: Thaddeus Crews Date: Tue Dec 3 14:40:50 2024 -0600 Merge pull request #99371 from bruvzg/beep Implement `DisplayServer.beep`. commit c72fe8e61f259cb07c535d62016d1a597430eb87 Merge: 1080cd900b 4b23e504e8 Author: Thaddeus Crews Date: Tue Dec 3 14:40:49 2024 -0600 Merge pull request #98082 from bruvzg/rtl_keep_tag_stack [RTL] Keep tag stack between `append_text` calls. commit 1080cd900bc4c22a31d03cfd03ab7e4f7d054464 Merge: cb1b743e59 b22bb4d75f Author: Thaddeus Crews Date: Tue Dec 3 14:40:48 2024 -0600 Merge pull request #99480 from Mickeon/doc-help-external-link-icon Improve appearance of external links in built-in docs commit cb1b743e59e0c90303b119602ce7343598fc195a Merge: 330c01458c 8dd330dee7 Author: Thaddeus Crews Date: Tue Dec 3 14:40:47 2024 -0600 Merge pull request #99861 from Ryan-000/Fix-language-server-thread-crash Fix language server causing random crashes when `use_threads` is enabled commit 330c01458c52a6ed32f16c1065976ceaba4d3e13 Merge: 781c6a82b0 6a331dafe1 Author: Thaddeus Crews Date: Tue Dec 3 14:40:46 2024 -0600 Merge pull request #99595 from bruvzg/win_fd_index Fix native file dialog filter selection in save dialogs. commit 781c6a82b019948dcc58ae1f79d51d4aba0d81c5 Merge: 6478f296bc 35bb827d10 Author: Thaddeus Crews Date: Tue Dec 3 14:40:45 2024 -0600 Merge pull request #99847 from demolke/editorpaths Destroy EditorFilesystem/EditorSettings on test shutdown commit 6478f296bcd704658c7db8555cc447aa73909a33 Merge: 8d2db6c468 627d10e4c4 Author: Thaddeus Crews Date: Tue Dec 3 14:40:44 2024 -0600 Merge pull request #99720 from mrsaturnsan/mac_vsync_fix Fix vsync on macOS getting disabled when using `afterMinimumDuration` commit 8d2db6c46886940a5caa65b610be1184409887f7 Merge: 42eb4fbc07 4e08e5724e Author: Thaddeus Crews Date: Tue Dec 3 14:40:43 2024 -0600 Merge pull request #98568 from Nova840/master Fix run instances dialog scaling bug commit 42eb4fbc07fca2d6e79df48fa006d4761499cb23 Merge: 70ff57b5f3 707f1038c3 Author: Thaddeus Crews Date: Tue Dec 3 14:40:42 2024 -0600 Merge pull request #93831 from what-is-a-git/wav-runtime Add runtime file loading to `AudioStreamWAV` commit 70ff57b5f35de38edb87ae36649282d040c348bc Merge: 27ae2f27ae 34a19f07a4 Author: Thaddeus Crews Date: Tue Dec 3 14:40:41 2024 -0600 Merge pull request #99716 from DarioSamo/material-dirty-updates Restore dirty list for BaseMaterial3D but don't use it on resource loader. commit 27ae2f27aeb0755263e7435f5c243682dd7dcb13 Merge: 0f20e67d8d c3080e3378 Author: Thaddeus Crews Date: Tue Dec 3 14:40:40 2024 -0600 Merge pull request #99969 from lander-vr/Clean-up-UI-of-VoxelGI Adjust VoxelGI gizmo opacity commit 08a8f430f429449c953adfcaf8010eee52bfd7ea Author: MewPurPur Date: Tue Dec 3 22:03:53 2024 +0200 Codestyle improvements in style_box_flat.cpp commit 274064ae7f4407977147b3d0c873f5ce04424421 Author: hakro Date: Tue Dec 3 20:06:34 2024 +0100 Ignore custom tooltip if its text is empty in signals tab commit fa7615be9e1627734565500690b34701d587e247 Author: Dario Date: Tue Dec 3 12:59:56 2024 -0300 Add specialization for directional light split blend and fog. commit c3080e33784bcad80f39017fbe7d4bf68c7bdfa6 Author: landervr <31851431+CpnWaffle@users.noreply.github.com> Date: Tue Dec 3 17:00:40 2024 +0100 Adjust VoxelGI gizmo opacity commit df2c2ca3c32468d73137eff82fa6861b4e97ae3d Author: Pablo Andres Fuente Date: Tue Dec 3 00:12:52 2024 -0300 Fix TCPServer "Should disconnect client" test "Should disconnect client" test was failing randomly on Mac CI tests, so this PR is making it more reliable reading on the closed client instead of writing to it commit 84650f20181ad73f52f7d8faaa251656b1c54870 Author: Pāvels Nadtočajevs <7645683+bruvzg@users.noreply.github.com> Date: Sun Nov 17 22:40:39 2024 +0200 Implement `DisplayServer.beep`. commit d5e599f77e92adf41db423763aa18b34526ea708 Author: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Mon Nov 4 11:50:42 2024 +0200 [macOS] Handle bundles as files in the embedded file dialogs. commit 8ca1605bbbb865befc0ce1de99c1e21e53e155c5 Author: Stayd Date: Tue Dec 3 02:34:33 2024 -0700 Fix default preview environment sky. Fixes the horizon color being grey even when both the sky and ground colors are set to black, and makes the energy slider affect both hemispheres rather than only affecting the top "sky" portion. commit 707f1038c3f9476f8e115bc091733851e8150980 Author: what-is-a-git <138817584+what-is-a-git@users.noreply.github.com> Date: Mon Nov 11 12:55:57 2024 -0500 Add runtime file loading to AudioStreamWAV commit 4db9c112ff3626cce5d42a9d7090f217090709d9 Author: Hugo Locurcio Date: Sat Nov 16 18:00:42 2024 +0100 Add a code sample that extracts all files to ZIPReader documentation Tested with various ZIP files found on the web, with a single root folder or multiple files at its root. Co-authored-by: Raul Santos commit 6960b33cbbbd372a7bce482f35c9136acee710a0 Author: Florent Guiocheau Date: Mon Dec 2 17:05:50 2024 +0100 Fix occlusion culling jitter commit 7caa03918347442dd76c3857099ef57a63f104d1 Author: Stuart Carnie Date: Mon Dec 2 06:23:58 2024 +1100 Metal: Ensure `texture_create_from_extension` returns correct pixel format commit 35bb827d1026df273eb43004805a8e84f55d31b5 Author: demolke Date: Fri Nov 29 21:22:49 2024 +0100 Destroy EditorFilesystem/EditorSettings on test shutdown Otherwise asan complains if a test tries to use these. Split off from https://github.com/godotengine/godot/pull/98909 commit 1b3e4838991aa2431266b8f0240f207a9f508b6b Author: Adam Scott Date: Mon Oct 21 15:02:08 2024 -0400 Add file and dir temporary utilities Co-authored by @Alex2782 for the Android bindings. Many thanks to the reviewers also. Co-authored-by: Alex commit 4e08e5724e554d973856b608ab8001e6b0e9dbbd Author: Nova840 Date: Sat Oct 26 19:28:30 2024 -0400 Fix run instances dialog scaling bug commit 4b23e504e8afa623329d00206767dd0a15ee6bad Author: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Fri Oct 11 09:13:56 2024 +0300 [RTL] Keep tag stack between `append_text` calls. commit 6a331dafe131dcc110fc259a51b5eef2eeb78414 Author: Pāvels Nadtočajevs <7645683+bruvzg@users.noreply.github.com> Date: Sat Nov 23 20:33:58 2024 +0200 Fix native file dialog filter selection in save dialogs. commit f767cf00fdfbc76c23d45bcdd997aa70b39a9fb7 Author: Anish Mishra Date: Mon Dec 2 11:55:19 2024 +0530 Android: Make monochrome icon optional commit 7f64f230a7c08fc3d1ad380256f03cb78970b660 Author: Anish Mishra Date: Sat Nov 16 14:27:05 2024 +0530 Android: Set FileDialog default Filesystem root commit c5ca56f40bb03d4072bd3a4c0bcdda9e9bffd89d Author: Pāvels Nadtočajevs <7645683+bruvzg@users.noreply.github.com> Date: Wed Nov 13 08:03:40 2024 +0200 [Export] Write text server data from memory, instead of using temporary file. commit 0f20e67d8de83c30b5dd79cb68d12d4cf613065d Merge: 9f36f3b573 f5648ac9c9 Author: Rémi Verschelde Date: Mon Dec 2 17:20:46 2024 +0100 Merge pull request #99900 from BlueCube3310/betsy-doc-update Betsy: Update docs to reflect BC3 and BC5 commit 9f36f3b5737c7ca656ef3f3b9c74bb44d3f8ab71 Merge: e60b18493d 95401f0753 Author: Rémi Verschelde Date: Mon Dec 2 17:20:43 2024 +0100 Merge pull request #99753 from Faless/ws/clarify_connect_noblock [WebSocket] Clarify that `connect_to_url` is non-blocking commit e60b18493d5e5155d76b0ed2e0b5a877ce2ca864 Merge: 0c4ad02e6d 5a48e527b2 Author: Rémi Verschelde Date: Mon Dec 2 17:20:39 2024 +0100 Merge pull request #99704 from Chaosus/shader_pp_fix_orphan_strings Fix orphan strings in shader preprocessor commit 0c4ad02e6d858f4802e1e29eef0618152b83c2df Merge: e78ad1dfca 2210dd1126 Author: Rémi Verschelde Date: Mon Dec 2 17:20:35 2024 +0100 Merge pull request #99668 from bruvzg/rtl_rn_notes [RTL] Parse "\r\n" as a single paragraph break, add some documentation notes. commit e78ad1dfca5ffba2115d6d296b7c3acc2c550bde Merge: aab12fd273 a2b8b51097 Author: Rémi Verschelde Date: Mon Dec 2 17:20:31 2024 +0100 Merge pull request #99665 from bruvzg/rtl_clean [RTL] Fix clearing text with `set_text("")`. commit aab12fd2734909fccf707a9e25dcd9ca2b177e50 Merge: 60e1490df1 e0b4f3d314 Author: Rémi Verschelde Date: Mon Dec 2 17:20:27 2024 +0100 Merge pull request #99652 from bruvzg/fd_cd_win [Windows] Fix root and current folder in native file dialog. commit 60e1490df1af725818c348e2d37a267a4473aff8 Merge: bb09a6f061 1d43fa9a64 Author: Rémi Verschelde Date: Mon Dec 2 17:20:23 2024 +0100 Merge pull request #99644 from bruvzg/fd_all_name Change file dialog all files filter name from `All Files (*)` to `All Files (*.*)`. commit bb09a6f061472f3d846f24e37a4ea1281058dda1 Merge: 5836a24a1c b248d66265 Author: Rémi Verschelde Date: Mon Dec 2 17:20:19 2024 +0100 Merge pull request #99642 from bruvzg/mac_win_tile [macOS] Use native window drag for the custom editor title bars. commit 5836a24a1cee69f229a1155e54ea4bc962d5a2b3 Merge: 2dc30a4c39 0708048530 Author: Rémi Verschelde Date: Mon Dec 2 17:20:15 2024 +0100 Merge pull request #99488 from bruvzg/te_brk_cases [TextServer] Fix some line breaking edge cases. commit 2dc30a4c39a41f4137c44bb186700f6d40525297 Merge: fa264115ce d3e16c9ee2 Author: Rémi Verschelde Date: Mon Dec 2 17:20:11 2024 +0100 Merge pull request #99051 from bruvzg/ios_entitlements [iOS] Add options to specify additional entitlements and capabilities in the export settings. commit fa264115ceb515c899845856a3388b220bc2a539 Merge: 47f71f66c1 e81a2afbc4 Author: Rémi Verschelde Date: Mon Dec 2 17:20:07 2024 +0100 Merge pull request #98664 from bruvzg/ts_reset_subpixel_shift [TextServer] Reset subpixel shift on blank glyphs. commit 47f71f66c16e3d3450559c80433e0c7457826da2 Merge: f4c9392f1b bf9f78c353 Author: Rémi Verschelde Date: Mon Dec 2 17:20:02 2024 +0100 Merge pull request #98631 from bruvzg/fix_fs_restore [Windows] Fix restoring fullscreen window. commit f4c9392f1bd0b451feb507a510b0385b33ee6e6b Merge: 57e504ca42 db1c1d43e3 Author: Rémi Verschelde Date: Mon Dec 2 17:19:57 2024 +0100 Merge pull request #98608 from bruvzg/vlk_ver_check [Misc] Check for the available and installed Vulkan SDK versions before downloading and installing. commit 57e504ca42f5c53fc62bfd163889104b0c55fd65 Merge: 8f79640dc3 335b42d437 Author: Rémi Verschelde Date: Mon Dec 2 17:19:52 2024 +0100 Merge pull request #98582 from bruvzg/win_btn_count Remove button number limit from Windows `dialog_show()` implementation. commit 8f79640dc3be24065219c93845bd2b3409e70555 Merge: d741a646a5 41a1a7f94b Author: Rémi Verschelde Date: Mon Dec 2 17:19:47 2024 +0100 Merge pull request #95511 from bruvzg/btn_oversampling_reshape Reshape and update button on oversampling change. commit b22bb4d75f839f3c272e62270dde5e3d19caa70a Author: Micky Date: Wed Nov 20 20:08:07 2024 +0100 Improve appearance of external links in built-in docs commit dd33e877aab6d10ace431931354b6ef7e052a75a Author: Peter Date: Mon Dec 2 11:08:17 2024 -0500 strip trailing slashes in default project path commit 2210dd1126b85f51f26e061f4c9904885c115bc3 Author: Pāvels Nadtočajevs <7645683+bruvzg@users.noreply.github.com> Date: Mon Nov 25 11:05:23 2024 +0200 [RTL] Parse "\r\n" as a single paragraph break, add some documentation notes. commit b248d6626546e1c41953372cce943b6f566688f4 Author: Pāvels Nadtočajevs <7645683+bruvzg@users.noreply.github.com> Date: Sun Nov 24 19:27:08 2024 +0200 [macOS] Use native window drag for the custom editor title bars. commit d3e16c9ee2421aa3ba2e12bbd047241fc8b7deb4 Author: Pāvels Nadtočajevs <7645683+bruvzg@users.noreply.github.com> Date: Mon Nov 11 09:05:06 2024 +0200 [iOS] Add options to specify additional entitlements and capabilities in the export settings. commit 8dd330dee74deddac417efcfaa7c96c58785ccec Author: Ryan <73148864+Ryan-000@users.noreply.github.com> Date: Tue Nov 19 02:27:16 2024 -0500 Fix language server thread crash Co-Authored-By: Adam Scott Co-Authored-By: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> commit f5648ac9c91f6016a55e9ab4bec11797947653e8 Author: BlueCube3310 <53150244+BlueCube3310@users.noreply.github.com> Date: Sun Dec 1 18:07:42 2024 +0100 Betsy: Update docs to reflect BC3 and BC5 commit d741a646a5ee20e77c1d0d9d4fbfed03d7b8dcc3 Merge: eefd32ba16 7539a3a7cf Author: Rémi Verschelde Date: Mon Dec 2 15:52:25 2024 +0100 Merge pull request #99924 from Mickeon/documentation-no-implicit_static-typing-yet Remove uses of implicit static typing from the documentation commit eefd32ba16f01d3eeffd2ddb42076f86d584e98f Merge: 715a7bac00 e8f3bebb5d Author: Rémi Verschelde Date: Mon Dec 2 15:52:15 2024 +0100 Merge pull request #99915 from bruvzg/lbl_width [Label] Fix min. width commit 715a7bac007fca4f98fb4a9df11e1585fcbd4a36 Merge: c59f4be6fd 151dcf30ee Author: Rémi Verschelde Date: Mon Dec 2 15:52:11 2024 +0100 Merge pull request #99906 from bruvzg/lbl_empty_lines [Label] Fix empty paragraph height. commit c59f4be6fd55295b283acd3280a87a4402a8a238 Merge: 204ce5a29a 7c6f523747 Author: Rémi Verschelde Date: Mon Dec 2 15:52:08 2024 +0100 Merge pull request #99901 from adamscott/local_shape-fix Fix `GodotSpace3D::test_body_motion()` not setting `local_shape` commit 204ce5a29ad458e4befa3ccdc5f1efea10e29d37 Merge: 9babf66008 5baedb5826 Author: Rémi Verschelde Date: Mon Dec 2 15:52:04 2024 +0100 Merge pull request #99882 from vgezer/fixcolorpicker Add horizontal center for ColorPicker buttons commit 9babf66008130b2bdb7e6349db4107bc07c5a7c5 Merge: acdffd0a14 b045523d58 Author: Rémi Verschelde Date: Mon Dec 2 15:52:00 2024 +0100 Merge pull request #99879 from Lielay9/missing-sharp-corner_getter Add missing getter for sharp window corners. commit acdffd0a14826d865ca4dcea713c130c1cabd078 Merge: e3bb8f3593 ba992ed22f Author: Rémi Verschelde Date: Mon Dec 2 15:51:56 2024 +0100 Merge pull request #99864 from HuntJSparra/server-features-regression Fix `OS::has_feature()` skipping custom features commit e3bb8f3593ff8dfea65a954c09b7dd5dc332077a Merge: 6c01b739b0 88c11a1753 Author: Rémi Verschelde Date: Mon Dec 2 15:51:52 2024 +0100 Merge pull request #99846 from demolke/editornode Check if EditorNode exists before trying to generate preview commit 6c01b739b06c930371477f5adcf235e0df647e97 Merge: d7515dddaa 4b735d9fb2 Author: Rémi Verschelde Date: Mon Dec 2 15:51:48 2024 +0100 Merge pull request #99822 from havi05/lineedit-shortcuts Allow copy/select shortcuts when `editable` is false in `LineEdit` commit d7515dddaa5b86518ae56ace388476f6473685dd Merge: ca1440fafb a47d29cf11 Author: Rémi Verschelde Date: Mon Dec 2 15:51:43 2024 +0100 Merge pull request #99815 from Ivorforce/string-name-not-equal-inline Move StringName `!=` operator to the header file to make it inlineable. commit ca1440fafb3dcf7f31adb2b3425a4f62fbab1325 Merge: ab54ba92a4 99cbcd250a Author: Rémi Verschelde Date: Mon Dec 2 15:51:38 2024 +0100 Merge pull request #99759 from Mickeon/audio-stream-player-3d-seek-fix-for-real Fix AudioStreamPlayer2D/3D's `get_playback_position` returning `0` right after calling `seek` commit ab54ba92a46ec00749dfa39717d2fee69eaff4fb Merge: 4a887ceffd f511ef26f1 Author: Rémi Verschelde Date: Mon Dec 2 15:51:34 2024 +0100 Merge pull request #99752 from Faless/mp/fix_offlfine_mp_docs [MP] Move OfflineMultiplayerPeer docs to the module commit 4a887ceffd18dd74c25152b2fdfb7d5a5b77073d Merge: 90087476a3 34c7528d3d Author: Rémi Verschelde Date: Mon Dec 2 15:51:29 2024 +0100 Merge pull request #99736 from Bossdell113/gdellProject Add C# examples to PropertyTweener docs commit 90087476a350732eb2e9937f66dd8d19005ca0f2 Merge: 2f4f2e26a1 b2e40829a8 Author: Rémi Verschelde Date: Mon Dec 2 15:51:25 2024 +0100 Merge pull request #99726 from smix8/path_simply_test Add test for NavigationServer path simplification commit 2f4f2e26a13b87fb12523b4998cd8ecc3ebcc8ef Merge: 302da3d9a4 47788673ef Author: Rémi Verschelde Date: Mon Dec 2 15:51:20 2024 +0100 Merge pull request #99708 from Giganzo/rtl-slider Fix RTL visuals for sliders commit 302da3d9a475dd0df09d7dbf53c2012258c17e8d Merge: 200bb202ba c699d5bada Author: Rémi Verschelde Date: Mon Dec 2 15:51:16 2024 +0100 Merge pull request #99669 from syntaxerror247/root_window_issues Fix root window size bug on `Android` commit 200bb202baeec12544b36d5421bc838d8c511101 Merge: 1fed9cf01f dc71fbacc5 Author: Rémi Verschelde Date: Mon Dec 2 15:51:12 2024 +0100 Merge pull request #99481 from bruvzg/meta_tooltip [RTL] Add tooltip support to meta/url tag. commit 1fed9cf01f2435d7562d4e909467aba7330c4529 Merge: 101b7414d2 ed7b4f5c4a Author: Rémi Verschelde Date: Mon Dec 2 15:51:07 2024 +0100 Merge pull request #99110 from bruvzg/gnome_fd [Linux] Use safe IDs for native file dialog options. Show extensions in export dialog. commit 101b7414d28cfdc273bd1b8e076fa8d44bf3a963 Merge: a702b69ce7 c363e13051 Author: Rémi Verschelde Date: Mon Dec 2 15:51:02 2024 +0100 Merge pull request #99036 from bruvzg/propkey_rename [Windows] Rename `PKEY_Device_FriendlyName` to avoid duplicate symbols with newer MinGW SDKs. commit a702b69ce75b5da0a3eef94c2a01547ceda97b8d Merge: b3ca2e1cfa 6445b6cbdd Author: Rémi Verschelde Date: Mon Dec 2 15:50:57 2024 +0100 Merge pull request #98917 from syntaxerror247/immersive-mode-issue Android: Fix immersive mode issue commit b3ca2e1cfa8852b9678b179207860a573d74098d Merge: d05323793f 5da3e81640 Author: Rémi Verschelde Date: Mon Dec 2 15:50:52 2024 +0100 Merge pull request #98914 from fuzzybinary/gdextension-editor-settings Support extension icons in ScriptCreateDialog commit d05323793f4231fb2a4072644d8cd783bf9d5d6d Merge: e6125ef51b 81a7a2c50c Author: Rémi Verschelde Date: Mon Dec 2 15:50:48 2024 +0100 Merge pull request #98778 from jaydensipe/add-copy-to-toast Add copy button to toast notification commit e6125ef51b348898bfd91aab3431a971149abffa Merge: cebf2130ca af56d6e8e8 Author: Rémi Verschelde Date: Mon Dec 2 15:50:44 2024 +0100 Merge pull request #98763 from AThousandShips/more_sname_uses Use `SceneStringName` in more places commit cebf2130ca650b94951ce7db8f6dd16c06d822aa Merge: 872681c5ee 141737d168 Author: Rémi Verschelde Date: Mon Dec 2 15:50:40 2024 +0100 Merge pull request #98744 from tetrapod00/rendering-method-driver-backend Docs: Standardize names and terms for renderers commit 872681c5ee49a5e46af06ee10e3237036eac7600 Merge: ed93ab2f53 2506742013 Author: Rémi Verschelde Date: Mon Dec 2 15:50:36 2024 +0100 Merge pull request #98739 from bruvzg/exp_dup [Editor] Copy encryption and script settings on export preset duplication. commit ed93ab2f5343dc7d2598eb0b488f1203f416902a Merge: 702f567138 e6eeaf28df Author: Rémi Verschelde Date: Mon Dec 2 15:50:31 2024 +0100 Merge pull request #98657 from ydeltastar/stay-sane-using-evaluator Add editor setting to stop the bottom panel from switching to the Stack Trace commit 702f567138cff4c0145cc84bb6070f8932859397 Merge: d6b20fd7e5 ba943e4481 Author: Rémi Verschelde Date: Mon Dec 2 15:50:26 2024 +0100 Merge pull request #98533 from dalexeev/adjust-make-rst-for-gds Adjust `make_rst.py` for GDScript documentation commit d6b20fd7e5f888ad472c20e9f919558e07c9cdc5 Merge: 463c479ac8 366fa9ff39 Author: Rémi Verschelde Date: Mon Dec 2 15:50:22 2024 +0100 Merge pull request #98402 from vaner-org/highlight-node-neighbours Reduce opacity of nodes with no shared transition when selecting an AnimationNodeStateMachine node commit 463c479ac89ebadb78f93b1b0fd4b34ca1749afe Merge: 7f3a8d0b1b c5199a5017 Author: Rémi Verschelde Date: Mon Dec 2 15:50:17 2024 +0100 Merge pull request #98401 from vaner-org/green-arrow-priority-for-transition-selection Prioritize proximity to green arrow when selecting overlapping transitions in AnimationNodeStateMachine commit 7f3a8d0b1ba49d0d9b43997341814f6f55077d27 Merge: d2c82a8ffc 4f17a7428b Author: Rémi Verschelde Date: Mon Dec 2 15:50:11 2024 +0100 Merge pull request #97928 from kiroxas/navImprovement Improve `NavMeshQueries3D::polygons_get_closest_point_info` performance commit d2c82a8ffcda692f13b3edbff1ca59b03dddf4b9 Merge: 6f86cec1fb d58b2e879f Author: Rémi Verschelde Date: Mon Dec 2 15:50:06 2024 +0100 Merge pull request #97378 from rune-scape/less-const-cast Get rid of easily removable uses of `const_cast` commit 6f86cec1fbe6de3f2bbf978a9b82b9ba0e6ae98d Merge: 14ce5ba8a1 77549dd1f3 Author: Rémi Verschelde Date: Mon Dec 2 15:50:02 2024 +0100 Merge pull request #97158 from AThousandShips/tree_tooltip_improve [Tree] Allow disabling auto generated tooltip for `TreeItem` commit 14ce5ba8a1c8680888c4a794561536f5790f91b7 Merge: 6b90d24c5c d9ef826c54 Author: Rémi Verschelde Date: Mon Dec 2 15:49:58 2024 +0100 Merge pull request #94368 from CrazyRoka/optimize-render-pass-uniform-set Optimize `RenderForwardClustered::_setup_render_pass_uniform_set` by reducing Vector allocations commit 6b90d24c5c3e87ce0ed763dbb6f70fd682066604 Merge: 867806954f 16ee2f22eb Author: Rémi Verschelde Date: Mon Dec 2 15:49:54 2024 +0100 Merge pull request #93819 from Carbonyte/check-device-limits Check device texture size limits in `RenderingDevice::texture_create` commit 867806954f0612204977a5e21d0f731387a4e070 Merge: 893bbdfde8 0339032969 Author: Rémi Verschelde Date: Mon Dec 2 15:49:45 2024 +0100 Merge pull request #73973 from dalexeev/fix-regex-sub RegEx: Fix handling of unset/unknown capture groups commit 7539a3a7cf058c084ae0c0d3ee5111b0fc73c807 Author: Micky Date: Mon Dec 2 15:40:42 2024 +0100 Remove uses of implicit static typing from the documentation commit 2b39314461576be071d15ffc0ae18ca1c92fc088 Author: Lukas Tenbrink Date: Fri Nov 29 02:06:35 2024 +0100 Abstract the implementation of 3 ustring string length checks with strlen, adding an implementation for char32_t. commit d9ef826c545e7d623279c312ca837b947a4989b3 Author: CrazyRoka Date: Sun Jul 14 22:13:57 2024 +0100 Optimize RenderForwardClustered::_setup_render_pass_uniform_set by reducing Vector allocations during push_back operations commit af56d6e8e88e56110577f3bbcfa2eb5cdcc71356 Author: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Date: Sat Nov 2 16:15:39 2024 +0100 Use `SceneStringName` in more places commit 34c7528d3d6103f086c0c0b2b23e4e8f1b3a364e Author: Bossdell113 Date: Tue Nov 26 20:06:24 2024 -0500 Add C# examples to PropertyTweener docs Co-Authored-By: tetrapod <145553014+tetrapod00@users.noreply.github.com> commit c699d5badad3ae03721cd79678ad0c962ba07886 Author: Anish Mishra Date: Mon Nov 25 14:42:49 2024 +0530 Fix root window size bug on Android commit 16ee2f22ebcee95e0263bc00a1b785f425f8e5b3 Author: Joshua Staub <18756667+Carbonyte@users.noreply.github.com> Date: Sun Jun 30 16:57:53 2024 -0400 Check device texture size limits in RenderingDevice::texture_create commit dc71fbacc5546fb08aaef6895b8811646dc817e7 Author: Pāvels Nadtočajevs <7645683+bruvzg@users.noreply.github.com> Date: Wed Nov 20 21:49:01 2024 +0200 [RTL] Add tooltip support to meta/url tag. commit 95ca0aa7ad616b2fdcfaf5b57411ec4e5e59cab3 Author: JekSun97 Date: Sat Nov 23 04:59:38 2024 +0600 Add get_connetion_count function to GraphEdit commit d97313cd7d3cad6863c63dcfd52701fcec23b1e6 Author: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Mon Dec 2 12:03:28 2024 +0200 [FileAccess] Set `last_error` on file read/write errors. commit a694cd7120c110d9965df582de4739024ee9fae4 Author: landervr <31851431+CpnWaffle@users.noreply.github.com> Date: Mon Dec 2 11:52:11 2024 +0100 Clean up UI of ReflectionProbe commit e8f3bebb5dd2438111ddf7cecb612a285330a8f9 Author: Pāvels Nadtočajevs <7645683+bruvzg@users.noreply.github.com> Date: Mon Dec 2 07:57:00 2024 +0200 [Label] Fix min. width commit 5da3e816404708b22b4a66796c7371d2d6b5853f Author: Jeff Ward Date: Wed Nov 6 20:21:51 2024 -0500 Support extension icons in ScriptCreateDialog Attempt to grab the icon for a script type from the theme first, then ask the extension for the icon. commit d58b2e879ffae3b9b9038322ec5b6ccd8a5bc613 Author: rune-scape Date: Mon Jul 29 21:23:12 2024 -0700 Get rid of easily removable uses of const_cast commit 151dcf30eee19f64d232d438be001e418161d118 Author: Pāvels Nadtočajevs <7645683+bruvzg@users.noreply.github.com> Date: Sun Dec 1 21:53:07 2024 +0200 [Label] Fix empty paragraph height. commit a47d29cf11cfe43137cff04aceec2941c95f947b Author: Lukas Tenbrink Date: Fri Nov 29 01:06:01 2024 +0100 Move StringName != to the header file to make it inlineable. commit 7c6f523747c2a90a4711d84a9a5af89af0a155fe Author: Adam Scott Date: Sun Dec 1 13:03:23 2024 -0500 Fix `GodotSpace3D::test_body_motion()` not setting `local_shape` commit 77549dd1f3727e92d6826df78d89797a6aac2fdd Author: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Date: Wed Sep 18 20:50:14 2024 +0200 [Tree] Allow disabling auto generated tooltip for `TreeItem` commit 366fa9ff39c7d353c4bd1872afc7f0333b0c97dd Author: lullabyist Date: Mon Oct 21 19:43:52 2024 +0530 Reduce opacity of nodes with no shared transition when selecting an AnimationNodeStateMachine node Applied suggestions from code review commit c5199a50171a523c0d4fbc87cdf1abe0e808b864 Author: lullabyist Date: Tue Oct 22 04:46:59 2024 +0530 Prioritize proximity to green arrow when selecting overlapping transitions in AnimationNodeStateMachine Applied suggestions from code review commit 83d4bde0a25091f524dc2c75f878e21d84caf958 Author: Kiro Date: Fri Nov 29 14:35:02 2024 +0100 When calling code has length of string, pass it to parse_utf8 commit 81a7a2c50c6bb5930b6ea8aeb03c924f0b9b5479 Author: Jayden Sipe Date: Sat Nov 2 00:02:36 2024 -0400 Add copy to toast notification commit 5baedb582666c9b99573a8a81da1435823f63df1 Author: Volkan Gezer Date: Sat Nov 30 19:50:53 2024 +0100 add horizontal center for colorpicker buttons commit b045523d58922e73ab4b762d6defe3ef1e459a5a Author: Hei <40064911+Lielay9@users.noreply.github.com> Date: Sat Nov 30 19:10:56 2024 +0200 Add the missing getter for sharp window corners commit 0339032969c3449ef85092630bf67d8bdc6f2766 Author: Danil Alexeev Date: Fri Nov 29 18:49:19 2024 +0300 RegEx: Fix handling of unset/unknown capture groups commit 4b735d9fb2b3dc95b4979f6843eace016bf56d65 Author: havi05 Date: Fri Nov 29 09:04:04 2024 +0100 LineEdit - Allow copy/select shortcuts when `editable==false` commit ba943e4481ac5615cf97a0c742d357d0f0e47b16 Author: Danil Alexeev Date: Sat Nov 30 11:48:14 2024 +0300 Adjust `make_rst.py` for GDScript documentation commit ba992ed22f310389d3e2301d4393bb898bf2728e Author: Hunt J. Sparra <19802403+HuntJSparra@users.noreply.github.com> Date: Fri Nov 29 23:34:52 2024 -0500 Fix early exit once has_server_feature_callback is set; remove server feature warning due to consistent "fallthrough" features (e.g., OS-specific features) commit 141737d168fa984fc410495e38ee308e8cd5c6a2 Author: tetrapod00 <145553014+tetrapod00@users.noreply.github.com> Date: Thu Oct 24 20:59:05 2024 -0700 Docs: Standardize names and terms for renderers commit 893bbdfde8ad1f94fb4e6db246ff7075569396ea Merge: 682c5c7d49 a51c60f5e3 Author: Rémi Verschelde Date: Sat Nov 30 01:28:22 2024 +0100 Merge pull request #99859 from akien-mga/revert-99825 Revert "basis_universal: Make tinyexr dependency explicit" commit a51c60f5e381c4f06a4188ae437b08215c09e4cb Author: Rémi Verschelde Date: Sat Nov 30 01:25:53 2024 +0100 Revert "basis_universal: Make tinyexr dependency explicit" This reverts commit 220f2611cc19d2d4bd46050e55f5368c044dbb9b. commit 682c5c7d49d22ea45d6996d6a4bdde53cad348c6 Author: Rémi Verschelde Date: Fri Nov 29 23:10:02 2024 +0100 GDScript: Fix failing tests due to collision with #99490 formatting change commit 16ee94a9534e21fa551cf71bbf835c53f4c1afa9 Merge: 31edb7ea3b e0304a7d00 Author: Rémi Verschelde Date: Fri Nov 29 22:51:45 2024 +0100 Merge pull request #99843 from KoBeWi/easy_windows Add helper method to get Window from ID commit 31edb7ea3b7fad52f37edad2757538659ddedb0e Merge: 1745fe15a4 e499563faf Author: Rémi Verschelde Date: Fri Nov 29 22:51:41 2024 +0100 Merge pull request #99841 from Calinou/doc-basematerial3d-billboard-mode-remove-outdated-note Remove outdated note about `BaseMaterial3D.billboard_mode` shadow issue commit 1745fe15a4b1827f8ef7febb8215b03c94e9d399 Merge: f6afacb185 e30da67ce9 Author: Rémi Verschelde Date: Fri Nov 29 22:51:38 2024 +0100 Merge pull request #99837 from thiagola92/docs_window_files_dropped Docs: update example from Window signal files_dropped commit f6afacb185a58d2efe9212a98007fb44ab812a6f Merge: 5125b66871 b57ceefec1 Author: Rémi Verschelde Date: Fri Nov 29 22:51:35 2024 +0100 Merge pull request #99833 from Faless/fix/sleepy_windows_becomes_a_heater [Windows] Improve frame pacing by busy waiting as needed commit 5125b668717888fed432e269dfc6807cc97e8f02 Merge: bce340b31a 72be8d1b69 Author: Rémi Verschelde Date: Fri Nov 29 22:51:31 2024 +0100 Merge pull request #99827 from syntaxerror247/patch-1 Update `use_system_accent_color` note in EditorSettings commit bce340b31aa88ee1dea8ee3bdc780b7f46342ecd Merge: 82311791db 220f2611cc Author: Rémi Verschelde Date: Fri Nov 29 22:51:27 2024 +0100 Merge pull request #99825 from gio3k/fix/basisu_tinyexr_dep basis_universal: Make tinyexr dependency explicit commit 82311791db30934bddb5a0f42c7f0b8d6838fa40 Merge: 60c6c4a1da 11225de197 Author: Rémi Verschelde Date: Fri Nov 29 22:51:24 2024 +0100 Merge pull request #99802 from lander-vr/reflection-probe-wireframe Fix ReflectionProbe AABB commit 60c6c4a1da30b4c9fc2fe55c094b870d36154e2e Merge: 9048776457 5d70208da4 Author: Rémi Verschelde Date: Fri Nov 29 22:51:20 2024 +0100 Merge pull request #99795 from YeldhamDev/selection_menu_for_all! Make the alt selection menu available for all modes commit 90487764577ab055fefc3fcc66c0d2720ce57892 Merge: cf165a1d29 54945c4d28 Author: Rémi Verschelde Date: Fri Nov 29 22:51:17 2024 +0100 Merge pull request #99751 from bruvzg/dir_init Add `std::initializer_list` constructor for Dictionary. commit cf165a1d2999b29f6a971070ed7ad82c1e4eb2f2 Merge: 05e93a6010 8793764ba6 Author: Rémi Verschelde Date: Fri Nov 29 22:51:14 2024 +0100 Merge pull request #99739 from ydeltastar/fix-default-environment Fix default `Environment` project setting and loading commit 05e93a6010f381e433baef36947ff2000e30e573 Merge: e4ee8a3b32 003647972f Author: Rémi Verschelde Date: Fri Nov 29 22:51:10 2024 +0100 Merge pull request #99691 from Sauermann/fix-consume-mouse-over Rename `SubViewportContainer` option `consume_drag_and_drop` to `mouse_target` commit e4ee8a3b3209d3b974ac2b112104a215a2fdfbbf Merge: 74db6a1acc 84f4178850 Author: Rémi Verschelde Date: Fri Nov 29 22:51:06 2024 +0100 Merge pull request #99611 from bruno-brant/patch-1 Fix missing sign in ease function curve description commit 74db6a1acc67c14ccf08d734dcb7839762be1b4b Merge: d79a9d4d5e 6c38824d03 Author: Rémi Verschelde Date: Fri Nov 29 22:51:02 2024 +0100 Merge pull request #99584 from arkology/radial-center-offset-bounds Document `radial_center_offset` bounds for `TextureProgressBar` commit d79a9d4d5ee211ad2d5eb46a74e0f70289727cea Merge: 4b0f1781cc b862a394f4 Author: Rémi Verschelde Date: Fri Nov 29 22:50:59 2024 +0100 Merge pull request #99550 from kitbdev/add-dock-menu-tooltips Add tooltips to dock menu and remove disabled items commit 4b0f1781cc84220e51c83c10fe49ead22bf4f653 Merge: 689c789ab3 f57fea0b0f Author: Rémi Verschelde Date: Fri Nov 29 22:50:55 2024 +0100 Merge pull request #99401 from Black-Cat/viewport-gizmos Enable editing of controls inside viewports in editor commit 689c789ab34dc71effa9460193b9ca8c252595d1 Merge: f37fd1c3f2 f37c72fcdc Author: Rémi Verschelde Date: Fri Nov 29 22:50:51 2024 +0100 Merge pull request #99393 from badsectoracula/update-gridmap-editor-cursel-transform Update gridmap editor nodes when the gridmap node transform changes commit f37fd1c3f24340e14088b041ef9fb7b7534167fb Merge: 778723d935 d683ea4772 Author: Rémi Verschelde Date: Fri Nov 29 22:47:11 2024 +0100 Merge pull request #99238 from Calinou/doc-node2d-no-z-index Update Z Index property location in Node2D class reference commit 778723d935eab4496b7a2d5668d92edbcc8808f0 Merge: 04882d73bb 279dce3d2d Author: Rémi Verschelde Date: Fri Nov 29 22:47:06 2024 +0100 Merge pull request #99204 from berarma/patch-1 Clarify documentation for TileSetAtlasSource `texture_region_size` commit 04882d73bb876ab554c6c3c6e9f1a83c2e86c220 Merge: 4aed2b7981 5769c80196 Author: Rémi Verschelde Date: Fri Nov 29 22:47:02 2024 +0100 Merge pull request #99113 from MewPurPur/tweak-debugger-sizings Add minimum size to some debugger elements commit 4aed2b79819c4913b39442b005f38269812bd32a Merge: c2f19e98bc 3e8a24d0da Author: Rémi Verschelde Date: Fri Nov 29 22:46:58 2024 +0100 Merge pull request #99086 from Calinou/editor-visual-profiler-show-hardware-info Display CPU and GPU model name in the editor visual profiler commit c2f19e98bc7f6561ec311250def4f23f759113c4 Merge: 6edeea98e0 a5f86ee07e Author: Rémi Verschelde Date: Fri Nov 29 22:46:54 2024 +0100 Merge pull request #98921 from RandomShaper/win_many_files Raise the number of file handles on Windows commit 6edeea98e03882a2184ed2aee7f18863e6148e26 Merge: f668ecb875 4089a6cb8c Author: Rémi Verschelde Date: Fri Nov 29 22:46:50 2024 +0100 Merge pull request #98770 from Rudolph-B/Issue-94638 Fix occlusion culling for double builds by enforcing float conversion for Embree. commit f668ecb875a74bc4c1faefa2bedb8a72a361454a Merge: 5e87bdae74 8f5b11ac25 Author: Rémi Verschelde Date: Fri Nov 29 22:46:46 2024 +0100 Merge pull request #98745 from yahkr/fix-unique-icon-text [Editor] Update SceneUniqueName button text for clarity commit 5e87bdae748d4d8b09b9e92c85e9a0dc36fab254 Merge: 7f5ffdf787 b329b4ab06 Author: Rémi Verschelde Date: Fri Nov 29 22:46:42 2024 +0100 Merge pull request #98605 from bruvzg/lbl_mult_para [Label] Handle text as multiple independent paragraphs. commit 7f5ffdf787329d6b08489c9d117f5ad50e7ace15 Merge: 680142984d cb94652c34 Author: Rémi Verschelde Date: Fri Nov 29 22:46:38 2024 +0100 Merge pull request #98541 from ydeltastar/zero-multi-fix Fix `MultiMesh` errors in editor and resource duplication commit 680142984de767727e27e54b727d9baaece3e4ce Merge: 506930063a 503574441e Author: Rémi Verschelde Date: Fri Nov 29 22:46:33 2024 +0100 Merge pull request #98450 from bruvzg/rtl_img_align [RTL] Allow setting image alignment as separate bbcode argument. commit 506930063ab588d3ae364c90aa54e350e84a2f28 Merge: bfa38e463c 4036270f8d Author: Rémi Verschelde Date: Fri Nov 29 22:46:29 2024 +0100 Merge pull request #98093 from zynga-jpetersen/jpetersen/ios_xcode_PROVISIONING_PROFILE_SPECIFIER_support Support for XCode 8+ feature `PROVISIONING_PROFILE_SPECIFIER` commit bfa38e463ce71efeb996772828137f84719958d1 Merge: 5d74c5370b 0542bccee0 Author: Rémi Verschelde Date: Fri Nov 29 22:46:18 2024 +0100 Merge pull request #98022 from vPumpking/editor_file_dialog_filter_master Unify filter feature and improve space management for EditorFileDialog commit 5d74c5370ba55f5eb0095748de7be854c6c485c3 Merge: 8d3fc48abf 7ed90a4f07 Author: Rémi Verschelde Date: Fri Nov 29 22:46:14 2024 +0100 Merge pull request #97963 from bruvzg/rtl_valign [RTL] Add support for vertical alignment. commit 8d3fc48abf5fa6448a0096c61fec348c06784e6a Merge: 5d9ffb7d1c 86ea0127a3 Author: Rémi Verschelde Date: Fri Nov 29 22:46:09 2024 +0100 Merge pull request #97521 from pafuent/enhance_scroll_container_focus Add a focus border on `ScrollContainer` commit 5d9ffb7d1cc749fe966bc6bd6a618db25040acd7 Merge: 32cf20c750 e5fada9cd1 Author: Rémi Verschelde Date: Fri Nov 29 22:46:05 2024 +0100 Merge pull request #97365 from aaronp64/vector_compose_input_defaults Keep existing `VectorCompose` input values when setting vector type commit 32cf20c7507dffa9717325f0838bd65f23bf605f Merge: 2669f19605 733797e71f Author: Rémi Verschelde Date: Fri Nov 29 22:46:01 2024 +0100 Merge pull request #97024 from tetrapod00/shader-create-comment Use double comments in shader template light functions commit 2669f1960535d7cb9f6983b59bbfbded76cdfc9e Merge: 05b80ae0a1 109bee08dd Author: Rémi Verschelde Date: Fri Nov 29 22:45:56 2024 +0100 Merge pull request #96782 from aaronfranke/blend-fix-rough-metallic-if-not-unpack Blend file import: Don't keep original files when not unpacking them commit 05b80ae0a1e95113d68fdd1acd2d3714ed4077d7 Merge: 6d4bb8fbda af92685445 Author: Rémi Verschelde Date: Fri Nov 29 22:45:51 2024 +0100 Merge pull request #96449 from Maran23/editor-help-scroll-fix Fix jumping to editor help does not scroll correctly sometimes commit 6d4bb8fbda3b5266ee90143b94aed6a665c2073c Merge: 6e72b159ca 5559075844 Author: Rémi Verschelde Date: Fri Nov 29 22:45:47 2024 +0100 Merge pull request #94721 from ckaiser/animation-blend-tree-tweaks Improve blend tree contrast/margins commit 6e72b159ca3e130292707ee7266d47e164ec82d8 Merge: abf9eb5903 9f8fec39f3 Author: Rémi Verschelde Date: Fri Nov 29 22:45:43 2024 +0100 Merge pull request #93301 from rune-scape/compiler-messages GDScript: Add error messages to some compilation errors commit abf9eb590376d528058bb6fc7921253bac959824 Merge: ab08876e5c dd1372b78e Author: Rémi Verschelde Date: Fri Nov 29 22:45:39 2024 +0100 Merge pull request #93285 from rune-scape/listen-for-changes More GUI nodes listening for texture changes commit ab08876e5ceb95f877b2ef9c54b21a1c1073908c Merge: 8de2abd075 f6ea6cdb67 Author: Rémi Verschelde Date: Fri Nov 29 22:45:35 2024 +0100 Merge pull request #89566 from AThousandShips/range_val_fix Fix some invalid `int` property ranges commit 8de2abd07503c6602cce7e24035eeb39591df364 Merge: a0a459ebd8 cd269b825f Author: Rémi Verschelde Date: Fri Nov 29 22:45:32 2024 +0100 Merge pull request #85789 from DevilboxGames/FileDialogCaseSensitivity Make `FileDialog` filtering case insensitive commit a0a459ebd8c152164e0d81cee959b63ee956edea Merge: b66c1d0a73 a4b17e7852 Author: Rémi Verschelde Date: Fri Nov 29 22:45:27 2024 +0100 Merge pull request #78289 from bruvzg/fo_write_errs [FileAccess] Return error codes from `store_*` methods. commit b66c1d0a7338c40d8e7b35a993e4555fd423cf3b Merge: 5d462ee4c5 c6492de27b Author: Rémi Verschelde Date: Fri Nov 29 22:45:24 2024 +0100 Merge pull request #76055 from reach-satori/plot_zoom Implement zooming and panning in the profiler commit 5d462ee4c5b45c7c2807ac8ac9c75e35a96b26b9 Merge: 56a7dba10b 6c65213487 Author: Rémi Verschelde Date: Fri Nov 29 22:45:19 2024 +0100 Merge pull request #67857 from anvilfolk/extended-curve Extend Curve to allow for domains outside of [0, 1]. commit 220f2611cc19d2d4bd46050e55f5368c044dbb9b Author: Gio Date: Fri Nov 29 16:45:10 2024 +0800 basis_universal: Make tinyexr dependency explicit commit a4b17e7852c99cdbf108c77fe407cb78ed08159c Author: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Thu Jun 15 21:21:43 2023 +0300 [FileAccess] Return error codes from `store_*` methods. commit 56a7dba10beacec50176723a5fae76d1614e75c1 Merge: 537c05bb71 88e81ee730 Author: Rémi Verschelde Date: Fri Nov 29 22:02:53 2024 +0100 Merge pull request #99799 from akien-mga/fix-typos Fix various typos and code style issues commit 537c05bb717490a58cdf2b3d9f9d20b90ed6fea3 Merge: b1d65e4ed8 e7e3a25c1e Author: Rémi Verschelde Date: Fri Nov 29 22:02:50 2024 +0100 Merge pull request #99787 from KoBeWi/nonempt_dialog Fix non-empty project folder confirmation dialog commit b1d65e4ed8dbf22122d19944175de568f16ffdac Merge: 84bf708638 884cbb5333 Author: Rémi Verschelde Date: Fri Nov 29 22:02:47 2024 +0100 Merge pull request #99777 from Ivorforce/string-strlen-repeat-calls String: Don't repeat calls to `strlen` in `split`, and make `splitter_length` const in `get_slice`. commit 84bf708638047eb10ed324c4526a97ff66ceabf9 Merge: d8ed5d0ba2 f53a220a72 Author: Rémi Verschelde Date: Fri Nov 29 22:02:43 2024 +0100 Merge pull request #99771 from Sauermann/fix-physics-hover-over-embedded-window Fix physics picking when hovering an embedded window commit d8ed5d0ba2b2341e601f3455deb597e751b85cfd Merge: 0b2b8f0a53 357679ceb8 Author: Rémi Verschelde Date: Fri Nov 29 22:02:40 2024 +0100 Merge pull request #99770 from Repiteo/ci/problem-matcher-expanded CI: Add explicit problem matchers commit 0b2b8f0a5357e36c9a403999198a76c7e0792b86 Merge: 7417a07904 5d111e852e Author: Rémi Verschelde Date: Fri Nov 29 22:02:37 2024 +0100 Merge pull request #99754 from kthang55/fix_follow_viewport Update CanvasLayer 'Follow Viewport' documentation to match its behavior commit 7417a07904923795dae6ec444ea6b5228e10faad Merge: 08b931b656 e515f593c2 Author: Rémi Verschelde Date: Fri Nov 29 22:02:33 2024 +0100 Merge pull request #99742 from timothyqiu/clear-guides Disable Clear Guides menu item when no guides exist commit 08b931b6564ba64839db20efecd244d8135bd1c6 Merge: dbb9c9937d 06bb9944d7 Author: Rémi Verschelde Date: Fri Nov 29 22:02:29 2024 +0100 Merge pull request #99734 from Mickeon/audio-stream-player-3d-seek-fix Fix code consistency between AudioStreamPlayer2D and AudioStreamPlayer3D commit dbb9c9937d121345c6279810aeed01d92a7d2cb2 Merge: c1fb342287 15bd2a9bc1 Author: Rémi Verschelde Date: Fri Nov 29 22:02:26 2024 +0100 Merge pull request #99685 from arkology/texture-progress-cross-plugin-friendly Show `TextureProgressBar` radial center cross only when editing the scene commit c1fb342287e05f21c417055c9e096c30b1b6113a Merge: ba488490fc 99886f3204 Author: Rémi Verschelde Date: Fri Nov 29 22:02:22 2024 +0100 Merge pull request #99664 from arkology/camera2d_double_is_editor_hint_check Remove double `is_editor_hint()` check inside `NOTIFICATION_READY` for `Camera2D` node commit ba488490fc6ed2e33dc2e19c0e36a4ebccefc5e0 Merge: 6f4cb10321 82bd7db275 Author: Rémi Verschelde Date: Fri Nov 29 22:02:18 2024 +0100 Merge pull request #99650 from Mickeon/documentation-transform-basis-quaternion-consistency Make Transform2D/3D, Basis, and Quaternion docs more consistent commit 6f4cb10321ddca046e86ac1186724d458d85d00a Merge: d14672863b ba5a3577a5 Author: Rémi Verschelde Date: Fri Nov 29 22:02:14 2024 +0100 Merge pull request #99646 from smix8/navmap_sync_dirty Make NavMap objects request sync only on demand commit d14672863b8ffa3d9fb1771c86d334f802702663 Merge: f4f6f5fb55 84bf1cc7ac Author: Rémi Verschelde Date: Fri Nov 29 22:02:10 2024 +0100 Merge pull request #99556 from ArchercatNEO/miniupnpc-include Fix broken includes when compiling with `builtin_miniupnpc=false` commit f4f6f5fb553d480f54ea09a4cbbb927aebf226f3 Merge: b3a44a5567 88ffe07de9 Author: Rémi Verschelde Date: Fri Nov 29 22:02:06 2024 +0100 Merge pull request #99537 from BlueCube3310/betsy-bc1-bc5 Betsy: Add BC3 and BC5 support commit b3a44a55674589a414a3d52713881dbba1768b0c Merge: bcb5f8377f f86dcd4e67 Author: Rémi Verschelde Date: Fri Nov 29 22:02:02 2024 +0100 Merge pull request #99490 from dalexeev/gds-tests-track-multiple-errors GDScript: Support tracking multiple analyzer and runtime errors in tests commit bcb5f8377f2816f8634816008354e6dbbef67467 Merge: a1365dcb12 f1f47c3a53 Author: Rémi Verschelde Date: Fri Nov 29 22:01:59 2024 +0100 Merge pull request #99125 from Flarkk/projection_tests Add tests for `Projection` commit a1365dcb12cd48ac3853994a0e09453dffaceb47 Merge: 94082a424b dafba55c69 Author: Rémi Verschelde Date: Fri Nov 29 22:01:55 2024 +0100 Merge pull request #98765 from Calinou/editor-bottom-panel-no-icon-tint Don't tint editor bottom panel icons when hovered or pressed commit 94082a424be5d48d8f858eaa2c13082bce6f1e55 Merge: 454deb7222 8a42e3d3ef Author: Rémi Verschelde Date: Fri Nov 29 22:01:51 2024 +0100 Merge pull request #97303 from cixil/fix-duplicate-signal-bug Avoid duplicating signals from scene instances into packed scenes commit 454deb722214c87205bf9b0e23e2908997d3e937 Merge: c814493e95 0c03db09f8 Author: Rémi Verschelde Date: Fri Nov 29 22:01:47 2024 +0100 Merge pull request #97262 from pafuent/adding_tcp_server_unit_tests Add unit tests for TCPServer commit c814493e95eecdbdb8b64ae78747f227e677ef59 Merge: 274fc9858c fda444bb01 Author: Rémi Verschelde Date: Fri Nov 29 22:01:44 2024 +0100 Merge pull request #94321 from fire/vsk-csg-manifold-update-4.3 Fix mesh corruption of CSG by using elalish/manifold commit 274fc9858c828d45ea877940727c6dbbabb3e2b4 Merge: 0eadbdb5d0 6ad82aba3b Author: Rémi Verschelde Date: Fri Nov 29 22:01:39 2024 +0100 Merge pull request #93503 from Geekotron/viewport_accept_cam_change_from_tool Allow tool scripts to alter transform of Node3DEditorViewport camera commit 279dce3d2d08ae46535fb440406e5e32b08128ce Author: Bernat Date: Wed Nov 13 22:58:44 2024 +0100 Clarify documentation for TileSetAtlasSource `texture_region_size` commit 88c11a1753f539bc4d1696394e766705e48da790 Author: demolke Date: Fri Nov 29 21:17:40 2024 +0100 Check if EditorNode exists EditorNode is a very heavy object that current test harness cannot create, so after https://github.com/godotengine/godot/pull/96544 editor import cannot be tested. Split off from https://github.com/godotengine/godot/pull/98909 commit e0304a7d00f718a17f2e6981118edd2ceda22637 Author: kobewi Date: Fri Nov 29 21:15:23 2024 +0100 Add helper method to get Window from ID commit e499563fafd48fa074eee7be2fb8cc5572ad1af0 Author: Hugo Locurcio Date: Fri Nov 29 19:57:11 2024 +0100 Remove outdated note about `BaseMaterial3D.billboard_mode` shadow issue The linked pull request was merged in Godot 4.3. commit 6ad82aba3bf6444982b31dd54964740ff1cc780b Author: Geekotron Date: Sun Jun 23 00:54:01 2024 -0600 Allow tool scripts to alter transform of Node3DEditorViewport camera commit 8a42e3d3eff8f8ef44d663cbe735c2bb05170cba Author: cixil Date: Sat Sep 21 19:28:55 2024 -0400 Avoid duplicating signals from scene instances into packed scenes commit 733797e71ff5707cf0a59ce4e7009d4de3f27732 Author: tetrapod00 <145553014+tetrapod00@users.noreply.github.com> Date: Sat Sep 14 16:13:18 2024 -0700 Use double comments in shader template light functions commit 82bd7db275f0e6900d0dad8935b76f510e93e0a7 Author: Micky Date: Mon Nov 11 00:02:30 2024 +0100 Make Transform2D/3D, Basis, and Quaternion docs more consistent commit 4f17a7428b67986f6ef472e908dcdea73b29d21d Author: Kiro Date: Fri Nov 29 16:00:04 2024 +0100 polygons_get_closest_point_info use edge check instead of triangulation commit e30da67ce9c770ef11557c26d3748d389026c740 Author: thiagola92 Date: Fri Nov 29 11:38:04 2024 -0300 Docs: update example from Window signal files_dropped commit 9f8fec39f34976cac2f5267b0bf721fa132de4df Author: rune-scape Date: Sat Jul 27 17:02:27 2024 -0700 GDScript: Add error messages to some compilation errors commit b57ceefec1715eff1b53943c792f986b6808b7b5 Author: mrsaturnsan Date: Thu Nov 28 13:27:35 2024 +0100 [Windows] Improve frame pacing by busy waiting as needed commit 54945c4d289e5700a480f38bf0b4501bfe32b4c8 Author: Pāvels Nadtočajevs <7645683+bruvzg@users.noreply.github.com> Date: Wed Nov 27 14:04:41 2024 +0200 Add std::initializer_list constructor for Dictionary. commit 0c03db09f84dad8268e446fc2424f6c93286cad6 Author: Pablo Andres Fuente Date: Fri Sep 20 23:00:41 2024 -0300 Add unit tests for TCPServer This PR aims to help "fix" #43440 commit 72be8d1b6925856373f57549bf2e6d3b8d3ef619 Author: Anish Mishra Date: Fri Nov 29 15:27:17 2024 +0530 Update "use_system_accent_color" note in EditorSettings. commit 88e81ee730bb54865304e306bf4f4211f7519546 Author: Rémi Verschelde Date: Thu Nov 28 16:56:14 2024 +0100 Fix various typos and code style issues commit 11225de19730d10ea1ef8d75430a6406b5d4538b Author: landervr <31851431+CpnWaffle@users.noreply.github.com> Date: Thu Nov 28 16:57:31 2024 +0100 Fix ReflectionProbe AABB commit 5d111e852e01ef05c60bd4dbaf4aa66d84259c42 Author: Kent Thang Date: Wed Nov 27 13:18:23 2024 +0100 Update CanvasLayer 'Follow Viewport' documentation to match its behavior commit fda444bb01defafc84016f00dcbf815be06d7143 Author: K. S. Ernest (iFire) Lee Date: Wed Aug 3 12:14:42 2022 -0700 Add csg boolean operators using elalish/manifold. Uses MeshGL64 for more floating point precision. Co-Authored-By: 31 <31eee384@gmail.com> Co-Authored-By: Claudio Z <120678869+cloudofoz@users.noreply.github.com> commit 0eadbdb5d0709e4e557e52377fa075d3e2f0ad1f Merge: 9aed9eca40 c7198dda64 Author: Rémi Verschelde Date: Thu Nov 28 15:08:33 2024 +0100 Merge pull request #99788 from DarioSamo/2d-texture-texture-draw-list-fix Fix another incorrect clear color flag on texture storage. commit c7198dda64b2495c9de56e4a4aa1bc3c1f5d16f8 Author: Dario Date: Thu Nov 28 09:59:03 2024 -0300 Fix another incorrect clear color flag on texture storage. commit e7e3a25c1e2fcd871c91e5196dc836a4aec0b318 Author: kobewi Date: Thu Nov 28 13:31:51 2024 +0100 Fix non-empty project folder confirmation dialog commit 5a48e527b290315c2239349fedfa5ce451efbfed Author: Chaosus Date: Tue Nov 26 11:59:52 2024 +0300 Fix orphan strings in shader preprocessor commit 5d70208da42d53cc2746a32c9fbc92386c44d0dc Author: Michael Alexsander Date: Wed Nov 27 19:34:40 2024 -0300 Make the alt selection menu available for all modes commit 884cbb5333120815fdc30ae2d33d66f99e817a53 Author: Lukas Tenbrink Date: Thu Nov 28 01:55:48 2024 +0100 Don't repeat calls to strlen in split, and make splitter_length const in get_slice. commit 9aed9eca40127bcf21ecd71d25fe8809f345d9e3 Merge: f128f383e8 1c6aad660f Author: Rémi Verschelde Date: Thu Nov 28 00:28:10 2024 +0100 Merge pull request #99773 from DarioSamo/2d-msaa-draw-list-fix Fix incorrect clear color flag on canvas renderer. commit 1c6aad660f73c8f08d3138c936e17b8393689dc4 Author: Dario Date: Wed Nov 27 20:01:23 2024 -0300 Fix incorrect clear color flag on canvas renderer. commit 357679ceb8f35ccce5606348a13f8fc16ba5eb96 Author: Thaddeus Crews Date: Wed Nov 27 12:33:42 2024 -0600 CI: Add explicit problem matchers commit f53a220a7255af6328b0683d1ce8a6671d87976a Author: Markus Sauermann <6299227+Sauermann@users.noreply.github.com> Date: Wed Nov 27 22:29:42 2024 +0100 Fix physics picking when hovering an embedded window When the mouse is hovering an embedded window, it is still considered within the main viewport. Previously in this case physics picking was executed, as if no embedded window was there. This PR introduces an additional check to exclude these cases. commit 8793764ba62bd1a95f44a965894325d88960bd8a Author: ydeltastar Date: Tue Nov 26 23:16:11 2024 -0300 Fix default environment project setting and loading commit f128f383e892865379cb8b14e7bcc9858efe2973 Merge: 150c69c0f2 2041d8cf08 Author: Thaddeus Crews Date: Wed Nov 27 10:47:32 2024 -0600 Merge pull request #98035 from WhalesState/scroll-bar-grapper-area Fix `ScrollBar` grabber mouse input ignores scroll content margins. commit 150c69c0f24adebb92887743c1a6bb3505003e25 Merge: ed01f5f2aa 38e0532ffa Author: Thaddeus Crews Date: Wed Nov 27 10:47:30 2024 -0600 Merge pull request #99694 from dsnopek/android-os-create-instance-return-value Android: `OS.create_instance()` should return `-1` on failure commit ed01f5f2aa8e5a4c7103417f78259c5c9d9471ff Merge: ce4674a0a5 6d5ac8f7ef Author: Thaddeus Crews Date: Wed Nov 27 10:47:29 2024 -0600 Merge pull request #98670 from DarioSamo/rd-transient-targets Automatically resolve initial and final action for draw lists. commit ce4674a0a5085746e4f4014fd6b3250248c0b52d Merge: 8b5f181d86 56d01fb467 Author: Thaddeus Crews Date: Wed Nov 27 10:47:28 2024 -0600 Merge pull request #98539 from pafuent/show_filename_when_delete Show file names in remove files confirmation dialog commit 8b5f181d865780daafbf63d27248734cddb4afe8 Merge: 8f603c901e 9558d4f28f Author: Thaddeus Crews Date: Wed Nov 27 10:47:24 2024 -0600 Merge pull request #90723 from Calinou/textedit-autocompletion-always-replace-if-not-shift Make TextEdit autocompletion replace word unless Shift is held commit 8f603c901efd787377e11c82f21755916f97c978 Merge: 6eca2aa8d6 fb5a4bac6e Author: Thaddeus Crews Date: Wed Nov 27 10:47:21 2024 -0600 Merge pull request #99679 from timothyqiu/custom-tooltip-doc Improve documentation for tooltip-related methods commit 6eca2aa8d6f30661185747fcf2ec9d3fea76f462 Merge: 539be43dad 2f620db1d8 Author: Thaddeus Crews Date: Wed Nov 27 10:47:18 2024 -0600 Merge pull request #99295 from HolonProduction/yet-another-lsp-violation LSP: Fix spec violations that break the VSCode outline commit 539be43dadc0d9184024bd7a65354b92bee19f80 Merge: 70ea5713cf 3413c6ce9d Author: Thaddeus Crews Date: Wed Nov 27 10:47:16 2024 -0600 Merge pull request #99677 from syntaxerror247/patch-1 Update `screen_get_scale` documentation. commit 70ea5713cf2aba739d0529d14a66c410edfd078c Merge: 9e259ef061 14dd595447 Author: Thaddeus Crews Date: Wed Nov 27 10:47:15 2024 -0600 Merge pull request #98012 from syntaxerror247/lineEdit-bug-fix Fix uneditable `LineEdit`, `TextEdit` and `CodeEdit` virtual keyboard popup on mobile commit 9e259ef0610b4434320413e06e954e5c50f27a83 Merge: 3a5ce2ff94 0ff5d5fd04 Author: Thaddeus Crews Date: Wed Nov 27 10:47:14 2024 -0600 Merge pull request #97884 from passivestar/list-variations Add theme type variations for secondary Trees and ItemLists commit 3a5ce2ff946422a3de63340ff113bb4ab68c8b73 Merge: 9c300a6c05 1a082fdd80 Author: Thaddeus Crews Date: Wed Nov 27 10:47:13 2024 -0600 Merge pull request #98901 from adamscott/add-editor-ensure-crossorigin-isolation-headers [Web] Ensure editor crossorigin isolation headers commit 9c300a6c057c809ce093d92fc570010dba84fc05 Merge: c5cd7c66ee 0cf99cf95d Author: Thaddeus Crews Date: Wed Nov 27 10:47:12 2024 -0600 Merge pull request #80965 from Calinou/viewport-add-get-stretch-scale-factor Add a Viewport method to get automatically computed 2D stretch transform commit c5cd7c66ee417f6854fb5e36812e870849c46c3e Merge: 06f4bcdefb 612981c1ea Author: Thaddeus Crews Date: Wed Nov 27 10:47:10 2024 -0600 Merge pull request #85443 from smix8/gridmap_castshadows Add ShadowCastingSetting to MeshLibrary / GridMap items commit 06f4bcdefb14c77b553f10a805188057952b9cdf Merge: 78abba7b0b bd69df1379 Author: Thaddeus Crews Date: Wed Nov 27 10:47:09 2024 -0600 Merge pull request #97346 from DevPoodle/vertex-attribute-docs Add descriptions to RDVertexAttribute's properties commit 78abba7b0b7e622ab083335f6fdbe1e352da5332 Merge: 3edf8b91e9 57541d53d3 Author: Thaddeus Crews Date: Wed Nov 27 10:47:08 2024 -0600 Merge pull request #99385 from syntaxerror247/file_picker_extension_support Implement extension support for native file dialog on Android commit 3edf8b91e931c3b1085dd6cc9be83c10bdd396f3 Merge: 0195a898b3 771e561cdd Author: Thaddeus Crews Date: Wed Nov 27 10:47:07 2024 -0600 Merge pull request #98489 from Flarkk/fix_project_position Fix Camera3D::project_position() when depth=zfar commit 0195a898b3102c94e86310743a39580a3dfe2f85 Merge: 225211bb58 a54c6ce42d Author: Thaddeus Crews Date: Wed Nov 27 10:47:05 2024 -0600 Merge pull request #95795 from yahkr/95769-animation-crash Fix crash when re-importing model with AnimationPlayer panel open and node selected commit 225211bb5895a702f191f248cd505ba1240b918a Merge: 21542298aa 3c78eb1713 Author: Thaddeus Crews Date: Wed Nov 27 10:47:04 2024 -0600 Merge pull request #99761 from Repiteo/style/clang-format-downgrade Style: Downgrade `.clang-format` arguments to 17.x commit 21542298aab762750c66855629fc22bd44729ef1 Merge: 1c78b09815 9e34e45480 Author: Thaddeus Crews Date: Wed Nov 27 10:47:03 2024 -0600 Merge pull request #99743 from clayjohn/material-texture-mask Use Vector4 for texture mask in BaseMaterial to avoid converting to and from Plane commit 1c78b09815659f06144856ad731c505a96a257f8 Merge: ac6fc8501a 74611a74d1 Author: Thaddeus Crews Date: Wed Nov 27 10:47:02 2024 -0600 Merge pull request #96544 from SaracenOne/import_thumbnails Generate thumbnails on imported scenes. commit ac6fc8501ae2d2508018c21f9fab08fb331091df Merge: a29a1b842c 2c9de1d9d2 Author: Thaddeus Crews Date: Wed Nov 27 10:47:01 2024 -0600 Merge pull request #97311 from pafuent/adding_udp_server_unit_tests Add unit tests for UDPServer commit a29a1b842c585863c2b17ee66377a60f602f86d4 Merge: 30ab612e35 70a55540b7 Author: Thaddeus Crews Date: Wed Nov 27 10:47:00 2024 -0600 Merge pull request #99740 from tdaven/fix-99661 Ensure primitive meshes are created before connected to changed signal. commit 30ab612e352d0ec0ee8f64fd3463b2881b00a51a Merge: 6e533b5ee4 75eacba5cd Author: Thaddeus Crews Date: Wed Nov 27 10:46:59 2024 -0600 Merge pull request #90778 from timothyqiu/cam-preview Add Camera3D preview in Inspector commit 6e533b5ee462af5275982e92a1d36028429b0dae Merge: c58ae91efa 45a7bcc477 Author: Thaddeus Crews Date: Wed Nov 27 10:46:58 2024 -0600 Merge pull request #99606 from jamie-pate/fix_99592 Fix gl_compatibility lightmap uniforms not being set commit c58ae91efaaf593f1cfa38e9ee557203a8531c48 Merge: 2a147f3ce1 3376b9166b Author: Thaddeus Crews Date: Wed Nov 27 10:46:56 2024 -0600 Merge pull request #99220 from Flarkk/fix_sss_reverse_z Fix regression in SSS with reverse-z commit 2a147f3ce12ee44d783c7a17a70c184e86c205b7 Merge: 7ddc076b24 f789025d42 Author: Thaddeus Crews Date: Wed Nov 27 10:46:54 2024 -0600 Merge pull request #99091 from Mickeon/documentation-object-boolean-context-4.4 Add documentation note on Object's boolean context commit 7ddc076b24d68f5ec83ecc49e39f2dcc24d94659 Merge: ed443ccd25 e297506365 Author: Thaddeus Crews Date: Wed Nov 27 10:46:53 2024 -0600 Merge pull request #99600 from Spartan322/permit/non-spec-dds Round DDS width/height to next divisor multiple for block compression commit ed443ccd25bc4800c76df4ed4271f27e749c4163 Merge: ea61c3e066 22caab0248 Author: Thaddeus Crews Date: Wed Nov 27 10:46:52 2024 -0600 Merge pull request #99079 from FlooferLand/patch-1 Add note about LightmapGI only baking nodes under its parent commit ea61c3e06694c7f082e8cfe66fbe635c1183abb6 Merge: 4e079ee733 3345f90bf3 Author: Thaddeus Crews Date: Wed Nov 27 10:46:51 2024 -0600 Merge pull request #97924 from passivestar/plugin-tooltip Fix plugin creation dialog script name tooltip commit 4e079ee733efbb932df999c2e07a4cd09ab5349f Merge: bbc54692c0 7f37e88658 Author: Thaddeus Crews Date: Wed Nov 27 10:46:49 2024 -0600 Merge pull request #99459 from bruvzg/svg_font_fix Fix SVG font rendering. commit 3c78eb171340b1ff24f036b8e36280ce350be6bb Author: Thaddeus Crews Date: Wed Nov 27 10:11:17 2024 -0600 Style: Downgrade `.clang-format` arguments to 17.x commit f57fea0b0ffd2a43b482b9b07c260b30b129c8b5 Author: Black Cat Date: Mon Nov 18 17:16:35 2024 +0000 Enable editing of controls inside viewports in editor Fixes #79289 commit 84bf1cc7ac8cbfe3a830e70510bfd97e196cb1b0 Author: ArchercatNEO Date: Wed Nov 27 15:37:54 2024 +0000 Fix broken includes when compiling with builtin_miniupnpc=false Fixes #99196 Supersedes #99218 commit 0ce4c6dac3c78c2e159f22abc802299737fe7c89 Author: Dario Date: Tue Nov 12 14:33:32 2024 -0300 Improve performance of shader lighting code in Forward renderers. - Skip sampling shadows if attenuation is very small. - Skip computing diffuse and specular light if attenuation and shadow are very small. commit 99cbcd250a6b837da03ebfd6fc57cf767dd39f41 Author: Micky Date: Wed Nov 27 16:02:46 2024 +0100 Fix AudioStreamPlayer2D/3D's `get_playback_position` returning `0` right after calling `seek` commit 06bb9944d7a041bc4d5b8fba72ad36aa6e9e27ae Author: Micky Date: Wed Nov 27 01:39:16 2024 +0100 Fix code consistency between AudioStreamPlayer2D and AudioStreamPlayer3D commit 34a19f07a44ea6cf5a092825e29b1246cede7069 Author: Dario Date: Tue Nov 26 13:32:40 2024 -0300 Restore dirty list for BaseMaterial3D but don't use it on resource loader. commit 95401f0753c55ce32978597919c2e6bb94184a60 Author: Fabio Alessandrelli Date: Wed Nov 27 13:29:19 2024 +0100 [WebSocket] Clarify that connect_to_url is non-blocking commit f511ef26f11d327124ab596158053a578db360f2 Author: Fabio Alessandrelli Date: Wed Nov 27 13:18:33 2024 +0100 [MP] Move OfflineMultiplayerPeer docs to the module Was missing from the module config, causing the XML to be added to the main doc folder commit 88ffe07de95c1d5fad51616239015fa78ea58797 Author: BlueCube3310 <53150244+BlueCube3310@users.noreply.github.com> Date: Fri Nov 22 13:45:12 2024 +0100 Betsy: Add BC3 and BC5 support commit f1f47c3a538f2204ddd97d0c7690d5f01a1f1584 Author: Florent Guiocheau Date: Tue Nov 12 13:30:33 2024 +0100 Add tests for `Projection` commit 9e34e454805f0dc6aad459170e7a2bbdaf2d4575 Author: clayjohn Date: Tue Nov 26 21:43:46 2024 -0800 Use Vector4 for texture mask in BaseMaterial to avoid converting to and from Plane commit 70a55540b7091758b851b075b968789a16e74261 Author: Trevor Davenport Date: Tue Nov 26 20:44:39 2024 -0700 Ensure primitive meshes are created before connected to changed signal. Primitive meshes are special in that they aren't created until calling one of their methods which cause it to actually create the mesh resources. If this is not done early enough, a changed signal can be triggered from an unexpected thread resulting in a threading warning. This follows the pattern of mesh_instance_3d which also does this before connecting to the change signal. Future cleanup could provide a better means to populate the meshes. commit 2041d8cf08f49f9b5dd501c75deae024e080e5f9 Author: Mounir Tohami <53877170+WhalesState@users.noreply.github.com> Date: Wed Nov 27 00:37:12 2024 +0000 Fix `ScrollBar` grabber mouse input. commit e515f593c2f2135fe09b5441f92dd4afbb227f59 Author: Haoyu Qiu Date: Sat Nov 23 12:55:01 2024 +0800 Disable Clear Guides menu item when no guides exist commit 612981c1ea7d1beb927b53a2e4056827ed6ca32a Author: smix8 <52464204+smix8@users.noreply.github.com> Date: Mon Nov 27 19:37:52 2023 +0100 Add ShadowCastingSetting to MeshLibrary / GridMap items Adds ShadowCastingSetting to MeshLibrary / GridMap items. commit ba5a3577a55a45c706f49f611fea560cd15f191a Author: smix8 <52464204+smix8@users.noreply.github.com> Date: Sun Nov 24 18:30:19 2024 +0100 Make NavMap objects request sync only on demand Replaces brute-force sync check loop with a self-listing system where each object is responsible for its own dirty sync, requesting it on demand only. commit b2e40829a84794dbc1432a23c75b7fde13441bef Author: smix8 <52464204+smix8@users.noreply.github.com> Date: Tue Nov 26 23:35:28 2024 +0100 Add test for NavigationServer path simplification Adds test for NavigationServer3D.simplify_path() function. commit 627d10e4c48cd467f4454a2cbb6be39588e50f7e Author: mrsaturnsan Date: Tue Nov 26 13:42:26 2024 -0600 Fix vsync on macOS getting disabled when using afterMinimumDuration commit bbc54692c05ff6a85a6aeefbf5b9c87de91983d8 Merge: 13d59b28c1 d5fbc7dab1 Author: Thaddeus Crews Date: Tue Nov 26 13:04:59 2024 -0600 Merge pull request #98419 from KoBeWi/dialog_scalar Improve Scale Selection in Animation tab commit 13d59b28c17c2f93b3de01a3e818a4e72ab8a29d Merge: 1606b18673 f2f48aaf36 Author: Thaddeus Crews Date: Tue Nov 26 13:04:58 2024 -0600 Merge pull request #99563 from akien-mga/fix-projection-stringification Fix stringification of Projection commit 1606b18673ea2aae53e27a46b45e4ce2bea1e5b7 Merge: 1bba277d3f 1bd52fed76 Author: Thaddeus Crews Date: Tue Nov 26 13:04:57 2024 -0600 Merge pull request #95964 from Chubercik/clipper2-1.4.0 clipper2: Update to 1.4.0 commit 1bba277d3f217f64248ee40e506c26486842363d Merge: 1dffdfdd5b 6ba86c3852 Author: Thaddeus Crews Date: Tue Nov 26 13:04:56 2024 -0600 Merge pull request #99417 from passivestar/thread-selector Disable the debugger thread selector when there's nothing to select commit 1dffdfdd5bfc39dc4246f7ecd366b38b99a213fe Merge: 0ee60dd543 891173b3ea Author: Thaddeus Crews Date: Tue Nov 26 13:04:55 2024 -0600 Merge pull request #94026 from passivestar/mac-align-transform-shortcut [macOS] Change the shortcut for Align Transform with View commit 0ee60dd5431597760d71a58c6e421d45511f18dd Merge: 127738c08b 289e548e34 Author: Thaddeus Crews Date: Tue Nov 26 13:04:54 2024 -0600 Merge pull request #99516 from KoBeWi/quantum_entanglement_of_source_files Untangle ColorPicker includes commit 127738c08b1b47179afc874000a320bcdaae5e1f Merge: 0045b1a513 a8cd0e9677 Author: Thaddeus Crews Date: Tue Nov 26 13:04:53 2024 -0600 Merge pull request #99387 from 0x0ACB/direct_composition Use direct composition for d3d12 backend commit 0045b1a5135a419daa10b94e42adc220d65fd913 Merge: 78b2a53815 48fbe4172b Author: Thaddeus Crews Date: Tue Nov 26 13:04:51 2024 -0600 Merge pull request #98862 from HuntJSparra/early-projsettings-registration Register Engine, OS, ProjectSettings, and Time singletons in time for for `INITIZATION_LEVEL_CORE` commit 78b2a53815d1634b71fb414188de397f20a540c4 Merge: 19dd3eda19 37c3907d0e Author: Thaddeus Crews Date: Tue Nov 26 13:04:50 2024 -0600 Merge pull request #99626 from smix8/performance_data Change navigation map performance monitor to use a struct commit 19dd3eda194fc6492bc8e03bb68e3bf17c187bc5 Merge: 33093c2029 e653f19032 Author: Thaddeus Crews Date: Tue Nov 26 13:04:49 2024 -0600 Merge pull request #99364 from Mickeon/documentation-global-scope-keys-plus-minus Rewrite some `@GlobalScope` keys in documentation to use `[code]` tags commit 33093c2029cf51a5f9b048c7d32248a567ee6487 Merge: 04786f0ee8 38d274b021 Author: Thaddeus Crews Date: Tue Nov 26 13:04:48 2024 -0600 Merge pull request #99619 from TokageItLab/flippable Make flipping flag consider influence in LookAtModifier3D commit 04786f0ee8df06f4238327789b10e0c2e09c4c7e Merge: 37c392ebc3 f5b49af99f Author: Thaddeus Crews Date: Tue Nov 26 13:04:47 2024 -0600 Merge pull request #97824 from TokageItLab/retarget-modifier Add RetargetModifier3D for realtime retarget to keep original rest commit 37c392ebc300148e4c0882a058e2802f7473965d Merge: d18f8046dd 1deb42ad8d Author: Thaddeus Crews Date: Tue Nov 26 13:04:46 2024 -0600 Merge pull request #96414 from SaracenOne/improve_animation_warnings Improve behaviour of AnimationPlayer warnings. commit d18f8046dd29ce004fb401aa5d8c22858855a149 Merge: dc0fcf9753 27bd7b23f6 Author: Thaddeus Crews Date: Tue Nov 26 13:04:45 2024 -0600 Merge pull request #99613 from TokageItLab/scl-fw Fix `forward_vector` scale to handle `safe_margin` correctly in LookAtModifier commit dc0fcf9753972163e0a28d647801d9b039073210 Merge: b41f02c035 b76cdf525b Author: Thaddeus Crews Date: Tue Nov 26 13:04:44 2024 -0600 Merge pull request #99612 from TokageItLab/lkat-bn Make LookAtModifier3D adopt the bone name method commit b41f02c035faa00d5432acbeda50e287ca03561a Merge: 185a86a87d 0fc082e1ee Author: Thaddeus Crews Date: Tue Nov 26 13:04:43 2024 -0600 Merge pull request #90644 from BattyBovine/cs3d_debug_colour Add CollisionShape3D custom debug colors commit 185a86a87d6804899a2326e3421d4a370aa78d5c Merge: 391e0a6808 893ce62967 Author: Thaddeus Crews Date: Tue Nov 26 13:04:42 2024 -0600 Merge pull request #98567 from ydeltastar/remote-pick Fix `ColorPicker`'s remote synchronization when typing values commit 391e0a6808e84a40fb53f41d0f0b088c43d3e0db Merge: 7f3242a7e8 ebf7e86bd4 Author: Thaddeus Crews Date: Tue Nov 26 13:04:41 2024 -0600 Merge pull request #99585 from TokageItLab/start-end-each Make start/end can be retrieved from each PlaybackData on AnimationPlayer commit 7f3242a7e887b281f5ba93670e8d800bf91f385c Merge: d09d82d433 ffd4de67d0 Author: Thaddeus Crews Date: Tue Nov 26 13:04:40 2024 -0600 Merge pull request #99201 from Ivorforce/variant-get-contents-ptr Add GDExtension `variant_get_ptr_internal_getter`, facilitating `VariantGetInternalPtr`-like behavior in GDExtension commit e653f190322ae4bb572b756fabb6e3950827b183 Author: Micky Date: Sun Nov 17 17:48:33 2024 +0100 Rewrite some `@GlobalScope` keys in documentation to use `[code]` tags commit 1bd52fed769ae65bdd00a47f127e45f9d9477c32 Author: Jakub Marcowski Date: Thu Aug 22 18:23:26 2024 +0200 clipper2: Update to 1.4.0 commit 0fc082e1ee3af5bb6a4b52f85756d24dc02b230f Author: Jamie Greunbaum Date: Tue Apr 2 03:26:10 2024 -0400 Add CollisionShape3D custom debug colours This allows changing the display colour of a CollisionShape3D node on a per-shape basis. It also adds the ability to display a solid coloured preview of a CollisionShape3D. Closes https://github.com/godotengine/godot-proposals/issues/906 commit 47788673ef5f55e0fd965842b3b1691769319067 Author: Giganzo <158825920+Giganzo@users.noreply.github.com> Date: Tue Nov 26 00:19:55 2024 +0100 Fix RTL visuals for sliders commit 3376b9166baa238309d0f30a59b45677296ab27e Author: Florent Guiocheau Date: Wed Nov 13 13:57:41 2024 +0100 Fix SSS with reverse-z commit a8cd0e9677011c989a0aae8da5888805db83d620 Author: 0x0ACB <11277588+0x0ACB@users.noreply.github.com> Date: Mon Nov 18 11:35:55 2024 +0100 Use direct composition for d3d12 backend commit fb5a4bac6e4680a5174a6c95c1792ea13c17643b Author: Haoyu Qiu Date: Mon Nov 25 22:35:01 2024 +0800 Improve documentation for tooltip-related methods commit ffd4de67d0c82b335d36abd635892e065469eea4 Author: Lukas Tenbrink Date: Wed Nov 13 22:27:34 2024 +0100 Add variant_get_ptr_internal_getter to gdextension_interface.h. The function returns functions to retrieve a pointer to a Variant's internal value. This enables GDExtensions to implement functionality similar to VariantGetInternalPtr, to access Variant internal values directly. commit 38e0532ffa43a8302a32d683ec7610b21ec0f4a1 Author: David Snopek Date: Mon Nov 25 15:58:06 2024 -0600 Android: `OS.create_instance()` should return `-1` on failure commit 003647972fe143f50f3803b14980a99ce6012b46 Author: Markus Sauermann <6299227+Sauermann@users.noreply.github.com> Date: Mon Nov 25 21:36:29 2024 +0100 Rename `consume_drag_and_drop` to `mouse_target` The functionality of the parameter is not limited to drag-and-drop operations, but it has also other uses. So its name should not be tied to drag-and-drop. The API was created in the not yet released Godot 4.4-dev6, so this change should not be considered compatibility breaking. commit f2f48aaf36507bb1ade6261905296bfd560e921d Author: Rémi Verschelde Date: Fri Nov 22 21:25:32 2024 +0100 Fix stringification of Projection commit d09d82d433b03bb3773fd2a8cc8d6ccc2f8739ce Merge: 9b5c7e9efa 9625fdc1d7 Author: Thaddeus Crews Date: Mon Nov 25 13:22:36 2024 -0600 Merge pull request #99068 from yahkr/fix_monitor_display [Editor] Fix float value used for integer performance monitors commit 9b5c7e9efaae1f5ac9a92e9acd096ff5c89bdfa5 Merge: 0d88737a9f e210313045 Author: Thaddeus Crews Date: Mon Nov 25 13:22:33 2024 -0600 Merge pull request #99545 from KoBeWi/Vector4.0 Fix stringification of Vector4 commit 0d88737a9f51a88645686c607dd76e8c9d183500 Merge: 6e6fbdd593 e9b57fce82 Author: Thaddeus Crews Date: Mon Nov 25 13:22:30 2024 -0600 Merge pull request #99542 from bruvzg/stdin_str Convert line breaks to `\n` and strip line break from the end of string returned by `OS::read_string_from_stdin`/`OS::get_stdin_string`. commit 6e6fbdd59376dff76cd3b8f1db4b6dc0e2f91930 Merge: 57125f48ce 796d943f14 Author: Thaddeus Crews Date: Mon Nov 25 13:22:30 2024 -0600 Merge pull request #99605 from Alex2782/fix_errmsg_java_sdk_path Fix missing space after period in error message. commit 57125f48cebea05922bb6dc2a999c861dd0e7700 Merge: 81733e6622 05b266bd89 Author: Thaddeus Crews Date: Mon Nov 25 13:22:29 2024 -0600 Merge pull request #98069 from thedinosoar/fix/service-worker-sandbox-error-98068 [Web] Fix PWA callback assignment causing crash in sandboxed iframes commit 81733e66224ea113cf32b69ea93a6c1342d9c6e7 Merge: 29e6ef4277 c4bb252294 Author: Thaddeus Crews Date: Mon Nov 25 13:22:28 2024 -0600 Merge pull request #99506 from Giganzo/scale-2d-selection Change how multi selection scale is applied to canvas item commit 29e6ef4277e9d43cbffc8a1bd837e97db8bac0f5 Merge: 20d4755c64 0df602afed Author: Thaddeus Crews Date: Mon Nov 25 13:22:27 2024 -0600 Merge pull request #99597 from Faless/upnp/custom_instance [UPNP] Allow disabling UPNP implementation on the Web commit 20d4755c646add8e42470ae7c3471e6b29caa793 Merge: 5b11eb6de1 1c522c9f0c Author: Thaddeus Crews Date: Mon Nov 25 13:22:26 2024 -0600 Merge pull request #99629 from AThousandShips/fix_scu_win [Buildsystem] Fix path format for SCU builds on Windows commit 5b11eb6de1dca3b4c5cc77d876216d2b3823dc33 Merge: fc6c8bb982 da191168fe Author: Thaddeus Crews Date: Mon Nov 25 13:22:25 2024 -0600 Merge pull request #99562 from badsectoracula/improve_voxelgi_bake_ui Add VoxelGI bake cancelling and progress UI improvement commit fc6c8bb98205e433b27b7ab10e871e4b21000e1d Merge: 7c9d0300b7 8e1a6ea431 Author: Thaddeus Crews Date: Mon Nov 25 13:22:24 2024 -0600 Merge pull request #99688 from akien-mga/revert-99178 Revert "Make `delay_usec` more precise on Windows to fix framepacing" commit 7c9d0300b7e19b53ccf8953f2873a6c416f6c4a6 Merge: ec01ad65fd b31cc6960d Author: Thaddeus Crews Date: Mon Nov 25 13:22:24 2024 -0600 Merge pull request #99332 from Repiteo/ci/bump-scons CI: Bump SCons to latest (4.8.0 → 4.8.1) commit ec01ad65fd615740177e403693cc3c8984f0d62a Merge: 7104f20634 13b565c64d Author: Thaddeus Crews Date: Mon Nov 25 13:22:20 2024 -0600 Merge pull request #99620 from tetrapod00/doc-control-children Docs: Update Control class to properly reflect behavior of Themes on Control Children commit 7104f20634c7a1ea4b751575ac6eecec16949a72 Merge: 0c45ace151 edde380e9c Author: Thaddeus Crews Date: Mon Nov 25 13:22:18 2024 -0600 Merge pull request #97986 from dustdfg/metadata/forbid_deleting_inherited_metadata Editor: forbid deleting inherited metadata properties commit 8e1a6ea4319e6f38cecc36a06e2e5384678ecf83 Author: Rémi Verschelde Date: Mon Nov 25 19:43:21 2024 +0100 Revert "Make delay_usec more precise" This reverts commit df3367f3343ec5acc579205479642d7275f3e12b. Fixes #99593. commit 15bd2a9bc1d2356cad76502a701bfc4386f44ea4 Author: arkology <43543909+arkology@users.noreply.github.com> Date: Mon Nov 25 21:00:50 2024 +0300 Show TextureProgressBar radial cross only when editing the scene commit e297506365559f2b13534b9dd5f3250db06975a5 Author: Spartan322 Date: Sat Nov 23 15:28:58 2024 -0500 Round DDS width/height to next divisor multiple for block compression commit 6d5ac8f7ef4a3ddaf50720ab473b9dffece21674 Author: Dario Date: Thu Oct 24 16:01:00 2024 -0300 Resolve load and store ops automatically for render passes for discardable textures. commit 3413c6ce9df6206ccb9d2f3f73efaebefe81833d Author: Anish Mishra Date: Mon Nov 25 19:07:05 2024 +0530 Update screen_get_scale documentation. commit e0b4f3d314a00b2a634ced1b5dd988b2d2f7ed36 Author: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Sun Nov 24 23:49:46 2024 +0200 [Windows] Fix root and current folder in native file dialog. Co-authored-by: RedMser commit 0708048530a5e558f6180753f1356b04e266d5df Author: Pāvels Nadtočajevs <7645683+bruvzg@users.noreply.github.com> Date: Thu Nov 21 10:57:07 2024 +0200 [TextServer] Fix some line breaking edge cases. commit a2b8b51097a8893acadbd20c384a9397d0bf9267 Author: Pāvels Nadtočajevs <7645683+bruvzg@users.noreply.github.com> Date: Mon Nov 25 09:36:53 2024 +0200 [RTL] Fix clearing text with `set_text("")`. commit 38d274b021b551c11a3436c2f4f1898dcb2994ca Author: Silc Lizard (Tokage) Renew <61938263+TokageItLab@users.noreply.github.com> Date: Sun Nov 24 16:00:15 2024 +0900 Make flipping flag consider influence in LookAtModifier3D commit b76cdf525b5d70b4a11ff72f5ca701d93446d835 Author: Silc Lizard (Tokage) Renew <61938263+TokageItLab@users.noreply.github.com> Date: Sun Nov 24 11:29:29 2024 +0900 Make LookAtModifier3D adopt to bone name method commit 99886f32045326f60b12ef34b90b2d0ad1e9718d Author: arkology <43543909+arkology@users.noreply.github.com> Date: Mon Nov 25 09:28:16 2024 +0300 Remove double `is_editor_hint()` check inside `NOTIFICATION_READY` for `Camera2D` node `Engine::get_singleton()->is_editor_hint()` is already a part of `is_part_of_edited_scene()` function. commit 13b565c64d25a170c65f00c6716cb41dad9408c3 Author: tetrapod00 <145553014+tetrapod00@users.noreply.github.com> Date: Sun Nov 24 01:04:57 2024 -0800 Docs: Update Control class to properly reflect behavior of Themes on Control Children Document fact that themes only propagate to control children (not Node2D, etc). Wording is copied from Theme docs. Also clarifies line somewhat. Co-Authored-By: Allyson Chan commit 74611a74d1ae8af26fd889a6f2c83ba42198c6aa Author: Saracen Date: Wed Sep 4 00:57:51 2024 +0100 Generate editor thumbnails on imported scenes. commit 1d43fa9a64b5cc83378b3b9fd93d9a915232150c Author: Pāvels Nadtočajevs <7645683+bruvzg@users.noreply.github.com> Date: Sun Nov 24 20:09:05 2024 +0200 Change file dialog all files filter name from `All Files (*)` to `All Files(*.*)`. commit 8f5b11ac2513e336e001645a41c942e433de0f6b Author: yahkr <62478788+yahkr@users.noreply.github.com> Date: Fri Nov 1 20:11:25 2024 -0400 [Editor] Update SceneUniqueName button text when disabled to clarify access. commit 1c522c9f0cc96e63b0f26648b0dc71138f497e79 Author: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Date: Sun Nov 24 15:33:47 2024 +0100 [Buildsystem] Fix path format for SCU builds on Windows commit 37c3907d0e093632e142a494c0e405263f9c9c34 Author: smix8 <52464204+smix8@users.noreply.github.com> Date: Sun Nov 24 13:19:33 2024 +0100 Change navigation map performance monitor to use a struct Changes navigation map performance monitor to use a struct as it is easier to pass to sub functions. commit 27bd7b23f68da271adda17dfff085b4e075717bf Author: Silc Lizard (Tokage) Renew <61938263+TokageItLab@users.noreply.github.com> Date: Sun Nov 24 13:43:07 2024 +0900 Fix forward_vector scale to handle safe_margin in LookAtModifier commit 86ea0127a3b6c27878a28ae5e3879055e7d6476f Author: Pablo Andres Fuente Date: Mon Sep 23 14:30:07 2024 -0300 Add a focus border on `ScrollContainer` Also added new unit tests for `Control`. Co-authored-by: ator-dev commit 84f4178850c2c39719ece200a93e307641c08051 Author: Bruno Brant <1890900+bruno-brant@users.noreply.github.com> Date: Sat Nov 23 23:02:14 2024 -0300 Fix missing sign in ease function curve description The range was broken because -1.0 was informed as being 1.0. commit 796d943f14178ec1872085624bacaf4b9c18ef48 Author: Alexander Hartmann Date: Sun Nov 24 00:29:09 2024 +0100 Fix missing space after period in error message. commit 45a7bcc477623b7941bb4a145ddfa62b77e97096 Author: Jamie Pate Date: Sat Nov 23 16:11:37 2024 -0800 Fix gl_compatibility lightmap uniforms not being set Fixes #99592 The following variables were set too early, and later code never ran.. prev_shader, prev_variant, prev_spec_constants variables These variables were shared in two different branch conditions but were updated inside the first one, so the second could never be true.. The condition to update lighting also should check prev_spec_constants since it updates that uniform. commit 1bffefb346c2974aad692905041ccfb84e666597 Author: Bastiaan Olij Date: Fri Sep 22 13:58:02 2023 +1000 Adding ability to include build-in include files (precursor to custom shader templates) commit 0df602afed31954086a54b67e1e2c53672aef7d8 Author: Fabio Alessandrelli Date: Sat Nov 23 14:57:24 2024 +0100 [UPNP] Allow disabling UPNP implementation on the Web Make UPNP classes custom instance, so they can come with empty implementation on the Web (where the would not work anyway) without breaking scripts referencing it. This results in smaller Web builds by not including the library which also results in the emscripten socket wrappers to be stipped away. commit da191168fe6cd69c6803c7db4804c1c17781409c Author: Bad Sector Date: Fri Nov 22 21:10:07 2024 +0200 Add VoxelGI bake cancelling and progress UI improvement commit f6ea6cdb67b337fd18c1e13a539de68c2ab00b9e Author: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Date: Sat Mar 16 10:21:45 2024 +0100 Fix some invalid `int` property ranges * `HeightMapShape3D` had ranges configured for `float` instead of `int` * Particles had `amount` that used `exp` which is not supported, added note commit 6c38824d037cc4d3f22362e89b8193bb9e49aae9 Author: arkology <43543909+arkology@users.noreply.github.com> Date: Sat Nov 23 15:53:06 2024 +0300 Document radial_center_offset bounds commit ebf7e86bd4635d41d0399d116af416a521d5dd58 Author: Silc Lizard (Tokage) Renew <61938263+TokageItLab@users.noreply.github.com> Date: Sat Nov 23 22:28:31 2024 +0900 Make start/end can be retrieved from each PlaybackData on AnimPlayer commit e9b57fce827c8fac5640a8a260dffd8682b660db Author: Pāvels Nadtočajevs <7645683+bruvzg@users.noreply.github.com> Date: Fri Nov 22 16:26:25 2024 +0200 Convert line breaks to `\n` and strip line break from the end of string returned by `OS::read_string_from_stdin`/`OS::get_stdin_string`. commit 4089a6cb8c7f0794a77e0a7774d8c43612672bcf Author: Rudolph Bester Date: Sat Nov 2 16:48:08 2024 +0200 Fixed occlusion culling for double builds by enforcing float conversion for Embree. commit 2c9de1d9d2e09ec4de52f2eb96af36729ec0f84f Author: Pablo Andres Fuente Date: Sun Sep 22 00:10:04 2024 -0300 Add unit tests for UDPServer This PR aims to help "fix" #43440 commit b862a394f4c854c1a67cb534a33612f8e43f697f Author: kit Date: Thu Apr 4 15:16:13 2024 -0400 Add tooltips to dock menu and remove disabled commit 0c45ace151f25de2ca54fe7a46b6f077be32ba6f Merge: 7faad0cc7a 09b6466e14 Author: Thaddeus Crews Date: Fri Nov 22 14:54:49 2024 -0600 Merge pull request #99054 from timothyqiu/session-names Translate the name of the debugger session tabs commit 7faad0cc7acc688d23bea48d144f60f7034a0823 Merge: 17e8cf0d87 2191df0cea Author: Thaddeus Crews Date: Fri Nov 22 14:54:47 2024 -0600 Merge pull request #97388 from tetrapod00/visualshader-linear-srgb VisualShader: Add LinearToSRGB and SRGBToLinear to ColorFunc node commit 17e8cf0d87a1c7b4b3c068202be16f51a31369e6 Merge: ea3154a0d4 1768a1b991 Author: Thaddeus Crews Date: Fri Nov 22 14:54:41 2024 -0600 Merge pull request #99044 from Sticksman/bug-fix-98873 Remove deprecated worker.js file commit ea3154a0d4397fc68c2dc3874e1842dd8a6cffb2 Merge: 37305e40bc 03b05cf9ac Author: Thaddeus Crews Date: Fri Nov 22 14:54:31 2024 -0600 Merge pull request #99424 from dalexeev/core-fix-builtin-enum-const-binds Core: Fix built-in enum constant bindings commit 37305e40bcec774ad8d0948589f46f9f02be8c23 Merge: dcb59f0e7e 761a20f7a7 Author: Thaddeus Crews Date: Fri Nov 22 14:54:30 2024 -0600 Merge pull request #95711 from TokageItLab/warn-oneshot-prop Add hint for oneshot property & warning when it will be updated continuously by Force Continuous in `AnimationMixer` commit dcb59f0e7efffa97570147817177188298c6b08b Merge: 2adfa20ee2 e8a4b45ce4 Author: Thaddeus Crews Date: Fri Nov 22 14:54:29 2024 -0600 Merge pull request #99548 from Repiteo/style/clang-format-19-options Style: Add 19.1.0 LLVM options to `.clang-format` commit 2adfa20ee2012fda8d2a21092fd20ae1f989ac8a Merge: 514d73affc bead829fd5 Author: Thaddeus Crews Date: Fri Nov 22 14:54:28 2024 -0600 Merge pull request #99544 from jtcat/fix-inspector-favorites Fix inspector section iteration in `update_tree` commit 514d73affc1370626069ea7bbbd74a2457b53b12 Merge: a0211b0f2e 4988fa1ece Author: Thaddeus Crews Date: Fri Nov 22 14:54:28 2024 -0600 Merge pull request #99416 from adamscott/set-thread-count-for-single-threaded Force `get_thread_count()` to `1` if single threaded commit a0211b0f2e54d277fbbc5dc71589f22a7db7167c Merge: e7b11d1c99 e1fa489f77 Author: Thaddeus Crews Date: Fri Nov 22 14:54:27 2024 -0600 Merge pull request #99533 from crei0/look_at_modifier3d_documentation_data_typos Fix wording in `LookAtModifier3D` docs commit e7b11d1c995beebe69c3102da45921644afd687b Merge: fca3a224c4 7a25173ff4 Author: Thaddeus Crews Date: Fri Nov 22 14:54:26 2024 -0600 Merge pull request #99527 from RandomShaper/fix_threaded_trans Make loading translations from threads safe commit fca3a224c4d3853b63b022381172181a5caeeb13 Merge: fe1c044c73 24d51f7635 Author: Thaddeus Crews Date: Fri Nov 22 14:54:25 2024 -0600 Merge pull request #99525 from bruvzg/win_tts_sync_events [Windows] Fix TTS events arriving out of order. commit fe1c044c7398df8fb22913427665e77de6a98a14 Merge: 336eeda6f8 755bcf4737 Author: Thaddeus Crews Date: Fri Nov 22 14:54:24 2024 -0600 Merge pull request #99394 from TokageItLab/root-local Add `root_motion_local` option to AnimationMixer to pre-multiply root motion rotation accumulator before blending commit 336eeda6f8e1c2c8e5a777a373296a9defc0dbc9 Merge: d2bfbd759e acf351fa6a Author: Thaddeus Crews Date: Fri Nov 22 14:54:23 2024 -0600 Merge pull request #99521 from mechalynx/update-packedarray-class-descriptions Correct PackedInt64Array comparison in description commit d2bfbd759e462c9bb01cb4cc0a150c265d3ad307 Merge: c35e4c41d2 c57eaf7757 Author: Thaddeus Crews Date: Fri Nov 22 14:54:22 2024 -0600 Merge pull request #97216 from markeel/issue_97207_filter_extension_list_cfg Ensure excluded GDExtension files are not included in `extension_list.cfg` commit c35e4c41d2dc6ccbc74ddb28d1dcf082468feec9 Merge: cef0c3548e eb86670f94 Author: Thaddeus Crews Date: Fri Nov 22 14:54:19 2024 -0600 Merge pull request #97716 from pafuent/add_half_precision_floating_point_to_stream_peer Add half precision floating point support to `StreamPeer` and `FileAccess` commit cef0c3548e5eb1c40a1819511cde68de07da9387 Merge: a82f4c5d64 c874e284eb Author: Thaddeus Crews Date: Fri Nov 22 14:54:18 2024 -0600 Merge pull request #99498 from carsonetb/mesh-gen-optimization Optimize mesh generation by preventing unneeded shape recalculations commit a82f4c5d64fcbd335a8df6d71185139ff7a344a4 Merge: eedc820f37 250de088e3 Author: Thaddeus Crews Date: Fri Nov 22 14:54:17 2024 -0600 Merge pull request #97061 from YeldhamDev/rtl_l18n_fix Fix `RichTextLabel`'s modified stack being wiped on translation changes commit eedc820f37680a3cb8b4b4b52779cf2ced5915be Merge: 757a1d3c90 5cd0d42d2b Author: Thaddeus Crews Date: Fri Nov 22 14:54:16 2024 -0600 Merge pull request #99487 from passivestar/fix-viewport-offsets Fix viewport message offsets commit 757a1d3c90f0793676317dfc13ee20c751389153 Merge: fae3a28628 ae853e1a42 Author: Thaddeus Crews Date: Fri Nov 22 14:54:16 2024 -0600 Merge pull request #99102 from Lazy-Rabbit-2001/autocompletion-optimization Improve GDScript autocompletion for methods commit fae3a286280b9afd43b7bb38412c36e3d81c9391 Merge: f2763b23cf 4e5080d805 Author: Thaddeus Crews Date: Fri Nov 22 14:54:15 2024 -0600 Merge pull request #99485 from raulsntos/dotnet/dictionary-compat [.NET] Preserve no-hint behavior for unmarshallable generics in dictionaries commit f2763b23cf7c410ad5b679c5c0c32a9064d0b996 Merge: d6ad0f65d8 5bca028e2b Author: Thaddeus Crews Date: Fri Nov 22 14:54:14 2024 -0600 Merge pull request #99483 from badsectoracula/cancel_lightmap_bake Add lightmap bake cancelling commit d6ad0f65d84489081d05dbe9e731e02e1a93be28 Merge: 47f3e95308 61cf0253ce Author: Thaddeus Crews Date: Fri Nov 22 14:54:13 2024 -0600 Merge pull request #99482 from Giganzo/toast_and_spam Fix toast spam about child of container position commit 47f3e953085a61eb619876959639c21b7b35b5c1 Merge: 0430b977b6 e0b13004a0 Author: Thaddeus Crews Date: Fri Nov 22 14:54:12 2024 -0600 Merge pull request #99352 from Mickeon/documentation-aabb-coords-are-complicated Fix incorrect Z direction for AABB's position commit 0430b977b613fc22268ba9e3102b378ffc0a76c9 Merge: c1b4e06fa0 9ab94df772 Author: Thaddeus Crews Date: Fri Nov 22 14:54:11 2024 -0600 Merge pull request #99348 from TokageItLab/explicit_elapse Add `explicit_elapse` option to AnimationNodeTimeSeek to handle some processes commit c1b4e06fa03a5a4aa438072487d795255ade8ddb Merge: d58d8914db 2b68c63a88 Author: Thaddeus Crews Date: Fri Nov 22 14:54:10 2024 -0600 Merge pull request #98835 from clayjohn/Light2D-shadow-mask Mask out shadows on CanvasItems that don't have a matching `item_shadow_mask` commit d58d8914dbaef814c4849cd5997012f24e474413 Merge: fd4bddbeaf f6751d8d17 Author: Thaddeus Crews Date: Fri Nov 22 14:54:09 2024 -0600 Merge pull request #99461 from beicause/color-picker-fix-68286 ColorPicker: fix OKHSL circle in HSV mode commit fd4bddbeaf9e7f30eccb5b61ef5e0ef1023afb35 Merge: f952bfe998 5f8df2ca63 Author: Thaddeus Crews Date: Fri Nov 22 14:54:08 2024 -0600 Merge pull request #98946 from timothyqiu/3d-index Remove unnecessary `_3D_DISABLED` checks in `Performance` commit e210313045cc4de77c654f7cabf4c810c957f3fe Author: kobewi Date: Fri Nov 22 21:44:27 2024 +0100 Fix stringification of Vector4 commit 289e548e3477afe73a509cd3888b0dbb716735cb Author: kobewi Date: Fri Nov 22 01:09:24 2024 +0100 Untangle ColorPicker includes commit e0b13004a0f48b61cefdf8e469f6d623c17f1932 Author: Micky Date: Sun Nov 17 11:53:12 2024 +0100 Fix incorrect Z direction for AABB's position commit 5559075844c2d3f3d6cb24470a08fe7fb43d4ad6 Author: Christian Kaiser Date: Sat Jul 20 22:22:51 2024 -0300 Fix graph node sizing regression, improve blend tree contrast/margins commit 250de088e3a0f303a393405ebdaa40c7dce62550 Author: Michael Alexsander Date: Sun Sep 15 19:17:23 2024 -0300 Fix `RichTextLabel`'s modified stack being wiped on translation changes commit 0542bccee0a4804bc79fda4515e30161ab227d48 Author: vPumpking Date: Wed Oct 9 15:57:30 2024 +0200 Improve space management for EditorFileDialog Move buttons related to the file view on the container above so that they take less horizontal space and make search bar similar to the one in FileDialog commit ff6eea50423867f63764e3b85d3ad79c21119085 Author: AThousandShips <96648715+AThousandShips@users.noreply.github.com> Date: Fri Nov 22 17:42:58 2024 +0100 Prevent infinite recursion in first `_draw` commit e8a4b45ce4adcbafb78048b207a87f453543fa93 Author: Thaddeus Crews Date: Fri Nov 22 09:22:15 2024 -0600 Style: Add 19.1.0 LLVM options to `.clang-format` commit bead829fd5d40aa86ff5372b2edff6924bbe01fe Author: jtcat Date: Fri Nov 22 14:59:40 2024 +0000 Fix inspector section iteration in `update_tree` commit e1fa489f77db7c022c197434e001b76d2835526d Author: André Guedes Date: Fri Nov 22 12:40:04 2024 +0100 Fix wording in LookAtModifier3D docs commit 03b05cf9acd69b7eeced919012c215b22cd901ab Author: Danil Alexeev Date: Fri Nov 22 14:03:21 2024 +0300 Core: Fix built-in enum constant bindings commit ae853e1a428234692d7860ca09c46aad2bf7944e Author: Lazy-Rabbit-2001 <2733679597@qq.com> Date: Fri Nov 22 18:24:45 2024 +0800 Improve GDScript autocompletion for methods commit 24d51f763500479aa4a676f255123b4294920224 Author: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Fri Nov 22 10:15:46 2024 +0200 [Windows] Fix TTS events arriving out of order. commit 7a25173ff469b3b593cb8a5a311617c5cde9b80a Author: Pedro J. Estébanez Date: Fri Nov 22 09:44:07 2024 +0100 Make loading translations from threads safe commit 2b68c63a886f1442f7afdb91f6bae16e755325cc Author: clayjohn Date: Mon Nov 4 21:21:38 2024 -0800 Mask out shadows on CanvasItems that don't have a matching item_shadow_mask This restores the behavior from 3.x commit acf351fa6aee36199f5f5c6665f48993622aa16f Author: mechalynx <8427257+mechalynx@users.noreply.github.com> Date: Fri Nov 22 07:12:56 2024 +0200 Update PackedVector4Array description to include explanation shared by PackedArray classes commit 133cf62d26abd5dd75655e2b9336c9c253b5b007 Author: mechalynx <8427257+mechalynx@users.noreply.github.com> Date: Fri Nov 22 06:23:06 2024 +0200 Correct PackedInt64Array comparison in description All Packed classes that have the same paragraph will compare the currently viewed Packed array type with the equivalent typed Array but here the comparison was with the Int32 version instead of the Int64 version commit c874e284ebd0551f14d0ebed5ed2ecfce8ebf1fc Author: Carson Bates Date: Tue Nov 19 20:04:41 2024 -0800 Optimize mesh generation by preventing unneeded shape recalculations Co-authored-by: Sequoia Haynes commit f952bfe9985ad8f507cc29b2c7601bbba18b8039 Merge: 0d8352bd96 6f4fadf65d Author: Thaddeus Crews Date: Thu Nov 21 17:57:01 2024 -0600 Merge pull request #98972 from dbnicholson/standardize-add-defaults Expose `TranslationServer::standardize_locale` `add_default` param publicly commit 0d8352bd968833e3fde6488ac4ff5210b651645e Merge: 797c8bd85f 429ea1c8e3 Author: Thaddeus Crews Date: Thu Nov 21 17:57:00 2024 -0600 Merge pull request #99511 from Mickeon/documentation-audio-stream-typo Fix typo in AudioStream's documentation commit 797c8bd85f24585437daf396176a53ad48b38883 Merge: 9d54981627 6467beb75d Author: Thaddeus Crews Date: Thu Nov 21 17:56:59 2024 -0600 Merge pull request #99351 from dustdfg/scons_android_refactor SCons: Move `swappy` option to android and slightly refactor `detect.py` commit 9d54981627c7767b6eadcd9c09fb49cf4323c9da Merge: 2993289172 b4f8135d46 Author: Thaddeus Crews Date: Thu Nov 21 17:56:58 2024 -0600 Merge pull request #99061 from Faless/web/editor_not_api [Web] Fix Web Editor plugin being added to SCons multiple times commit 2993289172d60ff02554a9be3034b9347c15e5c6 Merge: 5289709753 5de38f7fd3 Author: Thaddeus Crews Date: Thu Nov 21 17:56:57 2024 -0600 Merge pull request #86481 from Illauriel/add-animlib-folding Add persistent folding to Animation Library Editor commit 528970975309c7183e6d5088c0859f9d8437964c Merge: 03d9d4f7ed edd6acdfd4 Author: Thaddeus Crews Date: Thu Nov 21 17:56:56 2024 -0600 Merge pull request #99409 from passivestar/state-machine-focus-border-color Expose state machine focus color to theming commit 03d9d4f7eddaf3497034432ea14e674edb07bf05 Merge: 030cc69771 0896bdd7bc Author: Thaddeus Crews Date: Thu Nov 21 17:56:55 2024 -0600 Merge pull request #99472 from dustdfg/scons_misc_sconstruct_tidying SCons: Misc improvements commit 030cc697719ee3bc275f3b58ab5a4f536a967aa7 Merge: b25c7e31ea 64077ff3de Author: Thaddeus Crews Date: Thu Nov 21 17:56:53 2024 -0600 Merge pull request #96399 from andyprice/fileperms Unix: Don't create world-writable files when safe save is enabled commit b25c7e31eadd82addd528e5d78c4857a83c9f87a Merge: 579c19a9ce 31c8aadc47 Author: Thaddeus Crews Date: Thu Nov 21 17:56:52 2024 -0600 Merge pull request #99501 from AThousandShips/fix_cache_time [Buildsystem] Prevent cache check mangling access time commit 579c19a9ce15eca504b3e07be72b7e0c5fd4c383 Merge: d967befc42 84db024f6f Author: Thaddeus Crews Date: Thu Nov 21 17:56:50 2024 -0600 Merge pull request #99274 from shana/vsproj-calculate-dependencies Use scons to calculate all the sources needed for vsproj generation. commit d967befc4228f020c1c8b40d9606755ffd3143f3 Merge: 0eca686191 f4c1f89add Author: Thaddeus Crews Date: Thu Nov 21 17:56:49 2024 -0600 Merge pull request #99465 from aaronfranke/arch-bit-has-feature Suggest using OS.has_feature instead of the engine architecture name for bitness commit 0eca686191d0c90735b93ef5d97a1df3e6b53d75 Merge: 38ebcf92ed 117158d271 Author: Thaddeus Crews Date: Thu Nov 21 17:56:48 2024 -0600 Merge pull request #99270 from Sauermann/fix-svc-drop-config Introduce a `SubViewportContainer` config for drag-and-drop target locations commit 38ebcf92edb6d4f3e8ab490d40be2783fb27aeb5 Merge: 80565ffc11 8bfb631afc Author: Thaddeus Crews Date: Thu Nov 21 17:56:47 2024 -0600 Merge pull request #99463 from DarioSamo/rd-partial-coverage-fix-part-two Do not check for command intersections when not using the write list. commit 80565ffc116e6054f76fc785f22ded162c1a73cc Merge: 8eee5066eb a0c47980c0 Author: Thaddeus Crews Date: Thu Nov 21 17:56:46 2024 -0600 Merge pull request #99462 from AThousandShips/fix_codeowner_tests [Codeowners] Add missing test ownership commit 8eee5066eb48101b5a9dfe4d3c82adef69bd2637 Merge: d11c1a4c00 a64b3fd3f8 Author: Thaddeus Crews Date: Thu Nov 21 17:56:45 2024 -0600 Merge pull request #94981 from Chaosus/shader_fix_screen_uv_in_spatial_light Allow `SCREEN_UV` to be used in light function of spatial shader commit d11c1a4c0091b38d9c046f7d5c8b7711e2ba3d4c Merge: 1117d91704 0524e29b5c Author: Thaddeus Crews Date: Thu Nov 21 17:56:44 2024 -0600 Merge pull request #95172 from Chaosus/gdscript_fix_vector_division_by_zero_crash Fix crash when division by zero/modulo by zero happen on vectors commit 1117d9170498e85510d8a19b0efb01c723a294c1 Merge: 9e6098432a 3ab88c2e6a Author: Thaddeus Crews Date: Thu Nov 21 17:56:43 2024 -0600 Merge pull request #99200 from KingTheFifth/master Document `AudioStreamPlayer.get_playback_position()` intentionally aways returning `0.0` when using `AudioStreamInteractive` commit 6f4fadf65def83a6a6c885e4aaa11f8982f37916 Author: Dan Nicholson Date: Thu Nov 7 10:59:02 2024 -0700 Expose standardize_locale add_default param publicly Comparing locales can have surprising outcomes since it standardizes locales with defaults. For example, zh and zh_CN result in an exact match since the defaults change them both to zh_Hans_CN. Expose the add_default parameter publicly with a default of false so the fully standardized locale can be inspected. commit 48fbe4172b682ca319316a1f129f622e240ebad7 Author: Hunt J. Sparra <19802403+HuntJSparra@users.noreply.github.com> Date: Tue Nov 5 14:21:44 2024 -0500 Register Engine, OS, ProjectSettings, and Time early. commit 429ea1c8e34b136db5737fa1bc71d432193b33ad Author: Micky Date: Thu Nov 21 21:33:55 2024 +0100 Fix typo in AudioStream's documentation commit 7f37e886584c9e4d6d788f9355f6d47a9d030c2d Author: Pāvels Nadtočajevs <7645683+bruvzg@users.noreply.github.com> Date: Wed Nov 20 10:59:48 2024 +0200 Fix SVG font rendering. commit c4bb252294f9e081809df0cd9ff47009136af01d Author: Giganzo <158825920+Giganzo@users.noreply.github.com> Date: Thu Nov 21 20:23:24 2024 +0100 Change how multi selection scale is applied to canvas item commit 4e5080d8057422cd9b21bfa19be667d1cb680e15 Author: Raul Santos Date: Wed Nov 20 20:48:38 2024 +0100 [.NET] Preserve no-hint behavior for unmarshallable generics in dictionaries commit 5bca028e2bd5cde8a9a06fc1a4469cafa28d362b Author: Bad Sector Date: Thu Nov 21 03:00:21 2024 +0200 Add lightmap bake cancelling commit f86dcd4e67a7e715233cc87a265e8ef79a27348d Author: Danil Alexeev Date: Thu Nov 21 21:45:56 2024 +0300 GDScript: Support tracking multiple analyzer and runtime errors in tests commit 31c8aadc47170abce59226cf5b4ca547a7636f7b Author: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Date: Thu Nov 21 17:43:00 2024 +0100 [Buildsystem] Prevent cache check mangling access time Checking for text files using `open` changes `atime`, which breaks cache access sorting, this ensures the cache access time is preserved. commit c57eaf77571765461a83cde7e01a57460f02ff87 Author: mendrak Date: Thu Sep 19 20:56:02 2024 -0700 Fix issue #97207 by filtering extension_list.cfg The implemented solution to the problem of the error message appearing when an excluded GDExtension in an export of a project, is to filter the lines in the extension_list.cfg file to only include those that are in the paths actually included for export. If there are no entries remaining, don't write the file at all. commit 0524e29b5cf9b4b099e7f2a7be09f21fd80e1e14 Author: Chaosus Date: Mon Aug 5 22:36:55 2024 +0300 Fix crash when division by zero/modulo by zero happen on vectors commit 1a082fdd8038d6a4f0f7d9c335a2c7ea440566d1 Author: Adam Scott Date: Wed Nov 6 13:20:51 2024 -0500 Ensure editor crossorigin isolation headers commit 84db024f6f68e44bff84a04fa737aefad31dd81a Author: Andreia Gaita Date: Fri Sep 13 21:38:26 2024 +0200 Use scons to calculate all the sources needed for vsproj generation. Scons knows every file - sources, headers, etc - that the binary depends on, and trying to figure that out manually is just too prone to error. commit f6751d8d174c01aee3fb50e213acb11c75bb13be Author: LuoZhihao Date: Wed Nov 20 19:34:31 2024 +0800 ColorPicker: fix OKHSL circle in HSV mode commit 5cd0d42d2bbca7e05472d383c8c91ba99988ea22 Author: passivestar <60579014+passivestar@users.noreply.github.com> Date: Thu Nov 21 08:24:08 2024 +0400 Fix viewport message offsets commit 0896bdd7bc9d0f23d225a0b6b8209700e4d8e9d1 Author: Yevhen Babiichuk (DustDFG) Date: Wed Nov 20 18:18:12 2024 +0200 SCons: Misc improvements * Delete old gcc 7 check * Use f-strings where it is easy * Use AddVariables instead of Add for collections of options Signed-off-by: Yevhen Babiichuk (DustDFG) commit f4c1f89add61c819b7fbbfa299d1b8a24db8475b Author: Aaron Franke Date: Wed Nov 20 06:33:18 2024 -0800 Suggest using OS.has_feature instead of the engine architecture name for bitness commit 9ab94df7725d4a31d28056630fe6038d64c92b5a Author: Silc Lizard (Tokage) Renew <61938263+TokageItLab@users.noreply.github.com> Date: Sun Nov 17 18:25:52 2024 +0900 Add explicit_elapse option to NodeSeek to handle some processes commit 8bfb631afc0d8f4e7a4c5ee073c53069d667b00d Author: Dario Date: Wed Nov 20 10:04:17 2024 -0300 Do not check for command intersections when not using the write list. commit a0c47980c07128314341fe802f2319844114baca Author: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Date: Sat Nov 16 16:35:26 2024 +0100 [Codeowners] Add missing test ownership commit 6467beb75dbba17bf89b05abed61d7712baa9a10 Author: Yevhen Babiichuk (DustDFG) Date: Sat Nov 16 21:58:23 2024 +0200 SCons: Move `swappy` option to android and slightly refactor `detect.py` Signed-off-by: Yevhen Babiichuk (DustDFG) commit 0cf99cf95d098392d7d1943aac37b12bd831a1d9 Author: Hugo Locurcio Date: Thu Aug 24 18:22:20 2023 +0200 Add a Viewport method to get automatically computed 2D stretch transform `Viewport.get_stretch_transform()` returns the automatically computed 2D stretch transform. Combined with `Transform2D.get_scale()`, this is useful when using the `canvas_items` stretch mode in a project. There are many situations where knowing this factor is useful: - Divide Camera2D zoom to keep the size of the 2D game world identical regardless of the 2D scale factor (so that UI elements can still be scaled). - Make certain controls always drawn at 1:1 scale (e.g. for the crosshair in a FPS). This is done by dividing the Control node's scale by the scale factor. commit 117158d2718d11c5026f4e2791c7784b4815d0aa Author: Markus Sauermann <6299227+Sauermann@users.noreply.github.com> Date: Fri Nov 15 09:28:57 2024 +0100 Introduce a `SubViewportContainer` config for drag-and-drop targets With the drag-and-drop rewrite, `SubViewportContainer` nodes were no longer available as drop-locations. This PR introduces a configuration option, that allows `SubViewportContainer` to be considered as drop-location, but disables the `Control` nodes inside its `SubViewport` children as drop-location. commit 3ab88c2e6a9adf8226aa1f7b572135d97f02e8eb Author: Johannes Kung Date: Wed Nov 13 21:50:31 2024 +0100 Document `AudioStreamPlayer.get_playback_position()` intentionally always returning `0.0` when using `AudioStreamInteractive` commit 5de38f7fd35606e1f494d81919f094e5e7baf0c0 Author: Illauriel Date: Sun Dec 24 03:57:36 2023 +0100 Add persistent folding to Animation Library Editor commit 57541d53d3ca1b0de4edac56ba65f7d2f1306470 Author: Anish Mishra Date: Mon Nov 18 15:42:05 2024 +0530 Android: Extension support for native file dialog commit 5e09d747e8fc9a0000e93b78741a4c8f140d6ea9 Author: Anish Mishra Date: Tue Nov 19 21:27:46 2024 +0530 Revert "Add warning when monochrome icon is not specified" This reverts commit a84292e8358c6e73cbb22dcbf7613fde564ee17b. commit 0ff5d5fd046bda499648259642c16f677d439c74 Author: passivestar <60579014+passivestar@users.noreply.github.com> Date: Sun Oct 6 17:10:05 2024 +0400 Add theme type variations for secondary Trees and ItemLists commit 6ba86c3852dffecb1aaa9dfcbef58e8559bba95e Author: passivestar <60579014+passivestar@users.noreply.github.com> Date: Tue Nov 19 08:19:05 2024 +0400 Disable the debugger thread selector when there's nothing to select commit 61cf0253ce4204d2911cd91d15ec9a2c78c78c7d Author: Giganzo <158825920+Giganzo@users.noreply.github.com> Date: Tue Nov 19 11:25:28 2024 +0100 Fix toast spam about child of container position commit a64b3fd3f81b785ea9b3c2d96e66f124122bad5e Author: Chaosus Date: Wed Jul 31 18:33:16 2024 +0300 Allow `SCREEN_UV` to be used in light function of spatial shader commit 4988fa1ece653938e07ee3bbc89a9bafea5ef7ea Author: Adam Scott Date: Mon Nov 18 22:27:17 2024 -0500 Force `get_thread_count()` to `1` if single threaded commit 755bcf47373bae9bd717b56a1d60765e7f3144bc Author: Silc Lizard (Tokage) Renew <61938263+TokageItLab@users.noreply.github.com> Date: Mon Nov 18 22:16:59 2024 +0900 Add root_motion_local option to AnimationMixer commit edd6acdfd4f00bd9476054b534df74c003d010de Author: passivestar <60579014+passivestar@users.noreply.github.com> Date: Tue Nov 19 01:14:09 2024 +0400 Expose state machine focus color to theming commit b4f8135d4692e8fd85e38f37e42bf4de2dca9391 Author: Fabio Alessandrelli Date: Mon Nov 11 11:30:41 2024 +0100 [Web] Fix Web Editor plugin being added to SCons multiple times Move the Web Editor plugin files to an editor sub-folder inside the platform folder. commit f5b49af99fb63980ab05d8f909621393e4bfc2a6 Author: Silc Lizard (Tokage) Renew <61938263+TokageItLab@users.noreply.github.com> Date: Sat Oct 5 06:00:39 2024 +0900 Add RetargetModifier3D for realtime retarget to keep original rest commit f37c72fcdcc54e5aea753aecc371718dcf3b0fe9 Author: Bad Sector Date: Mon Nov 18 14:55:19 2024 +0200 Update gridmap editor cursor and selection node transformations whenever the gridmap node's transformation changes commit 56d01fb46731c07503ee80ff774fa9aab4522e82 Author: Pablo Andres Fuente Date: Thu Oct 24 09:42:43 2024 -0300 Show file names in the remove files confirmation dialog Closes #85261 Co-authored-by: jsjtxietian commit b31cc6960d20b758b2ad6d3a3d497a9d7964823e Author: Thaddeus Crews Date: Sat Nov 16 13:16:48 2024 -0600 CI: Bump SCons to latest (4.8.0 → 4.8.1) commit 0a4dd371b7a2b8d6a832e7207906b88e9649fc08 Author: colinator27 <17358554+colinator27@users.noreply.github.com> Date: Sat Nov 16 11:41:35 2024 -0500 Implement get_bar_beats() for AudioStreamSynchronized, fix division by zero commit 2f620db1d894533a8e859843b840801bf54cd86c Author: HolonProduction Date: Fri Nov 15 19:32:00 2024 +0100 LSP: Fix spec violations that break the VSCode outline commit d683ea4772998ea402cbbc4ef03a2166f353d6fa Author: Hugo Locurcio Date: Thu Nov 14 16:27:05 2024 +0100 Update Z Index property location in Node2D class reference The Z Index property is in CanvasItem since Godot 4.0, so it's shared among Node2D and Control. commit ed7b4f5c4a998e3ff5bd420209fca7c2fba28fd5 Author: Pāvels Nadtočajevs <7645683+bruvzg@users.noreply.github.com> Date: Tue Nov 12 09:55:13 2024 +0200 [Linux] Use safe IDs for native file dialog options. commit a46ea9d064c379fc121d18798a525000a08b35a9 Author: Pedro J. Estébanez Date: Tue Nov 12 14:02:10 2024 +0100 Deprecate the pointless unsafe threading model for rendering commit b329b4ab06873fdbfdeb6030a171bba8dff04939 Author: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Mon Oct 28 10:37:07 2024 +0200 [Label] Handle text as multiple independent paragraphs. commit 8c4a9ad626d16e8a1c98b4bf7b98439a9fce77fe Author: PhairZ Date: Wed Nov 13 19:51:38 2024 +0200 fix fade_beats defined as int in audio_stream_interactive.h commit a5caeeb664e5fb8d0141786585d3dc790c9c4b72 Author: Pedro J. Estébanez Date: Wed Nov 13 10:45:43 2024 +0100 SpinLock: Overhaul false sharing avoidance commit c6492de27bd17799a6887607b1d0a903ec4a8dde Author: Mateus Reis Date: Mon Apr 10 22:23:28 2023 +0300 Profiler plot zoom and pan commit eb86670f94ef505e9b4adc37bc0948a3a5588ed8 Author: Pablo Andres Fuente Date: Tue Oct 1 23:41:13 2024 -0300 Add half precision floating point support to `StreamPeer` Closes godotengine/godot-proposals#5983 Adds put/get methods to `StreamPeer` that handles half precision floating point values. Adds endode/decode half precision floating point to `marshalls`. Adds `get_half` and `store_half` to `FileAccess` Co-Authored-By: "Alfonso J. Ramos" commit 5769c801960552b3a67faf3d5b0607718df1a3b8 Author: MewPurPur Date: Tue Nov 12 12:35:41 2024 +0200 Add minimum size to some debugger elements commit f789025d427ae7e12d7b3312f568370f083e30ef Author: Micky Date: Mon Nov 11 22:21:59 2024 +0100 Add documentation note on Object's boolean context commit 3e8a24d0da204eb5100b15efcc1aeff4228bf291 Author: Hugo Locurcio Date: Mon Nov 11 19:51:54 2024 +0100 Display CPU and GPU model name in the editor visual profiler This shows the information from the remote device, which will typically differ from the local device in remote debugging scenarios. commit 1768a1b991093857d424d720945020129c01a9c3 Author: Felix Yuan Date: Sun Nov 10 21:11:52 2024 -0800 Remove deprecated worker.js file commit 22caab0248071b2c7f852f302f30745d1c99e77d Author: FlooferLand! <76737186+FlooferLand@users.noreply.github.com> Date: Mon Nov 11 18:36:58 2024 +0200 Add note about LightmapGI only baking nodes under its parent `LightmapGI`'s documentation currently doesn't mention the fact it only bakes nodes under its parent. This can make the user think there is something wrong with their scene setup or 3D models, as it refuses to bake when the user's models / world isn't under the same parent as the `LightmapGI`. commit 9625fdc1d747c03c8e642f73c9fff02aa7e9bb09 Author: yahkr <62478788+yahkr@users.noreply.github.com> Date: Mon Nov 11 08:33:47 2024 -0500 Fix float value used for MONITOR_TYPE_QUANTITY commit 09b6466e1414d75c9497a6af4c4eb37d4358a777 Author: Haoyu Qiu Date: Mon Nov 11 15:54:11 2024 +0800 Translate the name of the debugger session tabs commit c363e130519281d9bdaf421d9ba84ad33564d38d Author: Pāvels Nadtočajevs <7645683+bruvzg@users.noreply.github.com> Date: Sun Nov 10 21:45:32 2024 +0200 [Windows] Rename `PKEY_Device_FriendlyName` to avoid duplicate symbols with newer MinGW SDKs. commit 761a20f7a720864af1c43747f5ac31b9915d04e3 Author: Silc Lizard (Tokage) Renew <61938263+TokageItLab@users.noreply.github.com> Date: Sun Aug 18 04:00:43 2024 +0900 Add hint for oneshot & warning when it will be updated continuously commit dd1372b78e8182c1f15c7e113a7ffc75b75f8ef3 Author: rune-scape Date: Mon Jun 17 18:43:02 2024 -0700 various gui nodes now listen for the changed signal on textures commit 5f8df2ca63369fbb0c7b29aad03d44ad1b337c3c Author: Haoyu Qiu Date: Fri Nov 8 11:49:47 2024 +0800 Remove unnecessary `_3D_DISABLED` checks in `Performance` commit 6445b6cbdda85ecf720fa5caea41073a0aaa3448 Author: Anish Mishra Date: Thu Nov 7 18:29:25 2024 +0530 Android: Fix immersive mode issue commit a5f86ee07e401d0191b338c4de440c2665d499e8 Author: Pedro J. Estébanez Date: Thu Nov 7 12:13:08 2024 +0100 Raise the amount of file handles on Windows commit 109bee08dd093e065abcdd888c37ff8f47735eb5 Author: Aaron Franke Date: Wed Oct 30 02:57:55 2024 -0700 Blend file import: Don't keep original files when not unpacking them commit dafba55c69a562844099b144a6eac5010e053d48 Author: Hugo Locurcio Date: Sat Nov 2 18:25:17 2024 +0100 Don't tint editor bottom panel icons when hovered or pressed This prevents the error/warning icons from turning gray or green, making them hard to recognize. A similar mechanism is already used for EditorLog filter button icons. This also fixes typos in FileDialog theme color assignment (`icon_color_pressed` instead of `icon_pressed_color`). The exposed theme item names remain the same. commit 6c6521348732580afd45413f6bc0c5f63dfa6ce6 Author: ocean (they/them) Date: Sat Jul 1 22:56:23 2023 -0400 Extend `Curve` to allow for arbitrary domains commit 25067420131ba93fd02fbfced3775d204965c901 Author: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Fri Nov 1 23:44:14 2024 +0200 [Editor] Copy encryption and script settings on export preset duplication. commit e81a2afbc49715eea0f82875721b1cc5f99414a9 Author: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Wed Oct 30 11:14:11 2024 +0200 [TextServer] Reset subpixel shift on blank glyphs and import option to enable/disable it. commit e6eeaf28df19c9e8b5acef44c1b38f174b1fce99 Author: yds Date: Tue Oct 29 19:11:19 2024 -0300 Add editor setting to stop the bottom panel from switching to the stack trace commit bf9f78c353b5904facac75b7c45e065a6e4b131e Author: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Tue Oct 29 09:32:49 2024 +0200 [Windows] Fix restoreing fullscreen window. commit 4036270f8d2e19f8e2c71cd05800d6cd0af5e2ed Author: jpetersen Date: Mon Sep 23 10:01:49 2024 -0700 Support for XCode 8+ feature PROVISIONING_PROFILE_SPECIFIER https://developer.apple.com/documentation/xcode/build-settings-reference\#Provisioning-Profile Used to allow for specific provisioning profile to be specified by name instead of UUID. Needed to solve this problem where uuid wasn’t disambiguating: https://stackoverflow.com/questions/45051712/signing-app-with-xcodebuild-command-line-with-provisioning-profile-fails Allows for specification for release and debug versions through environment variables or through export template attributes. Debug: EnvironmentVariable: GODOT_IOS_PROFILE_SPECIFIER_DEBUG Export template: “application/provisioning_profile_specifier_debug” Release: EnvironmentalVariable: GODOT_IOS_PROFILE_SPECIFIER_RELEASE Export Template: “application/provisioning_profile_specifier_release” commit db1c1d43e3c21a6cd981215380818d34c9fc9b55 Author: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Mon Oct 28 11:34:42 2024 +0200 [Misc] Check for the available and installed Vulkan SDK versions before downloading and installing. commit 335b42d4372653412e63a16bc220372a03be7c4f Author: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Sun Oct 27 16:54:03 2024 +0200 Remove button number limit from Windows dialog_show() implementation. commit 893ce62967b08e337a72ecd965caf837d2117f2b Author: yds Date: Sat Oct 26 18:41:16 2024 -0300 Fix `ColorPicker`'s remote synchronization when typing values commit cb94652c3413f8a0da16d1db6b920958d0e0fe5a Author: yds Date: Sat Oct 26 02:45:54 2024 -0300 Fix `MultiMesh` errors in editor and resource duplication commit 771e561cdd50b01f224e3ace5f2c0c04dd9bdc0c Author: Florent Guiocheau Date: Thu Oct 24 11:55:49 2024 +0200 Fix Camera3D::project_position() when depth=zfar commit 503574441e1d9d40da0dc13a50ed9fea5790e218 Author: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Wed Oct 23 10:15:20 2024 +0300 [RTL] Allow setting image alignment as separate bbcode argument. commit 05b266bd8950330935c51938e0ebe159d87316c8 Author: Keegan McGonigle <31631874+thedinosoar@users.noreply.github.com> Date: Thu Oct 10 11:21:50 2024 -0700 Fix PWA callback assignment and error handling commit d5fbc7dab1d4d417e4b4f9e9db680135b4636055 Author: kobewi Date: Tue Oct 22 15:52:29 2024 +0200 Improve Scale Selection in Animation tab commit 2191df0cea66f895e3c51f624052c83dcc5d3f47 Author: tetrapod00 <145553014+tetrapod00@users.noreply.github.com> Date: Mon Sep 23 17:50:30 2024 -0700 VisualShader: Add LinearToSRGB and SRGBToLinear to ColorFunc node commit edde380e9cb1545d77e99bba99aaf55f55e7dc86 Author: Yevhen Babiichuk (DustDFG) Date: Tue Oct 1 20:03:21 2024 +0300 Editor: forbid deleting inherited metadata properties Signed-off-by: Yevhen Babiichuk (DustDFG) Co-authored-by: Tomek commit af926854455bba29658271dee7b8d0ce7556bfaa Author: Marius Hanl Date: Mon Sep 2 00:28:44 2024 +0200 Fix jumping to editor help does not scroll correctly sometimes commit 14dd5954476da8a9a40b8733cdeb04b66ca46c0e Author: Anish Mishra Date: Wed Oct 9 16:32:52 2024 +0530 Fix uneditable LineEdit, TexEdit and CodeEdit Virtual Keyboard popup commit 891173b3ea6f9bca531100f17e912c4ce9091fad Author: passivestar <60579014+passivestar@users.noreply.github.com> Date: Sun Jul 7 14:46:14 2024 +0400 [macOS] Change the shortcut for Align Transform with View commit 0d7027ea4c7fb1862efeab2cc95e079ff97fc65d Author: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Sat Oct 12 16:48:49 2024 +0300 Add support for 24-bit color escape sequences, simplify `print_rich` BBCode parsing. commit 3e30dd79547bbba9cac337f930de50614cfbdac2 Author: Zae Date: Thu Oct 10 03:08:04 2024 +0800 Fix incorrect drag preview position under transformed CanvasLayer. commit 7ed90a4f075f2a8c79b967684dd7ba328154ddaa Author: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Tue Oct 8 09:58:54 2024 +0300 [RTL] Add support for vertical alignment. commit cd269b825f35fca5e2e1bba6bfcb44742b57343e Author: Alex Darby Date: Tue Dec 5 14:11:09 2023 +0000 Make File Dialog case insensitive Change FileDialog and EditorFileDialog to use case insensitive string comparisons when saving files to avoid duplicate file extensions. commit 3345f90bf39459a197334e5e066c4d96849e3d5f Author: passivestar <60579014+passivestar@users.noreply.github.com> Date: Mon Oct 7 15:49:33 2024 +0400 Fix plugin creation dialog script name tooltip commit 41a1a7f94becabae9e2aab41790735393e69f6ef Author: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Wed Aug 14 10:42:59 2024 +0300 Reshape and update button on oversampling change. commit 87709cfdf2922dbd5f7ba45694205b8ca7e69fc8 Author: Hugo Locurcio Date: Thu Sep 26 00:08:06 2024 +0200 Remove verbose prints from CameraServer on Linux due to being printed every second commit e5fada9cd1c344c9499736dc4604f121a8746118 Author: aaronp64 Date: Mon Sep 23 10:37:32 2024 -0400 Keep existing VectorCompose input values when setting vector type VisualShaderNodeVectorCompose::set_op_type would zero out input port default values for z and w when using vector 3D/4D, updated to keep values for all ports. Zeroing out z and w would cause values for 4D vectors to be lost when loading the visual shader - 3D vectors were not affected by this, since 3D is the default op type, which caused this step to be skipped during loading. However, both 3D and 4D were affected when changing the op type from the drop down in editor. For example, changing from 3D (1, 2, 3) to 4D would result in (1, 2, 0, 0), and changing from 4D (1, 2, 3, 4) to 3D would result in (1, 2, 0), losing previously set values. commit bd69df1379a122df657b30b639d5b667037f931e Author: DevPoodle Date: Sun Sep 22 20:48:46 2024 -0700 Add descriptions to RDVertexAttribute's properties commit 64077ff3de40d12eec83501cb06280a0e02027fc Author: Andrew Price Date: Fri Sep 6 19:32:35 2024 +0100 unix: Limit named pipe permissions to the current user Named pipes created using the "pipe://" file access scheme should not be world-writable or readable. Limit their access to the current user by creating them with 0600 permissions instead of 0666. commit f49c9d7cd1d33586fbd106057a894b3effc04331 Author: Andrew Price Date: Sat Aug 31 18:35:15 2024 +0100 unix: Don't create world-writable files when safe save is enabled When the "filesystem/on_save/safe_save_on_backup_then_rename" option is enabled files are created with 0666 permissions (-rw-rw-rw-) which is too loose. Use 0644 (-rw-r--r--) instead which is how the files would normally be created with the setting disabled and the system umask taken into account. commit 1deb42ad8dd6429cde94f437675c0cff3f8dcb60 Author: Saracen Date: Sun Sep 1 01:32:56 2024 +0100 Improve behaviour of AnimationPlayer warnings. commit a54c6ce42d9a58f435e94ca6f9237172203ae637 Author: Yahkub-R <62478788+Yahkub-R@users.noreply.github.com> Date: Mon Aug 19 06:09:30 2024 -0400 Fix crash when re-importing model with AnimationPlayer panel open and node selected commit 75eacba5cd2fbbfc318e4c510d501e2283fdd20b Author: Haoyu Qiu Date: Wed Apr 17 09:55:40 2024 +0800 Add Camera3D preview in Inspector commit 9558d4f28fef77696027c6e654feb33f6caa8db7 Author: Hugo Locurcio Date: Tue Apr 16 00:21:14 2024 +0200 Make TextEdit autocompletion replace word unless Shift is held This makes Tab and Enter act identical by default for autocompletion. If Shift is held, the suggestion is added in-place without the word being replaced. This matches the behavior found in Visual Studio Code where the following occurs: - Pressing Tab accepts the suggestion and replaces the word. - Pressing Enter accepts the suggestion and replaces the word. - Pressing Shift + Tab accepts the suggestion and doesn't replace the word. - Pressing Shift + Enter accepts the suggestion and doesn't replace the word. --- .clang-format | 20 +- .github/CODEOWNERS | 1 + .github/actions/godot-deps/action.yml | 6 +- .github/workflows/godot_cpp_test.yml | 7 +- .github/workflows/linux_builds.yml | 6 +- .github/workflows/windows_builds.yml | 8 - .gitignore | 1 + .pre-commit-config.yaml | 7 +- COPYRIGHT.txt | 12 +- SConstruct | 19 +- core/config/engine.cpp | 3 + core/config/project_settings.cpp | 8 +- core/core_bind.cpp | 6 + core/core_bind.h | 1 + core/core_constants.cpp | 1 + core/core_string_names.cpp | 75 - core/core_string_names.h | 83 +- core/crypto/crypto.h | 4 + core/debugger/remote_debugger_peer.cpp | 2 +- core/extension/extension_api_dump.cpp | 2 +- core/extension/gdextension_interface.cpp | 86 + core/extension/gdextension_interface.h | 30 +- core/input/input_event.cpp | 12 + core/input/input_map.cpp | 8 +- core/io/dir_access.cpp | 83 +- core/io/dir_access.h | 12 +- core/io/file_access.compat.inc | 73 +- core/io/file_access.cpp | 176 +- core/io/file_access.h | 57 +- core/io/file_access_compressed.cpp | 30 +- core/io/file_access_compressed.h | 2 +- core/io/file_access_encrypted.cpp | 9 +- core/io/file_access_encrypted.h | 2 +- core/io/file_access_memory.cpp | 12 +- core/io/file_access_memory.h | 2 +- core/io/file_access_pack.cpp | 10 +- core/io/file_access_pack.h | 2 +- core/io/file_access_zip.cpp | 4 +- core/io/file_access_zip.h | 2 +- core/io/http_client_tcp.cpp | 2 +- core/io/image.cpp | 3 +- core/io/ip_address.cpp | 2 +- core/io/json.h | 4 + core/io/marshalls.h | 10 + core/io/resource_format_binary.cpp | 6 +- core/io/resource_loader.cpp | 2 +- core/io/resource_uid.cpp | 7 +- core/io/stream_peer.cpp | 26 + core/io/stream_peer.h | 2 + core/io/translation_loader_po.h | 4 + core/math/a_star.cpp | 2 +- core/math/a_star.h | 2 +- core/math/bvh_logic.inc | 1 - core/math/bvh_misc.inc | 1 - core/math/bvh_structs.inc | 1 - core/math/projection.cpp | 12 +- core/math/vector4.cpp | 2 +- core/object/class_db.cpp | 2 +- core/object/object.h | 3 +- core/object/ref_counted.h | 2 +- core/object/script_language.cpp | 2 +- core/object/worker_thread_pool.h | 8 +- core/os/condition_variable.h | 4 +- core/os/os.cpp | 8 + core/os/os.h | 5 +- core/os/spin_lock.h | 33 +- core/register_core_types.cpp | 22 +- core/register_core_types.h | 1 + core/string/print_string.cpp | 242 +- core/string/string_name.cpp | 6 - core/string/string_name.h | 8 +- core/string/translation.cpp | 6 +- .../string/translation_server.compat.inc | 35 +- core/string/translation_server.cpp | 8 +- core/string/translation_server.h | 8 +- core/string/ustring.cpp | 141 +- core/string/ustring.h | 1 + core/variant/dictionary.cpp | 9 + core/variant/dictionary.h | 2 + core/variant/method_ptrcall.h | 2 +- core/variant/typed_dictionary.h | 22 + core/variant/variant.cpp | 3 - core/variant/variant.h | 3 +- core/variant/variant_call.cpp | 61 +- core/variant/variant_parser.cpp | 2 +- doc/classes/@GlobalScope.xml | 106 +- doc/classes/AABB.xml | 6 +- doc/classes/AnimationLibrary.xml | 6 + doc/classes/AnimationMixer.xml | 44 +- doc/classes/AnimationNodeOneShot.xml | 4 +- .../AnimationNodeStateMachineTransition.xml | 2 +- doc/classes/AnimationNodeTimeSeek.xml | 5 + doc/classes/AnimationNodeTransition.xml | 2 +- doc/classes/AudioStream.xml | 2 +- doc/classes/AudioStreamPlayer.xml | 1 + doc/classes/AudioStreamWAV.xml | 32 + doc/classes/BaseMaterial3D.xml | 3 +- doc/classes/Basis.xml | 83 +- doc/classes/CPUParticles2D.xml | 28 +- doc/classes/CPUParticles3D.xml | 24 +- doc/classes/CanvasLayer.xml | 4 +- doc/classes/CollisionShape3D.xml | 6 + doc/classes/ColorPalette.xml | 16 + doc/classes/ColorPicker.xml | 3 + doc/classes/Control.xml | 13 +- doc/classes/CubemapArray.xml | 2 +- doc/classes/Curve.xml | 31 +- doc/classes/CurveTexture.xml | 4 +- doc/classes/CurveXYZTexture.xml | 8 +- doc/classes/DTLSServer.xml | 8 +- doc/classes/DirAccess.xml | 19 + doc/classes/DisplayServer.xml | 24 +- doc/classes/EditorExportPlatform.xml | 6 + doc/classes/EditorFileDialog.xml | 27 +- doc/classes/EditorInspector.xml | 15 + doc/classes/EditorProperty.xml | 43 + doc/classes/EditorSettings.xml | 8 +- doc/classes/Engine.xml | 16 +- doc/classes/FileAccess.xml | 66 +- doc/classes/FontFile.xml | 3 + doc/classes/GraphEdit.xml | 8 + doc/classes/Label.xml | 6 + doc/classes/LabelSettings.xml | 3 + doc/classes/LightmapGI.xml | 3 +- doc/classes/LightmapperRD.xml | 2 +- doc/classes/Line2D.xml | 2 +- doc/classes/LookAtModifier3D.xml | 14 +- doc/classes/MeshLibrary.xml | 15 + doc/classes/Node.xml | 2 +- doc/classes/Node2D.xml | 3 +- doc/classes/OS.xml | 7 + doc/classes/Object.xml | 1 + doc/classes/PCKPacker.xml | 1 + doc/classes/PackedFloat32Array.xml | 2 +- doc/classes/PackedFloat64Array.xml | 2 +- doc/classes/PackedInt32Array.xml | 2 +- doc/classes/PackedInt64Array.xml | 4 +- doc/classes/PackedVector4Array.xml | 1 + doc/classes/ProjectSettings.xml | 16 +- doc/classes/Projection.xml | 12 +- doc/classes/PropertyTweener.xml | 53 +- doc/classes/Quaternion.xml | 5 +- doc/classes/RDTextureFormat.xml | 7 + doc/classes/RDVertexAttribute.xml | 5 + doc/classes/RenderSceneBuffersRD.xml | 1 + doc/classes/RenderingDevice.xml | 146 +- doc/classes/RenderingServer.xml | 10 +- doc/classes/ResourceImporterDynamicFont.xml | 3 + doc/classes/RetargetModifier3D.xml | 34 + doc/classes/RibbonTrailMesh.xml | 2 +- doc/classes/RichTextLabel.xml | 6 + doc/classes/ScrollContainer.xml | 6 + doc/classes/ShaderIncludeDB.xml | 33 + doc/classes/Skeleton3D.xml | 5 + doc/classes/StreamPeer.xml | 13 + doc/classes/String.xml | 2 +- doc/classes/SubViewportContainer.xml | 5 + doc/classes/SurfaceTool.xml | 2 +- doc/classes/SystemFont.xml | 3 + doc/classes/TextServer.xml | 22 + doc/classes/TextServerExtension.xml | 24 + doc/classes/TextureProgressBar.xml | 1 + doc/classes/TileSetAtlasSource.xml | 2 +- doc/classes/Transform2D.xml | 30 +- doc/classes/Transform3D.xml | 33 +- doc/classes/TranslationServer.xml | 3 +- doc/classes/Tree.xml | 3 + doc/classes/TubeTrailMesh.xml | 2 +- doc/classes/Tween.xml | 2 +- doc/classes/UDPServer.xml | 6 +- doc/classes/Vector2.xml | 4 +- doc/classes/Vector2i.xml | 4 +- doc/classes/Vector3.xml | 6 +- doc/classes/Vector3i.xml | 6 +- doc/classes/Vector4.xml | 8 +- doc/classes/Vector4i.xml | 8 +- doc/classes/Viewport.xml | 9 +- doc/classes/VisualShaderNodeColorFunc.xml | 27 +- .../VisualShaderNodeDerivativeFunc.xml | 2 +- doc/classes/Window.xml | 6 +- doc/tools/make_rst.py | 71 +- .../d3d12/rendering_context_driver_d3d12.cpp | 6 + .../d3d12/rendering_context_driver_d3d12.h | 18 + .../d3d12/rendering_device_driver_d3d12.cpp | 53 +- drivers/gles3/rasterizer_canvas_gles3.cpp | 54 +- drivers/gles3/rasterizer_canvas_gles3.h | 36 +- drivers/gles3/rasterizer_scene_gles3.cpp | 11 +- drivers/gles3/shaders/canvas.glsl | 46 +- .../gles3/shaders/canvas_uniforms_inc.glsl | 37 +- drivers/gles3/shaders/scene.glsl | 22 +- drivers/gles3/storage/light_storage.cpp | 2 +- drivers/gles3/storage/mesh_storage.cpp | 1 + .../metal/rendering_context_driver_metal.mm | 6 +- .../metal/rendering_device_driver_metal.mm | 24 +- drivers/unix/file_access_unix.cpp | 27 +- drivers/unix/file_access_unix.h | 4 +- drivers/unix/file_access_unix_pipe.cpp | 10 +- drivers/unix/file_access_unix_pipe.h | 2 +- drivers/unix/os_unix.cpp | 10 +- drivers/unix/os_unix.h | 2 + drivers/wasapi/audio_driver_wasapi.cpp | 8 +- drivers/windows/file_access_windows.cpp | 29 +- drivers/windows/file_access_windows.h | 4 +- drivers/windows/file_access_windows_pipe.cpp | 8 +- drivers/windows/file_access_windows_pipe.h | 2 +- editor/action_map_editor.cpp | 2 +- editor/animation_track_editor.cpp | 36 +- editor/animation_track_editor.h | 2 +- editor/code_editor.cpp | 4 +- editor/connections_dialog.cpp | 4 +- editor/create_dialog.cpp | 2 + .../debug_adapter/debug_adapter_parser.cpp | 2 +- .../debug_adapter/debug_adapter_parser.h | 2 +- .../debug_adapter/debug_adapter_protocol.cpp | 2 +- editor/debugger/editor_debugger_node.cpp | 2 +- .../debugger/editor_expression_evaluator.cpp | 2 +- .../debugger/editor_performance_profiler.cpp | 9 + editor/debugger/editor_profiler.cpp | 66 +- editor/debugger/editor_profiler.h | 6 + editor/debugger/editor_visual_profiler.cpp | 12 +- editor/debugger/editor_visual_profiler.h | 4 + editor/debugger/script_editor_debugger.cpp | 14 +- editor/dependency_editor.cpp | 46 +- editor/dependency_editor.h | 4 + editor/directory_create_dialog.cpp | 6 +- editor/doc_tools.cpp | 17 + editor/editor_asset_installer.cpp | 1 + editor/editor_audio_buses.cpp | 3 +- editor/editor_autoload_settings.cpp | 4 +- editor/editor_dock_manager.cpp | 7 +- editor/editor_feature_profile.cpp | 3 +- editor/editor_file_system.cpp | 6 +- editor/editor_help.cpp | 49 +- editor/editor_help_search.cpp | 2 +- editor/editor_inspector.cpp | 59 +- editor/editor_inspector.h | 7 +- editor/editor_interface.cpp | 157 + editor/editor_interface.h | 2 + editor/editor_log.h | 7 +- editor/editor_node.cpp | 37 +- editor/editor_node.h | 3 + editor/editor_paths.cpp | 7 + editor/editor_paths.h | 2 + editor/editor_properties.cpp | 29 +- editor/editor_property_name_processor.cpp | 1 + editor/editor_resource_picker.cpp | 2 +- editor/editor_resource_preview.cpp | 31 +- editor/editor_resource_preview.h | 6 +- editor/editor_sectioned_inspector.cpp | 5 +- editor/editor_settings.cpp | 4 +- editor/editor_string_names.h | 12 +- editor/export/editor_export_platform.cpp | 82 +- editor/export/editor_export_platform.h | 3 + editor/export/export_template_manager.cpp | 10 +- editor/export/project_export.cpp | 15 +- editor/filesystem_dock.cpp | 75 +- editor/filesystem_dock.h | 3 +- editor/find_in_files.cpp | 4 +- editor/group_settings_editor.cpp | 4 +- editor/gui/editor_file_dialog.cpp | 331 ++- editor/gui/editor_file_dialog.h | 17 +- editor/gui/editor_spin_slider.cpp | 2 +- editor/gui/editor_title_bar.cpp | 8 +- editor/gui/editor_toaster.cpp | 16 +- editor/gui/editor_toaster.h | 2 + editor/gui/scene_tree_editor.cpp | 9 +- editor/icons/FilenameFilter.svg | 1 + editor/icons/RetargetModifier3D.svg | 1 + editor/import/3d/collada.cpp | 4 +- .../post_import_plugin_skeleton_renamer.cpp | 2 +- ...post_import_plugin_skeleton_rest_fixer.cpp | 227 +- ...import_plugin_skeleton_track_organizer.cpp | 42 +- editor/import/3d/resource_importer_scene.cpp | 12 + editor/import/3d/resource_importer_scene.h | 1 + .../import/dynamic_font_import_settings.cpp | 5 + .../import/resource_importer_dynamic_font.cpp | 6 + editor/import/resource_importer_imagefont.cpp | 1 + editor/import/resource_importer_wav.cpp | 468 +-- editor/import/resource_importer_wav.h | 92 +- editor/plugins/abstract_polygon_2d_editor.cpp | 14 +- .../animation_blend_tree_editor_plugin.cpp | 32 +- editor/plugins/animation_library_editor.cpp | 205 +- editor/plugins/animation_library_editor.h | 7 + .../animation_player_editor_plugin.cpp | 12 +- .../animation_state_machine_editor.cpp | 196 +- .../plugins/animation_state_machine_editor.h | 8 +- editor/plugins/camera_3d_editor_plugin.cpp | 51 +- editor/plugins/camera_3d_editor_plugin.h | 27 +- editor/plugins/canvas_item_editor_plugin.cpp | 158 +- editor/plugins/canvas_item_editor_plugin.h | 1 + editor/plugins/cast_2d_editor_plugin.cpp | 6 +- .../collision_shape_2d_editor_plugin.cpp | 6 +- editor/plugins/curve_editor_plugin.cpp | 184 +- editor/plugins/curve_editor_plugin.h | 23 +- .../dedicated_server_export_plugin.cpp | 2 +- editor/plugins/editor_preview_plugins.h | 6 +- editor/plugins/gdextension_export_plugin.h | 1 + .../plugins/gizmos/camera_3d_gizmo_plugin.cpp | 20 +- .../plugins/gizmos/camera_3d_gizmo_plugin.h | 1 - .../collision_shape_3d_gizmo_plugin.cpp | 75 +- .../gizmos/collision_shape_3d_gizmo_plugin.h | 2 + .../gizmos/reflection_probe_gizmo_plugin.cpp | 30 +- .../plugins/gizmos/voxel_gi_gizmo_plugin.cpp | 4 +- editor/plugins/lightmap_gi_editor_plugin.cpp | 2 +- .../mesh_instance_3d_editor_plugin.cpp | 2 +- editor/plugins/mesh_library_editor_plugin.cpp | 19 + .../navigation_link_2d_editor_plugin.cpp | 6 +- editor/plugins/node_3d_editor_gizmos.cpp | 7 +- editor/plugins/node_3d_editor_plugin.cpp | 102 +- editor/plugins/node_3d_editor_plugin.h | 7 + editor/plugins/path_2d_editor_plugin.cpp | 14 +- editor/plugins/plugin_config_dialog.cpp | 2 +- .../resource_preloader_editor_plugin.cpp | 2 +- editor/plugins/script_editor_plugin.cpp | 10 +- editor/plugins/script_text_editor.cpp | 3 +- editor/plugins/shader_editor_plugin.cpp | 1 + editor/plugins/shader_file_editor_plugin.cpp | 1 + editor/plugins/skeleton_3d_editor_plugin.cpp | 1 + .../plugins/sprite_frames_editor_plugin.cpp | 3 +- editor/plugins/theme_editor_plugin.cpp | 12 +- editor/plugins/theme_editor_preview.cpp | 6 + editor/plugins/tiles/atlas_merging_dialog.cpp | 1 + .../plugins/tiles/tile_map_layer_editor.cpp | 2 + editor/plugins/tiles/tile_set_editor.cpp | 2 + editor/plugins/tiles/tiles_editor_plugin.cpp | 4 +- .../plugins/version_control_editor_plugin.cpp | 1 + .../plugins/visual_shader_editor_plugin.cpp | 160 +- editor/plugins/visual_shader_editor_plugin.h | 2 +- editor/plugins/voxel_gi_editor_plugin.cpp | 10 +- editor/plugins/voxel_gi_editor_plugin.h | 4 +- editor/project_converter_3_to_4.cpp | 2 +- editor/project_manager.cpp | 6 +- editor/project_manager/project_dialog.cpp | 39 +- editor/project_manager/project_dialog.h | 1 + editor/project_manager/project_list.cpp | 4 +- editor/project_settings_editor.cpp | 2 +- editor/property_selector.cpp | 4 +- editor/run_instances_dialog.cpp | 2 +- editor/scene_create_dialog.cpp | 4 +- editor/script_create_dialog.cpp | 21 +- editor/shader_create_dialog.cpp | 10 +- editor/shader_globals_editor.cpp | 2 +- editor/themes/editor_fonts.cpp | 4 +- editor/themes/editor_theme_manager.cpp | 28 +- main/main.cpp | 146 +- main/performance.cpp | 4 - methods.py | 121 +- misc/dist/html/editor.html | 36 +- misc/dist/html/full-size.html | 10 +- .../godot_ios.xcodeproj/project.pbxproj | 2 + .../godot_ios/godot_ios.entitlements | 2 +- .../4.2-stable_4.3-stable.expected | 2 +- .../4.3-stable.expected | 93 + misc/scripts/header_guards.py | 5 + misc/scripts/install_vulkan_sdk_macos.sh | 22 + misc/utility/problem-matchers.json | 32 + modules/SCsub | 5 - modules/basis_universal/SCsub | 67 +- modules/basis_universal/config.py | 3 +- .../CrossPlatformSettings_piece_all.glsl | 1 - modules/betsy/SCsub | 1 + modules/betsy/UavCrossPlatform_piece_all.glsl | 1 - modules/betsy/alpha_stitch.glsl | 24 + modules/betsy/image_compress_betsy.cpp | 609 ++-- modules/betsy/image_compress_betsy.h | 23 +- modules/camera/camera_linux.cpp | 3 - modules/camera/config.py | 4 + modules/csg/SCsub | 37 +- modules/csg/csg.cpp | 1428 +-------- modules/csg/csg.h | 148 +- modules/csg/csg_shape.cpp | 391 ++- modules/csg/csg_shape.h | 2 + modules/csg/doc_classes/CSGShape3D.xml | 4 +- modules/dds/texture_loader_dds.cpp | 9 + modules/enet/enet_connection.cpp | 4 +- modules/gdscript/doc_classes/@GDScript.xml | 29 +- modules/gdscript/editor/gdscript_docgen.cpp | 9 +- .../gdscript/editor/gdscript_highlighter.cpp | 2 +- modules/gdscript/gdscript.cpp | 6 +- modules/gdscript/gdscript_analyzer.cpp | 97 +- modules/gdscript/gdscript_byte_codegen.cpp | 25 +- modules/gdscript/gdscript_cache.cpp | 2 +- modules/gdscript/gdscript_compiler.cpp | 55 +- modules/gdscript/gdscript_editor.cpp | 44 +- modules/gdscript/gdscript_parser.cpp | 150 +- modules/gdscript/gdscript_parser.h | 6 +- .../gdscript_extend_parser.cpp | 13 +- .../gdscript_text_document.cpp | 15 +- .../language_server/gdscript_text_document.h | 3 + .../gdscript/tests/gdscript_test_runner.cpp | 75 +- modules/gdscript/tests/scripts/.editorconfig | 5 +- .../errors/abstract_class_instantiate.gd | 8 + .../errors/abstract_class_instantiate.out | 5 +- .../errors/abstract_script_instantiate.gd | 9 - .../errors/abstract_script_instantiate.out | 2 - .../annotation_non_constant_parameter.out | 2 +- .../scripts/analyzer/errors/assign_enum.out | 2 +- .../analyzer/errors/assign_named_enum.out | 2 +- .../scripts/analyzer/errors/assign_signal.out | 2 +- .../errors/assign_to_read_only_property.out | 2 +- ...ssign_to_read_only_property_indirectly.out | 2 +- .../errors/assymetric_assignment_bad.out | 3 +- .../analyzer/errors/await_signal_no_infer.out | 2 +- .../errors/bitwise_float_left_operand.out | 2 +- .../errors/bitwise_float_right_operand.out | 2 +- .../call_not_existing_static_method.out | 2 +- .../analyzer/errors/cast_int_to_array.out | 2 +- .../analyzer/errors/cast_int_to_object.out | 2 +- .../analyzer/errors/cast_object_to_int.out | 2 +- .../class_name_shadows_builtin_type.out | 2 +- .../errors/constant_array_index_assign.out | 2 +- .../constant_dictionary_index_assign.out | 2 +- .../constant_name_shadows_builtin_type.out | 2 +- .../errors/constant_subscript_type.out | 2 +- .../errors/constant_used_as_function.out | 3 +- .../analyzer/errors/constructor_call_type.out | 2 +- .../analyzer/errors/cyclic_inheritance.out | 2 +- .../analyzer/errors/cyclic_ref_const.out | 3 +- .../analyzer/errors/cyclic_ref_enum.out | 3 +- .../analyzer/errors/cyclic_ref_enum_value.out | 2 +- .../analyzer/errors/cyclic_ref_external.out | 3 +- .../errors/cyclic_ref_external_a.notest.gd | 2 + .../analyzer/errors/cyclic_ref_func.out | 3 +- .../analyzer/errors/cyclic_ref_override.out | 2 +- .../analyzer/errors/cyclic_ref_var.out | 3 +- .../analyzer/errors/cyclic_ref_var_self.out | 3 +- .../errors/dictionary_duplicate_key_lua.out | 2 +- ...ctionary_duplicate_key_lua_with_string.out | 2 +- .../dictionary_duplicate_key_python.out | 2 +- ...ictionary_string_stringname_equivalent.out | 2 +- .../errors/engine_singleton_instantiate.out | 2 +- .../analyzer/errors/enum_bad_method.out | 2 +- .../analyzer/errors/enum_bad_value.out | 2 +- .../analyzer/errors/enum_builtin_access.gd | 2 + .../analyzer/errors/enum_builtin_access.out | 2 + ..._class_var_assign_with_wrong_enum_type.out | 3 +- ...um_class_var_init_with_wrong_enum_type.out | 3 +- .../errors/enum_duplicate_bad_method.out | 2 +- .../analyzer/errors/enum_float_value.out | 2 +- .../enum_function_parameter_wrong_type.out | 3 +- .../enum_function_return_wrong_type.out | 3 +- .../analyzer/errors/enum_global_access.gd | 2 + .../analyzer/errors/enum_global_access.out | 2 + ..._var_assign_outer_with_wrong_enum_type.out | 3 +- ..._local_var_assign_with_wrong_enum_type.out | 3 +- ...um_local_var_init_with_wrong_enum_type.out | 3 +- .../errors/enum_name_shadows_builtin_type.out | 2 +- .../analyzer/errors/enum_native_access.gd | 2 + .../analyzer/errors/enum_native_access.out | 2 + .../analyzer/errors/enum_native_bad_value.out | 2 +- .../enum_preload_unnamed_assign_to_named.out | 3 +- .../errors/enum_shadows_base_enum.out | 2 +- .../analyzer/errors/enum_string_value.out | 2 +- .../errors/enum_unnamed_assign_to_named.out | 3 +- ...xport_node_in_non_node_derived_class_1.out | 2 +- ...xport_node_in_non_node_derived_class_2.out | 2 +- ...xport_node_in_non_node_derived_class_3.out | 2 +- .../errors/extend_engine_singleton.out | 2 +- .../errors/extend_non_class_constant_1.out | 2 +- .../errors/extend_non_class_constant_2.out | 2 +- .../errors/extend_non_gdscript_nested.out | 2 +- .../analyzer/errors/extend_unknown.out | 2 +- .../analyzer/errors/extend_variable.out | 2 +- .../errors/for_loop_on_constant_float.out | 2 +- .../errors/for_loop_on_constant_int.out | 2 +- .../errors/for_loop_on_enum_value.out | 2 +- .../errors/for_loop_on_hard_float.out | 2 +- .../analyzer/errors/for_loop_on_hard_int.out | 2 +- .../errors/for_loop_on_hard_iterator.out | 2 +- .../errors/for_loop_on_hard_string.out | 2 +- .../errors/for_loop_on_literal_bool.out | 2 +- .../errors/for_loop_on_literal_int.out | 2 +- .../errors/for_loop_wrong_specified_type.out | 2 +- ...rong_specified_type_with_literal_array.out | 3 +- ...specified_type_with_literal_dictionary.out | 3 +- ..._parent_signature_parameter_count_less.out | 2 +- ..._parent_signature_parameter_count_more.out | 2 +- ...ent_signature_parameter_default_values.out | 2 +- ..._match_parent_signature_parameter_type.out | 2 +- ...ont_match_parent_signature_return_type.out | 2 +- ...on_param_type_invalid_contravariance_1.out | 2 +- ...on_param_type_invalid_contravariance_2.out | 2 +- ...on_param_type_invalid_contravariance_3.out | 2 +- ...ction_return_type_invalid_covariance_1.out | 2 +- ...ction_return_type_invalid_covariance_2.out | 2 +- ...ction_return_type_invalid_covariance_3.out | 2 +- ...ction_return_type_invalid_covariance_4.out | 2 +- .../errors/function_used_as_property.out | 2 +- .../errors/gd_utility_function_wrong_arg.out | 2 +- .../get_node_shorthand_in_static_function.out | 2 +- .../get_node_shorthand_within_non_node.out | 3 +- .../errors/incompatible_assignment.out | 2 +- ...nferring_with_weak_type_local_variable.out | 2 +- ...ferring_with_weak_type_member_variable.out | 2 +- .../inferring_with_weak_type_parameter.out | 2 +- .../analyzer/errors/invalid_array_index.out | 2 +- .../errors/invalid_concatenation_bool.out | 2 +- .../invalid_concatenation_dictionary.out | 2 +- .../errors/invalid_concatenation_mixed.out | 2 +- .../analyzer/errors/invalid_constant.out | 2 +- .../errors/lambda_cyclic_ref_call_arg.out | 3 +- .../errors/lambda_cyclic_ref_param.out | 3 +- .../analyzer/errors/lambda_no_return.out | 2 +- .../analyzer/errors/lambda_wrong_return.out | 3 +- .../errors/leading_number_separator.out | 2 +- ...ocal_const_as_type_use_before_declared.out | 2 +- .../local_const_as_type_use_not_const.out | 2 +- .../local_const_as_type_use_not_type.out | 2 +- .../errors/match_guard_invalid_expression.out | 2 +- .../analyzer/errors/match_with_subscript.out | 2 +- .../errors/match_with_variable_expression.out | 2 +- .../analyzer/errors/missing_argument.out | 2 +- .../analyzer/errors/native_freed_instance.gd | 7 - .../analyzer/errors/native_freed_instance.out | 6 - .../analyzer/errors/native_type_errors.out | 2 +- .../analyzer/errors/not_found_type.out | 2 +- .../errors/object_invalid_constructor.out | 2 +- .../errors/onready_within_non_node.out | 2 +- .../onready_within_non_node_inner_class.out | 2 +- .../analyzer/errors/outer_class_constants.gd | 8 - .../analyzer/errors/outer_class_constants.out | 6 - .../outer_class_constants_as_variant.gd | 9 - .../outer_class_constants_as_variant.out | 6 - .../errors/outer_class_instance_constants.gd | 8 - .../errors/outer_class_instance_constants.out | 6 - ...ter_class_instance_constants_as_variant.gd | 9 - ...er_class_instance_constants_as_variant.out | 6 - .../analyzer/errors/outer_class_lookup.out | 2 +- .../errors/overload_script_variable.out | 2 +- .../params_default_forward_reference.out | 3 +- .../analyzer/errors/preload_enum_error.out | 3 +- .../errors/prints_base_type_not_found.out | 2 +- .../property_function_get_type_error.out | 2 +- .../property_function_set_type_error.out | 2 +- .../errors/property_inline_get_type_error.out | 2 +- .../errors/property_inline_set_type_error.out | 2 +- .../errors/property_used_as_function.out | 3 +- .../errors/redefine_class_constant.out | 2 +- .../errors/redefine_local_constant.out | 2 +- .../errors/return_null_in_void_func.out | 2 +- .../errors/return_variant_in_void_func.out | 2 +- .../analyzer/errors/script_freed_instance.gd | 10 - .../analyzer/errors/script_freed_instance.out | 6 - .../setter_parameter_uses_property_type.out | 2 +- .../static_constructor_with_return_type.out | 2 +- .../errors/static_func_access_non_static.out | 2 +- ...func_access_non_static_in_lambda_param.out | 2 +- .../errors/static_func_call_non_static.out | 2 +- .../static_func_call_non_static_in_lambda.out | 2 +- ...c_func_call_non_static_in_lambda_param.out | 2 +- .../errors/static_var_export_annotation.out | 2 +- ...c_var_init_access_non_static_in_lambda.out | 2 +- ...nit_access_non_static_in_lambda_setter.out | 2 +- ...tic_var_init_call_non_static_in_lambda.out | 2 +- ..._init_call_non_static_in_lambda_setter.out | 2 +- .../static_var_init_non_static_access.out | 2 +- .../static_var_init_non_static_call.out | 2 +- .../errors/super_nonexistent_base_method.out | 2 +- .../analyzer/errors/ternary_weak_infer.out | 2 +- .../typed_array_assign_differently_typed.out | 2 +- .../errors/typed_array_assignment.out | 3 +- ...ray_init_with_unconvertable_in_literal.out | 2 +- .../typed_array_pass_differently_to_typed.out | 2 +- ...ed_dictionary_assign_differently_typed.out | 2 +- .../errors/typed_dictionary_assignment.out | 3 +- ...ary_init_with_unconvertible_in_literal.out | 2 +- ...d_dictionary_pass_differently_to_typed.out | 2 +- ..._value_of_void_function_builtin_method.out | 2 +- ...e_value_of_void_function_custom_method.out | 2 +- .../use_value_of_void_function_gd_utility.out | 2 +- ...e_value_of_void_function_native_method.out | 2 +- .../use_value_of_void_function_utility.out | 2 +- .../errors/utility_function_wrong_arg.out | 2 +- .../variable_name_shadows_builtin_type.out | 2 +- ...variable_overloads_superclass_function.out | 2 +- .../errors/virtual_super_not_implemented.out | 2 +- .../allow_void_function_to_return_void.out | 5 +- .../auto_inferred_type_dont_error.out | 5 +- .../global_builtin_and_native_enums.gd | 28 + .../global_builtin_and_native_enums.out | 25 + .../analyzer/features/hard_variants.gd | 4 +- .../analyzer/features/type_test_usage.gd | 2 +- .../analyzer/features/typed_array_usage.gd | 6 +- .../features/typed_dictionary_usage.gd | 4 +- .../scripts/analyzer/features/vararg_call.gd | 6 +- .../features/warning_ignore_targets.out | 36 +- .../analyzer/warnings/cast_enum_bad_enum.out | 5 +- .../analyzer/warnings/cast_enum_bad_int.out | 5 +- .../confusable_capture_reassignment.out | 20 +- .../warnings/confusable_local_declaration.out | 5 +- .../warnings/confusable_local_usage.out | 10 +- .../confusable_local_usage_initializer.out | 15 +- .../warnings/confusable_local_usage_loop.out | 10 +- .../warnings/enum_without_default_value.out | 5 +- .../warnings/get_node_without_onready.out | 25 +- .../warnings/inference_with_variant.out | 5 +- .../warnings/lambda_shadowing_arg.out | 5 +- .../analyzer/warnings/lambda_unused_arg.out | 5 +- .../warnings/non_tool_extends_tool.out | 10 +- .../analyzer/warnings/onready_with_export.out | 5 +- .../warnings/overriding_native_method.out | 5 +- .../analyzer/warnings/redundant_await.out | 45 +- .../scripts/analyzer/warnings/shadowning.gd | 5 +- .../scripts/analyzer/warnings/shadowning.out | 55 +- .../warnings/unsafe_call_argument.out | 70 +- .../scripts/analyzer/warnings/unsafe_cast.out | 40 +- .../unused_private_class_variable.out | 10 +- .../analyzer/warnings/unused_signal.out | 10 +- .../assignment_options/enum_attribute.cfg | 2 +- .../enum_attribute_identifier.cfg | 2 +- .../completion/common/identifiers_in_call.cfg | 8 +- .../common/identifiers_in_function_body.cfg | 8 +- .../common/identifiers_in_unclosed_call.cfg | 8 +- .../common/no_completion_in_string.cfg | 10 +- .../tests/scripts/completion/common/self.cfg | 8 +- .../completion/get_node/literal/dollar.cfg | 2 +- .../completion/get_node/literal/percent.cfg | 2 +- .../literal_scene/dollar_class_scene.cfg | 4 +- .../literal_scene/dollar_native_scene.cfg | 4 +- .../literal_scene/percent_class_scene.cfg | 4 +- .../literal_scene/percent_native_scene.cfg | 4 +- .../completion/get_node/local/local.cfg | 2 +- .../get_node/local_infered/local_infered.cfg | 2 +- .../class_local_infered_scene.cfg | 4 +- .../native_local_infered_scene.cfg | 4 +- .../local_scene/class_local_scene.cfg | 4 +- .../local_scene/native_local_scene.cfg | 4 +- .../local_typehint/class_local_typehint.cfg | 4 +- .../local_typehint/native_local_typehint.cfg | 4 +- .../class_local_typehint_scene.cfg | 4 +- .../native_local_typehint_scene.cfg | 4 +- .../class_local_typehint_scene_broad.cfg | 4 +- .../native_local_typehint_scene_broad.cfg | 4 +- ...lass_local_typehint_scene_incompatible.cfg | 6 +- ...tive_local_typehint_scene_incompatible.cfg | 6 +- .../completion/get_node/member/member.cfg | 2 +- .../member_infered/member_infered.cfg | 2 +- .../class_member_infered_scene.cfg | 4 +- .../native_member_infered_scene.cfg | 4 +- .../member_scene/class_member_scene.cfg | 4 +- .../member_scene/native_member_scene.cfg | 4 +- .../member_typehint/class_member_typehint.cfg | 4 +- .../native_member_typehint.cfg | 4 +- .../class_member_typehint_scene.cfg | 4 +- .../native_member_typehint_scene.cfg | 4 +- .../class_member_typehint_scene_broad.cfg | 4 +- .../native_member_typehint_scene_broad.cfg | 4 +- ...ass_member_typehint_scene_incompatible.cfg | 6 +- ...ive_member_typehint_scene_incompatible.cfg | 6 +- .../completion/types/local/infered.cfg | 4 +- .../completion/types/local/no_type.cfg | 4 +- .../completion/types/local/typehint.cfg | 4 +- .../completion/types/local/typehint_broad.cfg | 4 +- .../types/local/typehint_incompatible.cfg | 4 +- .../completion/types/member/infered.cfg | 4 +- .../completion/types/member/no_type.cfg | 4 +- .../completion/types/member/typehint.cfg | 4 +- .../types/member/typehint_broad.cfg | 4 +- .../types/member/typehint_incompatible.cfg | 4 +- .../tests/scripts/lsp/first_line_comment.gd | 2 + .../errors/export_enum_wrong_array_type.out | 2 +- .../parser/errors/export_enum_wrong_type.out | 2 +- .../export_tool_button_requires_tool_mode.out | 2 +- .../errors/warning_ignore_extra_start.gd | 5 + .../errors/warning_ignore_extra_start.out | 2 + .../warning_ignore_restore_without_start.gd | 4 + .../warning_ignore_restore_without_start.out | 2 + .../arrays_dictionaries_nested_const.gd | 2 +- .../parser/features/match_bind_unused.out | 5 +- .../parser/features/nested_arithmetic.out | 85 +- .../parser/features/signal_declaration.gd | 9 +- .../parser/features/warning_ignore_regions.gd | 26 + .../features/warning_ignore_regions.out | 6 + .../parser/warnings/assert_always_true.out | 15 +- .../parser/warnings/confusable_identifier.out | 10 +- ...pty_file.notest.gd => empty_file.norun.gd} | 0 .../parser/warnings/empty_file.norun.out | 2 + .../parser/warnings/empty_file.notest.out | 4 - .../warnings/empty_file_comment.norun.gd | 1 + .../warnings/empty_file_comment.norun.out | 2 + .../warnings/empty_file_comment.notest.gd | 1 - .../warnings/empty_file_comment.notest.out | 4 - ....notest.gd => empty_file_newline.norun.gd} | 0 .../warnings/empty_file_newline.norun.out | 2 + .../warnings/empty_file_newline.notest.out | 4 - .../empty_file_newline_comment.norun.gd | 4 + .../empty_file_newline_comment.norun.out | 2 + .../empty_file_newline_comment.notest.gd | 4 - .../empty_file_newline_comment.notest.out | 4 - .../enum_assign_int_without_casting.out | 20 +- .../parser/warnings/incompatible_ternary.out | 5 +- .../parser/warnings/integer_division.out | 5 +- .../warnings/match_default_not_at_end.out | 5 +- .../parser/warnings/narrowing_conversion.out | 5 +- .../warnings/return_value_discarded.out | 10 +- .../parser/warnings/shadowed_constant.out | 10 +- .../warnings/shadowed_global_identifier.out | 10 +- .../warnings/shadowed_variable_class.out | 10 +- .../warnings/shadowed_variable_function.out | 10 +- .../parser/warnings/standalone_expression.out | 20 +- .../parser/warnings/standalone_ternary.out | 10 +- .../warnings/static_called_on_instance.out | 15 +- .../parser/warnings/unassigned_variable.out | 15 +- .../unassigned_variable_op_assign.out | 5 +- .../unreachable_code_after_return.out | 5 +- .../parser/warnings/unused_argument.out | 5 +- .../parser/warnings/unused_constant.out | 5 +- .../parser/warnings/unused_variable.out | 5 +- .../runtime/assign_to_read_only_property.gd | 7 - .../runtime/assign_to_read_only_property.out | 6 - ..._read_only_property_with_variable_index.gd | 8 - ...read_only_property_with_variable_index.out | 6 - .../runtime/errors/assign_freed_instance.gd | 22 + .../runtime/errors/assign_freed_instance.out | 3 + .../errors/assign_to_read_only_property.gd | 11 + .../errors/assign_to_read_only_property.out | 6 + .../bad_conversion_for_default_parameter.out | 6 +- .../callable_call_after_free_object.out | 6 +- .../runtime/errors/cast_freed_object.out | 6 +- .../runtime/errors/cast_int_to_array.out | 6 +- .../runtime/errors/cast_int_to_object.out | 6 +- .../runtime/errors/cast_object_to_int.out | 6 +- .../runtime/errors/constant_array_is_deep.out | 8 +- .../errors/constant_dictionary_is_deep.out | 6 +- .../runtime/errors/division_by_zero.gd | 3 + .../runtime/errors/division_by_zero.out | 3 + ...loop_iterator_type_not_match_specified.out | 6 +- .../errors/gd_utility_function_wrong_arg.out | 6 +- .../errors/invalid_property_assignment.out | 6 +- .../scripts/runtime/errors/modulo_by_zero.gd | 3 + .../scripts/runtime/errors/modulo_by_zero.out | 3 + ...non_static_method_call_on_native_class.out | 7 +- .../runtime/errors/outer_class_constants.gd | 28 + .../runtime/errors/outer_class_constants.out | 7 + .../runtime/errors/read_only_dictionary.out | 8 +- .../typed_array_assign_basic_to_typed.gd | 2 +- .../typed_array_assign_basic_to_typed.out | 6 +- .../typed_array_assign_differently_typed.gd | 2 +- .../typed_array_assign_differently_typed.out | 6 +- .../typed_array_assign_wrong_to_typed.gd | 2 +- .../typed_array_assign_wrong_to_typed.out | 7 +- .../typed_array_pass_basic_to_typed.out | 6 +- .../typed_array_pass_differently_to_typed.out | 7 +- .../typed_dictionary_assign_basic_to_typed.gd | 2 +- ...typed_dictionary_assign_basic_to_typed.out | 6 +- ...ped_dictionary_assign_differently_typed.gd | 2 +- ...ed_dictionary_assign_differently_typed.out | 6 +- ...ictionary_assign_differently_typed_key.out | 9 +- ...tionary_assign_differently_typed_value.out | 9 +- .../typed_dictionary_assign_wrong_to_typed.gd | 2 +- ...typed_dictionary_assign_wrong_to_typed.out | 7 +- .../typed_dictionary_pass_basic_to_typed.out | 6 +- ...d_dictionary_pass_differently_to_typed.out | 7 +- .../errors/use_return_value_of_free_call.out | 7 +- ...turn_value_of_void_builtin_method_call.out | 7 +- ...eturn_value_of_void_native_method_call.out | 7 +- .../errors/utility_function_wrong_arg.out | 6 +- .../runtime/features/assign_operator.gd | 2 +- .../features/await_without_coroutine.out | 5 +- .../scripts/runtime/features/member_info.gd | 12 +- .../runtime/features/parameter_shadowing.out | 10 +- .../scripts/runtime/features/stringify.gd | 10 +- .../scripts/runtime/features/stringify.out | 11 +- .../runtime/features/typed_assignment.out | 10 +- modules/gdscript/tests/test_lsp.h | 31 + .../editor_scene_exporter_gltf_settings.cpp | 4 +- .../editor/editor_scene_importer_blend.cpp | 19 +- modules/gltf/gltf_document.cpp | 2 +- .../godot_physics_server_2d.cpp | 11 +- .../godot_physics_server_2d.h | 2 +- modules/godot_physics_2d/godot_shape_2d.cpp | 3 +- modules/godot_physics_2d/godot_step_2d.cpp | 2 +- .../godot_physics_server_3d.cpp | 10 +- .../godot_physics_server_3d.h | 2 +- modules/godot_physics_3d/godot_shape_3d.cpp | 2 +- modules/godot_physics_3d/godot_space_3d.cpp | 3 +- modules/godot_physics_3d/godot_step_3d.cpp | 6 +- .../joints/godot_pin_joint_3d.cpp | 2 +- .../gridmap/editor/grid_map_editor_plugin.cpp | 4 + modules/gridmap/grid_map.cpp | 3 + .../audio_stream_interactive.cpp | 11 +- .../audio_stream_interactive.h | 2 +- .../audio_stream_synchronized.cpp | 12 + .../audio_stream_synchronized.h | 1 + modules/lightmapper_rd/lightmapper_rd.cpp | 122 +- modules/lightmapper_rd/lm_common_inc.glsl | 1 - modules/mono/csharp_script.cpp | 4 +- modules/mono/csharp_script.h | 5 + .../ScriptPropertiesGenerator.cs | 17 +- modules/mono/editor/bindings_generator.cpp | 41 +- .../glue/GodotSharp/GodotSharp/Core/Array.cs | 19 + .../Core/Bridge/ScriptManagerBridge.cs | 22 +- .../GodotSharp/GodotSharp/Core/Dictionary.cs | 23 + .../GodotSharp/Core/GodotObject.base.cs | 54 +- .../Core/NativeInterop/InteropStructs.cs | 7 + .../Core/NativeInterop/Marshaling.cs | 38 + .../Core/NativeInterop/NativeFuncs.cs | 33 + .../GodotSharp/Core/ReflectionUtils.cs | 8 +- modules/mono/glue/runtime_interop.cpp | 73 + modules/mono/utils/string_utils.cpp | 2 +- modules/multiplayer/config.py | 1 + .../doc_classes}/OfflineMultiplayerPeer.xml | 2 +- .../multiplayer/editor/replication_editor.cpp | 2 +- modules/multiplayer/multiplayer_spawner.cpp | 16 +- modules/multiplayer/multiplayer_spawner.h | 1 - modules/navigation/3d/nav_mesh_queries_3d.cpp | 66 +- modules/navigation/nav_agent.cpp | 63 +- modules/navigation/nav_agent.h | 9 +- modules/navigation/nav_link.cpp | 39 +- modules/navigation/nav_link.h | 14 +- modules/navigation/nav_map.cpp | 214 +- modules/navigation/nav_map.h | 53 +- modules/navigation/nav_obstacle.cpp | 50 +- modules/navigation/nav_obstacle.h | 8 +- modules/navigation/nav_region.cpp | 32 + modules/navigation/nav_region.h | 9 +- modules/navigation/nav_utils.h | 13 + modules/openxr/SCsub | 6 +- .../openxr/scene/openxr_composition_layer.cpp | 2 +- modules/raycast/raycast_occlusion_cull.cpp | 58 +- modules/raycast/raycast_occlusion_cull.h | 10 +- modules/regex/regex.cpp | 55 +- modules/regex/regex.h | 2 + modules/regex/tests/test_regex.h | 9 + modules/svg/SCsub | 2 +- modules/text_server_adv/text_server_adv.cpp | 52 +- modules/text_server_adv/text_server_adv.h | 11 +- modules/text_server_adv/thorvg_svg_in_ot.cpp | 125 +- modules/text_server_adv/thorvg_svg_in_ot.h | 2 - modules/text_server_fb/text_server_fb.cpp | 31 +- modules/text_server_fb/text_server_fb.h | 11 +- modules/text_server_fb/thorvg_svg_in_ot.cpp | 127 +- modules/text_server_fb/thorvg_svg_in_ot.h | 2 - modules/upnp/SCsub | 3 +- modules/upnp/register_types.cpp | 14 +- modules/upnp/upnp.cpp | 299 +- modules/upnp/upnp.h | 61 +- modules/upnp/upnp_device.cpp | 126 +- modules/upnp/upnp_device.h | 57 +- modules/upnp/upnp_device_miniupnp.cpp | 153 + .../upnp_device_miniupnp.h} | 73 +- modules/upnp/upnp_miniupnp.cpp | 334 +++ modules/upnp/upnp_miniupnp.h | 93 + .../websocket/doc_classes/WebSocketPeer.xml | 1 + modules/zip/doc_classes/ZIPPacker.xml | 9 +- modules/zip/doc_classes/ZIPReader.xml | 37 +- platform/android/detect.py | 19 +- platform/android/export/export_plugin.cpp | 79 +- platform/android/file_access_android.cpp | 4 +- platform/android/file_access_android.h | 2 +- .../file_access_filesystem_jandroid.cpp | 16 +- .../android/file_access_filesystem_jandroid.h | 2 +- .../java/lib/res/mipmap-anydpi-v26/icon.xml | 4 +- .../lib/res/mipmap-anydpi-v26/themed_icon.xml | 11 + .../lib/src/org/godotengine/godot/Godot.kt | 3 +- .../org/godotengine/godot/GodotFragment.java | 2 +- .../src/org/godotengine/godot/GodotHost.java | 2 +- .../src/org/godotengine/godot/GodotIO.java | 12 + .../org/godotengine/godot/io/FilePicker.kt | 46 +- .../godotengine/godot/io/file/AssetData.kt | 3 +- .../godotengine/godot/io/file/DataAccess.kt | 6 +- .../godot/io/file/FileAccessHandler.kt | 6 +- platform/android/java_godot_io_wrapper.cpp | 12 + platform/android/java_godot_io_wrapper.h | 2 + platform/android/os_android.cpp | 24 +- platform/android/os_android.h | 12 +- .../doc_classes/EditorExportPlatformIOS.xml | 30 +- platform/ios/export/export_plugin.cpp | 61 +- platform/ios/export/export_plugin.h | 2 + platform/ios/os_ios.h | 1 + platform/ios/os_ios.mm | 13 + platform/linuxbsd/detect.py | 2 +- .../EditorExportPlatformLinuxBSD.xml | 2 +- platform/linuxbsd/export/export_plugin.cpp | 4 +- .../linuxbsd/freedesktop_portal_desktop.cpp | 33 +- .../linuxbsd/freedesktop_portal_desktop.h | 5 +- platform/linuxbsd/os_linuxbsd.cpp | 2 +- .../linuxbsd/platform_linuxbsd_builders.py | 6 +- platform/linuxbsd/tts_linux.cpp | 4 +- platform/linuxbsd/tts_linux.h | 6 +- platform/linuxbsd/wayland/SCsub | 11 + .../wayland/display_server_wayland.cpp | 4 + .../linuxbsd/wayland/display_server_wayland.h | 2 + platform/linuxbsd/wayland/wayland_thread.cpp | 33 +- platform/linuxbsd/wayland/wayland_thread.h | 6 + platform/linuxbsd/x11/display_server_x11.cpp | 4 + platform/linuxbsd/x11/display_server_x11.h | 2 + platform/macos/dir_access_macos.h | 2 + platform/macos/dir_access_macos.mm | 10 + platform/macos/display_server_macos.h | 18 +- platform/macos/display_server_macos.mm | 31 +- .../doc_classes/EditorExportPlatformMacOS.xml | 10 +- platform/macos/os_macos.h | 1 + platform/macos/os_macos.mm | 15 +- platform/web/SCsub | 11 +- platform/web/api/api.cpp | 2 - .../web_tools_editor_plugin.cpp | 4 - .../{api => editor}/web_tools_editor_plugin.h | 4 - platform/web/emscripten_helpers.py | 8 +- platform/web/export/export_plugin.cpp | 7 - platform/web/js/engine/config.js | 2 - platform/web/js/engine/engine.js | 6 +- platform/web/js/libs/library_godot_os.js | 25 +- platform/web/web_main.cpp | 8 + platform/windows/display_server_windows.cpp | 74 +- platform/windows/display_server_windows.h | 9 +- platform/windows/export/export_plugin.cpp | 4 +- platform/windows/os_windows.cpp | 113 +- platform/windows/os_windows.h | 4 + platform/windows/tts_windows.cpp | 10 +- platform/windows/tts_windows.h | 4 +- platform/windows/windows_utils.cpp | 4 +- platform_methods.py | 3 +- scene/2d/animated_sprite_2d.h | 2 +- scene/2d/audio_stream_player_2d.cpp | 5 +- scene/2d/camera_2d.cpp | 2 +- scene/2d/cpu_particles_2d.cpp | 8 +- scene/2d/gpu_particles_2d.cpp | 7 +- scene/2d/line_builder.cpp | 2 +- scene/2d/mesh_instance_2d.cpp | 3 + scene/2d/navigation_region_2d.cpp | 31 +- scene/2d/navigation_region_2d.h | 2 +- scene/2d/physics/physics_body_2d.cpp | 3 +- scene/2d/skeleton_2d.cpp | 1 + scene/3d/audio_stream_player_3d.cpp | 12 +- scene/3d/camera_3d.cpp | 7 +- scene/3d/cpu_particles_3d.cpp | 8 +- scene/3d/gpu_particles_3d.cpp | 8 +- scene/3d/lightmap_gi.cpp | 2 + scene/3d/lightmapper.h | 1 + scene/3d/look_at_modifier_3d.cpp | 76 +- scene/3d/look_at_modifier_3d.h | 8 +- scene/3d/node_3d.cpp | 4 +- scene/3d/physics/collision_shape_3d.cpp | 98 + scene/3d/physics/collision_shape_3d.h | 22 + scene/3d/physics/physics_body_3d.cpp | 3 +- scene/3d/physics/vehicle_body_3d.cpp | 2 +- scene/3d/reflection_probe.cpp | 4 +- scene/3d/retarget_modifier_3d.cpp | 441 +++ scene/3d/retarget_modifier_3d.h | 110 + scene/3d/skeleton_3d.cpp | 56 +- scene/3d/skeleton_3d.h | 32 +- scene/3d/sprite_3d.h | 2 +- scene/3d/voxel_gi.cpp | 49 +- scene/3d/voxel_gi.h | 4 +- scene/3d/voxelizer.cpp | 71 +- scene/3d/voxelizer.h | 14 +- scene/3d/xr_nodes.cpp | 2 +- scene/3d/xr_nodes.h | 4 +- scene/animation/animation_blend_tree.cpp | 18 +- scene/animation/animation_blend_tree.h | 7 + scene/animation/animation_mixer.cpp | 156 +- scene/animation/animation_mixer.h | 5 + .../animation_node_state_machine.cpp | 26 +- .../animation/animation_node_state_machine.h | 3 + scene/animation/animation_player.cpp | 28 +- scene/animation/animation_player.h | 12 + scene/animation/animation_tree.cpp | 14 +- scene/animation/animation_tree.h | 18 +- scene/animation/root_motion_view.cpp | 5 +- scene/audio/audio_stream_player.cpp | 2 +- scene/debugger/scene_debugger.cpp | 56 +- scene/debugger/scene_debugger.h | 3 + scene/gui/button.cpp | 11 +- scene/gui/button.h | 2 +- scene/gui/code_edit.cpp | 8 +- scene/gui/color_mode.h | 2 - scene/gui/color_picker.cpp | 393 ++- scene/gui/color_picker.h | 74 +- scene/gui/control.cpp | 44 +- scene/gui/control.h | 10 +- scene/gui/dialogs.cpp | 2 +- scene/gui/file_dialog.cpp | 220 +- scene/gui/file_dialog.h | 13 + scene/gui/graph_edit.cpp | 11 + scene/gui/graph_edit.h | 1 + scene/gui/label.cpp | 885 +++--- scene/gui/label.h | 33 +- scene/gui/line_edit.cpp | 95 +- scene/gui/line_edit.h | 1 + scene/gui/popup_menu.cpp | 4 +- scene/gui/popup_menu.h | 4 +- scene/gui/rich_text_label.compat.inc | 7 +- scene/gui/rich_text_label.cpp | 356 ++- scene/gui/rich_text_label.h | 19 +- scene/gui/scroll_bar.cpp | 16 +- scene/gui/scroll_container.cpp | 37 + scene/gui/scroll_container.h | 8 + scene/gui/slider.cpp | 39 +- scene/gui/spin_box.cpp | 2 +- scene/gui/subviewport_container.cpp | 12 + scene/gui/subviewport_container.h | 5 + scene/gui/text_edit.cpp | 8 +- scene/gui/texture_button.cpp | 2 +- scene/gui/texture_progress_bar.cpp | 2 +- scene/gui/tree.cpp | 22 +- scene/gui/tree.h | 9 +- scene/main/canvas_layer.cpp | 8 +- scene/main/canvas_layer.h | 10 +- scene/main/node.cpp | 10 +- scene/main/scene_tree.cpp | 43 +- scene/main/viewport.cpp | 45 +- scene/main/viewport.h | 3 +- scene/main/window.cpp | 27 +- scene/main/window.h | 1 + scene/register_scene_types.cpp | 5 + scene/resources/3d/box_shape_3d.cpp | 20 + scene/resources/3d/box_shape_3d.h | 1 + scene/resources/3d/capsule_shape_3d.cpp | 19 + scene/resources/3d/capsule_shape_3d.h | 3 + .../resources/3d/concave_polygon_shape_3d.cpp | 18 + scene/resources/3d/concave_polygon_shape_3d.h | 3 + .../resources/3d/convex_polygon_shape_3d.cpp | 39 + scene/resources/3d/convex_polygon_shape_3d.h | 3 + scene/resources/3d/cylinder_shape_3d.cpp | 19 + scene/resources/3d/cylinder_shape_3d.h | 3 + scene/resources/3d/height_map_shape_3d.cpp | 59 +- scene/resources/3d/height_map_shape_3d.h | 2 + scene/resources/3d/mesh_library.cpp | 34 + scene/resources/3d/mesh_library.h | 4 + scene/resources/3d/primitive_meshes.cpp | 294 +- .../resources/3d/separation_ray_shape_3d.cpp | 5 + scene/resources/3d/separation_ray_shape_3d.h | 3 + scene/resources/3d/shape_3d.cpp | 80 +- scene/resources/3d/shape_3d.h | 16 + scene/resources/3d/sphere_shape_3d.cpp | 20 + scene/resources/3d/sphere_shape_3d.h | 3 + .../resources/3d/world_boundary_shape_3d.cpp | 48 + scene/resources/3d/world_boundary_shape_3d.h | 3 + scene/resources/SCsub | 8 +- scene/resources/animation_library.cpp | 9 +- scene/resources/animation_library.h | 1 + scene/resources/audio_stream_polyphonic.cpp | 17 +- scene/resources/audio_stream_polyphonic.h | 1 + scene/resources/audio_stream_wav.cpp | 467 ++- scene/resources/audio_stream_wav.h | 125 +- .../resources/color_palette.cpp | 38 +- .../resources/color_palette.h | 28 +- scene/resources/curve.cpp | 142 +- scene/resources/curve.h | 23 +- scene/resources/font.cpp | 77 +- scene/resources/font.h | 12 +- scene/resources/label_settings.cpp | 15 + scene/resources/label_settings.h | 4 + scene/resources/material.cpp | 102 +- scene/resources/material.h | 8 +- scene/resources/multimesh.cpp | 3 + scene/resources/packed_scene.cpp | 15 +- scene/resources/skeleton_profile.cpp | 8 + scene/resources/skeleton_profile.h | 1 + scene/resources/sprite_frames.cpp | 2 +- scene/resources/style_box_flat.cpp | 15 +- scene/resources/text_line.cpp | 22 +- scene/resources/text_line.h | 4 +- scene/resources/text_paragraph.cpp | 42 +- scene/resources/text_paragraph.h | 10 +- scene/resources/theme.cpp | 4 +- scene/resources/visual_shader.cpp | 19 +- scene/resources/visual_shader_nodes.cpp | 36 +- scene/resources/visual_shader_nodes.h | 2 + scene/scene_string_names.cpp | 148 - scene/scene_string_names.h | 220 +- scene/theme/default_theme.cpp | 14 +- scene/theme/icons/clear.svg | 1 + scene/theme/icons/load.svg | 1 + scene/theme/icons/save.svg | 1 + servers/audio/effects/audio_effect_record.cpp | 21 +- .../effects/audio_effect_stereo_enhance.cpp | 26 +- servers/debugger/servers_debugger.cpp | 6 + servers/display_server.cpp | 8 + servers/display_server.h | 5 + servers/physics_server_2d.h | 2 +- servers/physics_server_3d.h | 2 +- servers/register_server_types.cpp | 2 + .../renderer_rd/cluster_builder_rd.cpp | 2 +- .../renderer_rd/effects/bokeh_dof.cpp | 12 +- .../renderer_rd/effects/copy_effects.cpp | 24 +- .../renderer_rd/effects/debug_effects.cpp | 6 +- .../rendering/renderer_rd/effects/fsr2.cpp | 5 +- .../renderer_rd/effects/luminance.cpp | 2 +- .../renderer_rd/effects/ss_effects.cpp | 3 +- .../renderer_rd/effects/tone_mapper.cpp | 2 +- servers/rendering/renderer_rd/effects/vrs.cpp | 2 +- .../rendering/renderer_rd/environment/fog.cpp | 2 +- .../rendering/renderer_rd/environment/gi.cpp | 2 +- .../rendering/renderer_rd/environment/sky.cpp | 16 +- .../render_forward_clustered.cpp | 50 +- .../render_forward_clustered.h | 6 +- .../scene_shader_forward_clustered.cpp | 9 +- .../forward_mobile/render_forward_mobile.cpp | 41 +- .../forward_mobile/render_forward_mobile.h | 4 +- .../scene_shader_forward_mobile.cpp | 17 +- .../scene_shader_forward_mobile.h | 20 +- .../renderer_rd/renderer_canvas_render_rd.cpp | 101 +- .../renderer_rd/renderer_canvas_render_rd.h | 47 +- .../renderer_rd/renderer_scene_render_rd.cpp | 13 +- servers/rendering/renderer_rd/shader_rd.cpp | 33 +- servers/rendering/renderer_rd/shaders/SCsub | 10 +- .../rendering/renderer_rd/shaders/canvas.glsl | 46 +- .../shaders/canvas_uniforms_inc.glsl | 52 +- .../renderer_rd/shaders/decal_data_inc.glsl | 1 - .../effects/luminance_reduce_raster_inc.glsl | 1 - .../effects/subsurface_scattering.glsl | 4 +- .../scene_forward_clustered.glsl | 14 +- .../forward_mobile/scene_forward_mobile.glsl | 31 +- .../scene_forward_mobile_inc.glsl | 55 +- .../shaders/scene_forward_lights_inc.glsl | 455 ++- .../renderer_rd/storage_rd/light_storage.cpp | 2 +- .../renderer_rd/storage_rd/light_storage.h | 10 + .../storage_rd/material_storage.cpp | 33 +- .../renderer_rd/storage_rd/material_storage.h | 3 +- .../renderer_rd/storage_rd/mesh_storage.cpp | 1 + .../storage_rd/particles_storage.cpp | 2 +- .../render_scene_buffers_rd.compat.inc | 6 + .../storage_rd/render_scene_buffers_rd.cpp | 9 +- .../storage_rd/render_scene_buffers_rd.h | 4 +- .../storage_rd/texture_storage.cpp | 6 +- .../renderer_rd/uniform_set_cache_rd.cpp | 3 +- .../renderer_rd/uniform_set_cache_rd.h | 9 +- servers/rendering/renderer_scene_cull.cpp | 36 +- servers/rendering/renderer_scene_cull.h | 28 +- servers/rendering/rendering_device.compat.inc | 24 +- servers/rendering/rendering_device.cpp | 445 +-- servers/rendering/rendering_device.h | 141 +- servers/rendering/rendering_device_binds.cpp | 20 +- servers/rendering/rendering_device_binds.h | 5 + servers/rendering/rendering_device_commons.h | 5 + servers/rendering/rendering_device_graph.cpp | 264 +- servers/rendering/rendering_device_graph.h | 81 +- servers/rendering/shader_compiler.cpp | 2 +- servers/rendering/shader_include_db.cpp | 115 + .../rendering/shader_include_db.h | 53 +- servers/rendering/shader_language.cpp | 10 +- servers/rendering/shader_language.h | 3 +- servers/rendering/shader_preprocessor.cpp | 40 +- servers/rendering/shader_preprocessor.h | 1 + servers/rendering/shader_types.cpp | 1 + servers/text/text_server_extension.cpp | 20 + servers/text/text_server_extension.h | 7 + servers/text_server.cpp | 155 +- servers/text_server.h | 9 + tests/core/io/test_file_access.h | 94 +- tests/core/io/test_marshalls.h | 21 + tests/core/io/test_stream_peer.h | 22 + tests/core/io/test_tcp_server.h | 223 ++ tests/core/io/test_udp_server.h | 293 ++ tests/core/math/test_projection.h | 491 +++- tests/core/object/test_class_db.h | 23 +- tests/core/string/test_string.h | 4 + tests/core/string/test_translation_server.h | 30 + tests/core/variant/test_dictionary.h | 21 + tests/data/floating_point_big_endian.bin | 1 + tests/data/floating_point_little_endian.bin | 1 + ...lf_precision_floating_point_big_endian.bin | 1 + ...precision_floating_point_little_endian.bin | 1 + tests/scene/test_audio_stream_wav.h | 27 +- tests/scene/test_camera_3d.h | 6 + tests/scene/test_control.h | 51 + tests/scene/test_curve.h | 172 +- tests/scene/test_packed_scene.h | 63 + tests/scene/test_sky.h | 119 +- tests/servers/test_navigation_server_3d.h | 15 + tests/servers/test_text_server.h | 34 +- tests/test_macros.h | 3 + tests/test_main.cpp | 5 + thirdparty/README.md | 36 +- .../clipper2/include/clipper2/clipper.core.h | 391 ++- .../include/clipper2/clipper.engine.h | 74 +- .../include/clipper2/clipper.export.h | 123 +- .../clipper2/include/clipper2/clipper.h | 96 +- .../include/clipper2/clipper.minkowski.h | 2 +- .../include/clipper2/clipper.offset.h | 18 +- .../include/clipper2/clipper.rectclip.h | 17 +- .../include/clipper2/clipper.version.h | 2 +- .../patches/clipper2-exceptions.patch | 8 +- .../clipper2/patches/gcc14-warning.patch | 22 - thirdparty/clipper2/patches/llvm-error.patch | 34 + thirdparty/clipper2/src/clipper.engine.cpp | 225 +- thirdparty/clipper2/src/clipper.offset.cpp | 364 +-- thirdparty/clipper2/src/clipper.rectclip.cpp | 111 +- thirdparty/fonts/LICENSE.Vazirmatn.txt | 93 + thirdparty/fonts/NotoNaskhArabicUI_Bold.woff2 | Bin 53860 -> 0 bytes .../fonts/NotoNaskhArabicUI_Regular.woff2 | Bin 53352 -> 0 bytes thirdparty/fonts/Vazirmatn_Bold.woff2 | Bin 0 -> 51184 bytes thirdparty/fonts/Vazirmatn_Regular.woff2 | Bin 0 -> 50596 bytes thirdparty/linuxbsd_headers/alsa/asoundlib.h | 4 + .../alsa/patches/freebsd_endian.diff | 16 + thirdparty/manifold/AUTHORS | 10 + thirdparty/manifold/LICENSE | 201 ++ thirdparty/manifold/include/manifold/common.h | 650 ++++ thirdparty/manifold/include/manifold/linalg.h | 2601 +++++++++++++++++ .../manifold/include/manifold/manifold.h | 435 +++ .../include/manifold/optional_assert.h | 66 + .../manifold/include/manifold/polygon.h | 62 + .../manifold/include/manifold/vec_view.h | 151 + thirdparty/manifold/src/boolean3.cpp | 599 ++++ thirdparty/manifold/src/boolean3.h | 60 + thirdparty/manifold/src/boolean_result.cpp | 889 ++++++ thirdparty/manifold/src/collider.h | 382 +++ thirdparty/manifold/src/constructors.cpp | 503 ++++ .../src/cross_section/cross_section.cpp | 789 +++++ thirdparty/manifold/src/csg_tree.cpp | 662 +++++ thirdparty/manifold/src/csg_tree.h | 89 + thirdparty/manifold/src/edge_op.cpp | 696 +++++ thirdparty/manifold/src/face_op.cpp | 319 ++ thirdparty/manifold/src/hashtable.h | 168 ++ thirdparty/manifold/src/impl.cpp | 689 +++++ thirdparty/manifold/src/impl.h | 352 +++ thirdparty/manifold/src/iters.h | 314 ++ thirdparty/manifold/src/manifold.cpp | 1038 +++++++ thirdparty/manifold/src/mesh_fixes.h | 65 + thirdparty/manifold/src/parallel.h | 1125 +++++++ thirdparty/manifold/src/polygon.cpp | 1010 +++++++ thirdparty/manifold/src/properties.cpp | 388 +++ thirdparty/manifold/src/quickhull.cpp | 860 ++++++ thirdparty/manifold/src/quickhull.h | 288 ++ thirdparty/manifold/src/sdf.cpp | 533 ++++ thirdparty/manifold/src/shared.h | 219 ++ thirdparty/manifold/src/smoothing.cpp | 1003 +++++++ thirdparty/manifold/src/sort.cpp | 517 ++++ thirdparty/manifold/src/sparse.h | 225 ++ thirdparty/manifold/src/subdivision.cpp | 809 +++++ thirdparty/manifold/src/svd.h | 308 ++ thirdparty/manifold/src/tri_dist.h | 225 ++ thirdparty/manifold/src/utils.h | 227 ++ thirdparty/manifold/src/vec.h | 219 ++ .../include/{ => miniupnpc}/igd_desc_parse.h | 0 .../include/{ => miniupnpc}/miniupnpc.h | 0 .../{ => miniupnpc}/miniupnpc_declspec.h | 0 .../include/{ => miniupnpc}/miniupnpctypes.h | 0 .../include/{ => miniupnpc}/miniwget.h | 0 .../{ => miniupnpc}/portlistingparse.h | 0 .../include/{ => miniupnpc}/upnpcommands.h | 0 .../include/{ => miniupnpc}/upnpdev.h | 0 .../include/{ => miniupnpc}/upnpreplyparse.h | 0 thirdparty/misc/patches/qoa-min-fix.patch | 53 - thirdparty/misc/qoa.c | 4 + thirdparty/misc/qoa.h | 24 +- thirdparty/thorvg/AUTHORS | 6 +- thirdparty/thorvg/inc/config.h | 2 +- thirdparty/thorvg/inc/thorvg.h | 292 +- .../pr2740-renderer-crash-hotfix.patch | 45 - ...ert-tvgLines-bezier-precision-change.patch | 10 +- .../thorvg/src/common/tvgCompressor.cpp | 2 +- thirdparty/thorvg/src/common/tvgLines.cpp | 245 -- thirdparty/thorvg/src/common/tvgLines.h | 61 - thirdparty/thorvg/src/common/tvgMath.cpp | 255 +- thirdparty/thorvg/src/common/tvgMath.h | 119 +- thirdparty/thorvg/src/common/tvgStr.cpp | 10 - thirdparty/thorvg/src/common/tvgStr.h | 1 - .../src/loaders/external_png/tvgPngLoader.cpp | 4 +- .../loaders/external_webp/tvgWebpLoader.cpp | 2 +- .../src/loaders/external_webp/tvgWebpLoader.h | 2 +- .../thorvg/src/loaders/jpg/tvgJpgLoader.cpp | 2 +- .../thorvg/src/loaders/jpg/tvgJpgLoader.h | 2 +- thirdparty/thorvg/src/loaders/jpg/tvgJpgd.cpp | 17 +- .../thorvg/src/loaders/svg/tvgSvgLoader.cpp | 49 +- .../src/loaders/svg/tvgSvgLoaderCommon.h | 1 + .../thorvg/src/loaders/svg/tvgSvgPath.cpp | 12 +- .../src/loaders/svg/tvgSvgSceneBuilder.cpp | 36 +- .../thorvg/src/loaders/svg/tvgXmlParser.cpp | 7 +- .../src/renderer/sw_engine/tvgSwCommon.h | 49 +- .../src/renderer/sw_engine/tvgSwFill.cpp | 40 +- .../src/renderer/sw_engine/tvgSwImage.cpp | 4 +- .../src/renderer/sw_engine/tvgSwMath.cpp | 39 +- .../renderer/sw_engine/tvgSwPostEffect.cpp | 410 +++ .../src/renderer/sw_engine/tvgSwRaster.cpp | 456 +-- .../src/renderer/sw_engine/tvgSwRasterAvx.h | 4 +- .../src/renderer/sw_engine/tvgSwRasterC.h | 38 +- .../src/renderer/sw_engine/tvgSwRasterNeon.h | 2 +- .../renderer/sw_engine/tvgSwRasterTexmap.h | 21 +- .../src/renderer/sw_engine/tvgSwRenderer.cpp | 203 +- .../src/renderer/sw_engine/tvgSwRenderer.h | 14 +- .../src/renderer/sw_engine/tvgSwRle.cpp | 257 +- .../src/renderer/sw_engine/tvgSwShape.cpp | 30 +- .../src/renderer/sw_engine/tvgSwStroke.cpp | 40 +- .../thorvg/src/renderer/tvgBinaryDesc.h | 2 +- thirdparty/thorvg/src/renderer/tvgCanvas.h | 16 +- thirdparty/thorvg/src/renderer/tvgCommon.h | 9 - thirdparty/thorvg/src/renderer/tvgFill.cpp | 25 +- thirdparty/thorvg/src/renderer/tvgFill.h | 1 - .../thorvg/src/renderer/tvgGlCanvas.cpp | 4 +- .../thorvg/src/renderer/tvgLoadModule.h | 4 +- thirdparty/thorvg/src/renderer/tvgLoader.cpp | 8 +- thirdparty/thorvg/src/renderer/tvgPaint.cpp | 135 +- thirdparty/thorvg/src/renderer/tvgPaint.h | 23 +- thirdparty/thorvg/src/renderer/tvgPicture.cpp | 16 +- thirdparty/thorvg/src/renderer/tvgPicture.h | 2 +- thirdparty/thorvg/src/renderer/tvgRender.h | 98 +- thirdparty/thorvg/src/renderer/tvgSaver.cpp | 7 +- thirdparty/thorvg/src/renderer/tvgScene.cpp | 66 +- thirdparty/thorvg/src/renderer/tvgScene.h | 60 +- thirdparty/thorvg/src/renderer/tvgShape.cpp | 21 +- thirdparty/thorvg/src/renderer/tvgShape.h | 10 +- .../thorvg/src/renderer/tvgSwCanvas.cpp | 4 +- thirdparty/thorvg/src/renderer/tvgText.cpp | 5 +- thirdparty/thorvg/src/renderer/tvgText.h | 4 +- .../thorvg/src/renderer/tvgWgCanvas.cpp | 15 +- thirdparty/thorvg/update-thorvg.sh | 2 +- thirdparty/ufbx/ufbx.c | 1898 +++++++----- thirdparty/ufbx/ufbx.h | 120 +- .../staging/xdg-system-bell/README | 5 + .../xdg-system-bell/xdg-system-bell-v1.xml | 58 + 1303 files changed, 41966 insertions(+), 12385 deletions(-) delete mode 100644 core/core_string_names.cpp rename modules/text_server_adv/thorvg_bounds_iterator.h => core/string/translation_server.compat.inc (76%) create mode 100644 doc/classes/ColorPalette.xml create mode 100644 doc/classes/RetargetModifier3D.xml create mode 100644 doc/classes/ShaderIncludeDB.xml create mode 100644 editor/icons/FilenameFilter.svg create mode 100644 editor/icons/RetargetModifier3D.svg create mode 100644 misc/utility/problem-matchers.json create mode 100644 modules/betsy/alpha_stitch.glsl delete mode 100644 modules/gdscript/tests/scripts/analyzer/errors/abstract_script_instantiate.gd delete mode 100644 modules/gdscript/tests/scripts/analyzer/errors/abstract_script_instantiate.out create mode 100644 modules/gdscript/tests/scripts/analyzer/errors/enum_builtin_access.gd create mode 100644 modules/gdscript/tests/scripts/analyzer/errors/enum_builtin_access.out create mode 100644 modules/gdscript/tests/scripts/analyzer/errors/enum_global_access.gd create mode 100644 modules/gdscript/tests/scripts/analyzer/errors/enum_global_access.out create mode 100644 modules/gdscript/tests/scripts/analyzer/errors/enum_native_access.gd create mode 100644 modules/gdscript/tests/scripts/analyzer/errors/enum_native_access.out delete mode 100644 modules/gdscript/tests/scripts/analyzer/errors/native_freed_instance.gd delete mode 100644 modules/gdscript/tests/scripts/analyzer/errors/native_freed_instance.out delete mode 100644 modules/gdscript/tests/scripts/analyzer/errors/outer_class_constants.gd delete mode 100644 modules/gdscript/tests/scripts/analyzer/errors/outer_class_constants.out delete mode 100644 modules/gdscript/tests/scripts/analyzer/errors/outer_class_constants_as_variant.gd delete mode 100644 modules/gdscript/tests/scripts/analyzer/errors/outer_class_constants_as_variant.out delete mode 100644 modules/gdscript/tests/scripts/analyzer/errors/outer_class_instance_constants.gd delete mode 100644 modules/gdscript/tests/scripts/analyzer/errors/outer_class_instance_constants.out delete mode 100644 modules/gdscript/tests/scripts/analyzer/errors/outer_class_instance_constants_as_variant.gd delete mode 100644 modules/gdscript/tests/scripts/analyzer/errors/outer_class_instance_constants_as_variant.out delete mode 100644 modules/gdscript/tests/scripts/analyzer/errors/script_freed_instance.gd delete mode 100644 modules/gdscript/tests/scripts/analyzer/errors/script_freed_instance.out create mode 100644 modules/gdscript/tests/scripts/analyzer/features/global_builtin_and_native_enums.gd create mode 100644 modules/gdscript/tests/scripts/analyzer/features/global_builtin_and_native_enums.out create mode 100644 modules/gdscript/tests/scripts/lsp/first_line_comment.gd create mode 100644 modules/gdscript/tests/scripts/parser/errors/warning_ignore_extra_start.gd create mode 100644 modules/gdscript/tests/scripts/parser/errors/warning_ignore_extra_start.out create mode 100644 modules/gdscript/tests/scripts/parser/errors/warning_ignore_restore_without_start.gd create mode 100644 modules/gdscript/tests/scripts/parser/errors/warning_ignore_restore_without_start.out create mode 100644 modules/gdscript/tests/scripts/parser/features/warning_ignore_regions.gd create mode 100644 modules/gdscript/tests/scripts/parser/features/warning_ignore_regions.out rename modules/gdscript/tests/scripts/parser/warnings/{empty_file.notest.gd => empty_file.norun.gd} (100%) create mode 100644 modules/gdscript/tests/scripts/parser/warnings/empty_file.norun.out delete mode 100644 modules/gdscript/tests/scripts/parser/warnings/empty_file.notest.out create mode 100644 modules/gdscript/tests/scripts/parser/warnings/empty_file_comment.norun.gd create mode 100644 modules/gdscript/tests/scripts/parser/warnings/empty_file_comment.norun.out delete mode 100644 modules/gdscript/tests/scripts/parser/warnings/empty_file_comment.notest.gd delete mode 100644 modules/gdscript/tests/scripts/parser/warnings/empty_file_comment.notest.out rename modules/gdscript/tests/scripts/parser/warnings/{empty_file_newline.notest.gd => empty_file_newline.norun.gd} (100%) create mode 100644 modules/gdscript/tests/scripts/parser/warnings/empty_file_newline.norun.out delete mode 100644 modules/gdscript/tests/scripts/parser/warnings/empty_file_newline.notest.out create mode 100644 modules/gdscript/tests/scripts/parser/warnings/empty_file_newline_comment.norun.gd create mode 100644 modules/gdscript/tests/scripts/parser/warnings/empty_file_newline_comment.norun.out delete mode 100644 modules/gdscript/tests/scripts/parser/warnings/empty_file_newline_comment.notest.gd delete mode 100644 modules/gdscript/tests/scripts/parser/warnings/empty_file_newline_comment.notest.out delete mode 100644 modules/gdscript/tests/scripts/runtime/assign_to_read_only_property.gd delete mode 100644 modules/gdscript/tests/scripts/runtime/assign_to_read_only_property.out delete mode 100644 modules/gdscript/tests/scripts/runtime/assign_to_read_only_property_with_variable_index.gd delete mode 100644 modules/gdscript/tests/scripts/runtime/assign_to_read_only_property_with_variable_index.out create mode 100644 modules/gdscript/tests/scripts/runtime/errors/assign_freed_instance.gd create mode 100644 modules/gdscript/tests/scripts/runtime/errors/assign_freed_instance.out create mode 100644 modules/gdscript/tests/scripts/runtime/errors/assign_to_read_only_property.gd create mode 100644 modules/gdscript/tests/scripts/runtime/errors/assign_to_read_only_property.out create mode 100644 modules/gdscript/tests/scripts/runtime/errors/division_by_zero.gd create mode 100644 modules/gdscript/tests/scripts/runtime/errors/division_by_zero.out create mode 100644 modules/gdscript/tests/scripts/runtime/errors/modulo_by_zero.gd create mode 100644 modules/gdscript/tests/scripts/runtime/errors/modulo_by_zero.out create mode 100644 modules/gdscript/tests/scripts/runtime/errors/outer_class_constants.gd create mode 100644 modules/gdscript/tests/scripts/runtime/errors/outer_class_constants.out rename {doc/classes => modules/multiplayer/doc_classes}/OfflineMultiplayerPeer.xml (94%) create mode 100644 modules/upnp/upnp_device_miniupnp.cpp rename modules/{text_server_fb/thorvg_bounds_iterator.cpp => upnp/upnp_device_miniupnp.h} (55%) create mode 100644 modules/upnp/upnp_miniupnp.cpp create mode 100644 modules/upnp/upnp_miniupnp.h create mode 100644 platform/android/java/lib/res/mipmap-anydpi-v26/themed_icon.xml rename platform/web/{api => editor}/web_tools_editor_plugin.cpp (98%) rename platform/web/{api => editor}/web_tools_editor_plugin.h (96%) create mode 100644 scene/3d/retarget_modifier_3d.cpp create mode 100644 scene/3d/retarget_modifier_3d.h rename modules/text_server_fb/thorvg_bounds_iterator.h => scene/resources/color_palette.cpp (76%) rename editor/editor_string_names.cpp => scene/resources/color_palette.h (83%) delete mode 100644 scene/scene_string_names.cpp create mode 100644 scene/theme/icons/clear.svg create mode 100644 scene/theme/icons/load.svg create mode 100644 scene/theme/icons/save.svg create mode 100644 servers/rendering/shader_include_db.cpp rename modules/text_server_adv/thorvg_bounds_iterator.cpp => servers/rendering/shader_include_db.h (66%) create mode 100644 tests/core/io/test_tcp_server.h create mode 100644 tests/core/io/test_udp_server.h create mode 100644 tests/data/floating_point_big_endian.bin create mode 100644 tests/data/floating_point_little_endian.bin create mode 100644 tests/data/half_precision_floating_point_big_endian.bin create mode 100644 tests/data/half_precision_floating_point_little_endian.bin delete mode 100644 thirdparty/clipper2/patches/gcc14-warning.patch create mode 100644 thirdparty/clipper2/patches/llvm-error.patch create mode 100644 thirdparty/fonts/LICENSE.Vazirmatn.txt delete mode 100644 thirdparty/fonts/NotoNaskhArabicUI_Bold.woff2 delete mode 100644 thirdparty/fonts/NotoNaskhArabicUI_Regular.woff2 create mode 100644 thirdparty/fonts/Vazirmatn_Bold.woff2 create mode 100644 thirdparty/fonts/Vazirmatn_Regular.woff2 create mode 100644 thirdparty/linuxbsd_headers/alsa/patches/freebsd_endian.diff create mode 100644 thirdparty/manifold/AUTHORS create mode 100644 thirdparty/manifold/LICENSE create mode 100644 thirdparty/manifold/include/manifold/common.h create mode 100644 thirdparty/manifold/include/manifold/linalg.h create mode 100644 thirdparty/manifold/include/manifold/manifold.h create mode 100644 thirdparty/manifold/include/manifold/optional_assert.h create mode 100644 thirdparty/manifold/include/manifold/polygon.h create mode 100644 thirdparty/manifold/include/manifold/vec_view.h create mode 100644 thirdparty/manifold/src/boolean3.cpp create mode 100644 thirdparty/manifold/src/boolean3.h create mode 100644 thirdparty/manifold/src/boolean_result.cpp create mode 100644 thirdparty/manifold/src/collider.h create mode 100644 thirdparty/manifold/src/constructors.cpp create mode 100644 thirdparty/manifold/src/cross_section/cross_section.cpp create mode 100644 thirdparty/manifold/src/csg_tree.cpp create mode 100644 thirdparty/manifold/src/csg_tree.h create mode 100644 thirdparty/manifold/src/edge_op.cpp create mode 100644 thirdparty/manifold/src/face_op.cpp create mode 100644 thirdparty/manifold/src/hashtable.h create mode 100644 thirdparty/manifold/src/impl.cpp create mode 100644 thirdparty/manifold/src/impl.h create mode 100644 thirdparty/manifold/src/iters.h create mode 100644 thirdparty/manifold/src/manifold.cpp create mode 100644 thirdparty/manifold/src/mesh_fixes.h create mode 100644 thirdparty/manifold/src/parallel.h create mode 100644 thirdparty/manifold/src/polygon.cpp create mode 100644 thirdparty/manifold/src/properties.cpp create mode 100644 thirdparty/manifold/src/quickhull.cpp create mode 100644 thirdparty/manifold/src/quickhull.h create mode 100644 thirdparty/manifold/src/sdf.cpp create mode 100644 thirdparty/manifold/src/shared.h create mode 100644 thirdparty/manifold/src/smoothing.cpp create mode 100644 thirdparty/manifold/src/sort.cpp create mode 100644 thirdparty/manifold/src/sparse.h create mode 100644 thirdparty/manifold/src/subdivision.cpp create mode 100644 thirdparty/manifold/src/svd.h create mode 100644 thirdparty/manifold/src/tri_dist.h create mode 100644 thirdparty/manifold/src/utils.h create mode 100644 thirdparty/manifold/src/vec.h rename thirdparty/miniupnpc/include/{ => miniupnpc}/igd_desc_parse.h (100%) rename thirdparty/miniupnpc/include/{ => miniupnpc}/miniupnpc.h (100%) rename thirdparty/miniupnpc/include/{ => miniupnpc}/miniupnpc_declspec.h (100%) rename thirdparty/miniupnpc/include/{ => miniupnpc}/miniupnpctypes.h (100%) rename thirdparty/miniupnpc/include/{ => miniupnpc}/miniwget.h (100%) rename thirdparty/miniupnpc/include/{ => miniupnpc}/portlistingparse.h (100%) rename thirdparty/miniupnpc/include/{ => miniupnpc}/upnpcommands.h (100%) rename thirdparty/miniupnpc/include/{ => miniupnpc}/upnpdev.h (100%) rename thirdparty/miniupnpc/include/{ => miniupnpc}/upnpreplyparse.h (100%) delete mode 100644 thirdparty/misc/patches/qoa-min-fix.patch create mode 100644 thirdparty/misc/qoa.c delete mode 100644 thirdparty/thorvg/patches/pr2740-renderer-crash-hotfix.patch delete mode 100644 thirdparty/thorvg/src/common/tvgLines.cpp delete mode 100644 thirdparty/thorvg/src/common/tvgLines.h create mode 100644 thirdparty/thorvg/src/renderer/sw_engine/tvgSwPostEffect.cpp create mode 100644 thirdparty/wayland-protocols/staging/xdg-system-bell/README create mode 100644 thirdparty/wayland-protocols/staging/xdg-system-bell/xdg-system-bell-v1.xml diff --git a/.clang-format b/.clang-format index 338ce6b7f392..46923aae03d2 100644 --- a/.clang-format +++ b/.clang-format @@ -1,6 +1,6 @@ # Commented out parameters are those with the same value as base LLVM style. # We can uncomment them if we want to change their value, or enforce the -# chosen value in case the base style changes (last sync: Clang 18.1.8). +# chosen value in case the base style changes (last sync: Clang 17.0.6). BasedOnStyle: LLVM AccessModifierOffset: -4 AlignAfterOpenBracket: DontAlign @@ -10,28 +10,24 @@ AlignAfterOpenBracket: DontAlign # AcrossEmptyLines: false # AcrossComments: false # AlignCompound: false -# AlignFunctionPointers: false # PadOperators: true # AlignConsecutiveBitFields: # Enabled: false # AcrossEmptyLines: false # AcrossComments: false # AlignCompound: false -# AlignFunctionPointers: false # PadOperators: false # AlignConsecutiveDeclarations: # Enabled: false # AcrossEmptyLines: false # AcrossComments: false # AlignCompound: false -# AlignFunctionPointers: false # PadOperators: false # AlignConsecutiveMacros: # Enabled: false # AcrossEmptyLines: false # AcrossComments: false # AlignCompound: false -# AlignFunctionPointers: false # PadOperators: false # AlignConsecutiveShortCaseStatements: # Enabled: false @@ -45,15 +41,14 @@ AlignTrailingComments: OverEmptyLines: 0 # AllowAllArgumentsOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: false -# AllowBreakBeforeNoexceptSpecifier: Never # AllowShortBlocksOnASingleLine: Never # AllowShortCaseLabelsOnASingleLine: false -# AllowShortCompoundRequirementOnASingleLine: true # AllowShortEnumsOnASingleLine: true # AllowShortFunctionsOnASingleLine: All # AllowShortIfStatementsOnASingleLine: Never # AllowShortLambdasOnASingleLine: All # AllowShortLoopsOnASingleLine: false +# AlwaysBreakAfterDefinitionReturnType: None # AlwaysBreakAfterReturnType: None # AlwaysBreakBeforeMultilineStrings: false # AlwaysBreakTemplateDeclarations: MultiLine @@ -81,8 +76,7 @@ AllowAllParametersOfDeclarationOnNextLine: false # SplitEmptyFunction: true # SplitEmptyRecord: true # SplitEmptyNamespace: true -# BreakAdjacentStringLiterals: true -# BreakAfterAttributes: Leave +# BreakAfterAttributes: Never # BreakAfterJavaFieldAnnotations: false # BreakArrays: true # BreakBeforeBinaryOperators: None @@ -171,7 +165,6 @@ PackConstructorInitializers: NextLine # PenaltyBreakComment: 300 # PenaltyBreakFirstLessLess: 120 # PenaltyBreakOpenParenthesis: 0 -# PenaltyBreakScopeResolution: 500 # PenaltyBreakString: 1000 # PenaltyBreakTemplateDeclaration: 10 # PenaltyExcessCharacter: 1000000 @@ -188,7 +181,6 @@ RemoveSemicolon: true # RequiresExpressionIndentation: OuterScope # SeparateDefinitionBlocks: Leave # ShortNamespaceLines: 1 -# SkipMacroDefinitionBody: false # SortIncludes: CaseSensitive # SortJavaStaticImport: Before # SortUsingDeclarations: LexicographicNumeric @@ -202,6 +194,7 @@ RemoveSemicolon: true # SpaceBeforeCtorInitializerColon: true # SpaceBeforeInheritanceColon: true # SpaceBeforeJsonColon: false +# SpaceBeforeParens: ControlStatements # SpaceBeforeParensOptions: # AfterControlStatements: true # AfterForeachMacros: true @@ -209,7 +202,6 @@ RemoveSemicolon: true # AfterFunctionDefinitionName: false # AfterIfMacros: true # AfterOverloadedOperator: false -# AfterPlacementOperator: true # AfterRequiresInClause: false # AfterRequiresInExpression: false # BeforeNonEmptyParentheses: false @@ -219,10 +211,8 @@ RemoveSemicolon: true # SpacesBeforeTrailingComments: 1 # SpacesInAngles: Never # SpacesInContainerLiterals: true -## Godot TODO: We'll want to use a min of 1, but we need to see how to fix -## our comment capitalization at the same time. SpacesInLineCommentPrefix: - Minimum: 0 + Minimum: 0 # We want a minimum of 1 for comments, but allow 0 for disabled code. Maximum: -1 # SpacesInParens: Never # SpacesInParensOptions: diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 6c8a8ef91981..713c982123bd 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -121,6 +121,7 @@ /modules/mbedtls/tests/ @godotengine/network @godotengine/tests /modules/multiplayer/ @godotengine/network /modules/multiplayer/doc_classes/ @godotengine/network @godotengine/documentation +/modules/multiplayer/tests/ @godotengine/network @godotengine/tests /modules/upnp/ @godotengine/network /modules/upnp/doc_classes/ @godotengine/network @godotengine/documentation /modules/webrtc/ @godotengine/network diff --git a/.github/actions/godot-deps/action.yml b/.github/actions/godot-deps/action.yml index bd9a1f55ed35..d9b95e844841 100644 --- a/.github/actions/godot-deps/action.yml +++ b/.github/actions/godot-deps/action.yml @@ -10,7 +10,7 @@ inputs: default: x64 scons-version: description: The SCons version to use. - default: 4.8.0 + default: 4.8.1 runs: using: composite @@ -29,3 +29,7 @@ runs: python -c "import sys; print(sys.version)" python -m pip install scons==${{ inputs.scons-version }} scons --version + + - name: Setup problem matchers + shell: bash + run: echo ::add-matcher::misc/utility/problem-matchers.json diff --git a/.github/workflows/godot_cpp_test.yml b/.github/workflows/godot_cpp_test.yml index af99a4b03576..ae2fc9388c37 100644 --- a/.github/workflows/godot_cpp_test.yml +++ b/.github/workflows/godot_cpp_test.yml @@ -21,7 +21,9 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: - sparse-checkout: .github + sparse-checkout: | + .github + misc/utility/problem-matchers.json - name: Checkout godot-cpp uses: actions/checkout@v4 @@ -34,9 +36,6 @@ jobs: - name: Setup Python and SCons uses: ./.github/actions/godot-deps - - name: Setup GCC problem matcher - uses: ammaraskar/gcc-problem-matcher@master - - name: Download GDExtension interface and API dump uses: ./.github/actions/download-artifact with: diff --git a/.github/workflows/linux_builds.yml b/.github/workflows/linux_builds.yml index bd4e2856e398..f7dbeb6a0606 100644 --- a/.github/workflows/linux_builds.yml +++ b/.github/workflows/linux_builds.yml @@ -133,9 +133,6 @@ jobs: python-version: 3.8 scons-version: 4.0 - - name: Setup GCC problem matcher - uses: ammaraskar/gcc-problem-matcher@master - - name: Compilation uses: ./.github/actions/godot-build with: @@ -158,6 +155,9 @@ jobs: - name: Build .NET solutions if: matrix.build-mono run: | + # FIXME: C# warnings should be properly handled eventually, but we don't want to clutter + # the GitHub Actions annotations, so remove the associated problem matcher for now. + echo "::remove-matcher owner=msvc::" ./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=linuxbsd - name: Prepare artifact diff --git a/.github/workflows/windows_builds.yml b/.github/workflows/windows_builds.yml index 384284b6047e..055e11d9e66d 100644 --- a/.github/workflows/windows_builds.yml +++ b/.github/workflows/windows_builds.yml @@ -86,14 +86,6 @@ jobs: - name: Extract pre-built ANGLE static libraries run: Expand-Archive -Force angle/angle.zip ${{ github.workspace }}/ - - name: Setup MSVC problem matcher - if: matrix.compiler == 'msvc' - uses: ammaraskar/msvc-problem-matcher@master - - - name: Setup GCC problem matcher - if: matrix.compiler != 'msvc' - uses: ammaraskar/gcc-problem-matcher@master - - name: Compilation uses: ./.github/actions/godot-build with: diff --git a/.gitignore b/.gitignore index f72ea1ac5143..22a1d53a8791 100644 --- a/.gitignore +++ b/.gitignore @@ -216,6 +216,7 @@ xcuserdata/ *.xcscmblueprint *.xccheckout *.xcodeproj/* +!misc/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj ############################## ### Visual Studio specific ### diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2fa0493544bd..77418d45b03c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -184,10 +184,11 @@ repos: .*\.patch$| .*\.out$| modules/gdscript/tests/scripts/parser/features/mixed_indentation_on_blank_lines\.gd$| - modules/gdscript/tests/scripts/parser/warnings/empty_file_newline_comment\.notest\.gd$| - modules/gdscript/tests/scripts/parser/warnings/empty_file_newline\.notest\.gd$| + modules/gdscript/tests/scripts/parser/warnings/empty_file_newline_comment\.norun\.gd$| + modules/gdscript/tests/scripts/parser/warnings/empty_file_newline\.norun\.gd$| platform/android/java/editor/src/main/java/com/android/.*| - platform/android/java/lib/src/com/google/.* + platform/android/java/lib/src/com/google/.*| + tests/data/.*\.bin$ ) - id: dotnet-format diff --git a/COPYRIGHT.txt b/COPYRIGHT.txt index 2ece06eebbfb..cff3642cb63e 100644 --- a/COPYRIGHT.txt +++ b/COPYRIGHT.txt @@ -186,7 +186,7 @@ License: MPL-2.0 Files: ./thirdparty/clipper2/ Comment: Clipper2 -Copyright: 2010-2023, Angus Johnson +Copyright: 2010-2024, Angus Johnson License: BSL-1.0 Files: ./thirdparty/cvtt/ @@ -240,6 +240,11 @@ Comment: Noto Sans font Copyright: 2012, Google Inc. License: OFL-1.1 +Files: ./thirdparty/fonts/Vazirmatn*.woff2 +Comment: Vazirmatn font +Copyright: 2015, The Vazirmatn Project Authors. +License: OFL-1.1 + Files: ./thirdparty/freetype/ Comment: The FreeType Project Copyright: 1996-2023, David Turner, Robert Wilhelm, and Werner Lemberg. @@ -334,6 +339,11 @@ Comment: WebP codec Copyright: 2010, Google Inc. License: BSD-3-clause +Files: ./thirdparty/manifold/ +Comment: Manifold +Copyright: 2020-2024, The Manifold Authors +License: Apache-2.0 + Files: ./thirdparty/mbedtls/ Comment: Mbed TLS Copyright: The Mbed TLS Contributors diff --git a/SConstruct b/SConstruct index 7c7d3d25a0db..fa324b2aa0fa 100644 --- a/SConstruct +++ b/SConstruct @@ -227,7 +227,6 @@ opts.Add(BoolVariable("use_volk", "Use the volk library to load the Vulkan loade opts.Add(BoolVariable("disable_exceptions", "Force disabling exception handling code", True)) opts.Add("custom_modules", "A list of comma-separated directory paths containing custom modules to build.", "") opts.Add(BoolVariable("custom_modules_recursive", "Detect custom modules recursively for each specified path.", True)) -opts.Add(BoolVariable("swappy", "Use Swappy Frame Pacing Library in Android builds.", False)) # Advanced options opts.Add( @@ -383,8 +382,7 @@ if env["platform"] not in platform_list: # Add platform-specific options. if env["platform"] in platform_opts: - for opt in platform_opts[env["platform"]]: - opts.Add(opt) + opts.AddVariables(*platform_opts[env["platform"]]) # Platform-specific flags. # These can sometimes override default options, so they need to be processed @@ -440,12 +438,11 @@ for name, path in modules_detected.items(): else: enabled = False - opts.Add(BoolVariable("module_" + name + "_enabled", "Enable module '%s'" % (name,), enabled)) + opts.Add(BoolVariable(f"module_{name}_enabled", f"Enable module '{name}'", enabled)) # Add module-specific options. try: - for opt in config.get_opts(env["platform"]): - opts.Add(opt) + opts.AddVariables(*config.get_opts(env["platform"])) except AttributeError: pass @@ -580,7 +577,7 @@ env.Append(RCFLAGS=env.get("rcflags", "").split()) # Feature build profile env.disabled_classes = [] if env["build_profile"] != "": - print('Using feature build profile: "{}"'.format(env["build_profile"])) + print(f'Using feature build profile: "{env["build_profile"]}"') import json try: @@ -592,7 +589,7 @@ if env["build_profile"] != "": for c in dbo: env[c] = dbo[c] except json.JSONDecodeError: - print_error('Failed to open feature build profile: "{}"'.format(env["build_profile"])) + print_error(f'Failed to open feature build profile: "{env["build_profile"]}"') Exit(255) # 'dev_mode' and 'production' are aliases to set default options if they haven't been @@ -854,8 +851,6 @@ else: # GCC, Clang if methods.using_gcc(env): common_warnings += ["-Wshadow", "-Wno-misleading-indentation"] - if cc_version_major == 7: # Bogus warning fixed in 8+. - common_warnings += ["-Wno-strict-overflow"] if cc_version_major < 11: # Regression in GCC 9/10, spams so much in our variadic templates # that we need to outright disable it. @@ -931,7 +926,7 @@ env.module_icons_paths = [] env.doc_class_path = platform_doc_class_path for name, path in modules_detected.items(): - if not env["module_" + name + "_enabled"]: + if not env[f"module_{name}_enabled"]: continue sys.path.insert(0, path) env.current_module = name @@ -1044,7 +1039,7 @@ if env["compiledb"]: if env["ninja"]: if env.scons_version < (4, 2, 0): - print_error("The `ninja=yes` option requires SCons 4.2 or later, but your version is %s." % scons_raw_version) + print_error(f"The `ninja=yes` option requires SCons 4.2 or later, but your version is {scons_raw_version}.") Exit(255) SetOption("experimental", "ninja") diff --git a/core/config/engine.cpp b/core/config/engine.cpp index aac048e93f7e..250f39b08a32 100644 --- a/core/config/engine.cpp +++ b/core/config/engine.cpp @@ -248,6 +248,9 @@ String Engine::get_architecture_name() const { return "ppc"; #endif +#elif defined(__loongarch64) + return "loongarch64"; + #elif defined(__wasm__) #if defined(__wasm64__) return "wasm64"; diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index 6c28b00f4870..a8cdb6f737f5 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -749,7 +749,7 @@ Error ProjectSettings::_load_settings_binary(const String &p_path) { cs[slen] = 0; f->get_buffer((uint8_t *)cs.ptr(), slen); String key; - key.parse_utf8(cs.ptr()); + key.parse_utf8(cs.ptr(), slen); uint32_t vlen = f->get_32(); Vector d; @@ -1516,7 +1516,11 @@ ProjectSettings::ProjectSettings() { GLOBAL_DEF("display/window/frame_pacing/android/enable_frame_pacing", true); GLOBAL_DEF(PropertyInfo(Variant::INT, "display/window/frame_pacing/android/swappy_mode", PROPERTY_HINT_ENUM, "pipeline_forced_on,auto_fps_pipeline_forced_on,auto_fps_auto_pipeline"), 2); - custom_prop_info["rendering/driver/threads/thread_model"] = PropertyInfo(Variant::INT, "rendering/driver/threads/thread_model", PROPERTY_HINT_ENUM, "Single-Unsafe,Single-Safe,Multi-Threaded"); +#ifdef DISABLE_DEPRECATED + custom_prop_info["rendering/driver/threads/thread_model"] = PropertyInfo(Variant::INT, "rendering/driver/threads/thread_model", PROPERTY_HINT_ENUM, "Safe:1,Separate"); +#else + custom_prop_info["rendering/driver/threads/thread_model"] = PropertyInfo(Variant::INT, "rendering/driver/threads/thread_model", PROPERTY_HINT_ENUM, "Unsafe (deprecated),Safe,Separate"); +#endif GLOBAL_DEF("physics/2d/run_on_separate_thread", false); GLOBAL_DEF("physics/3d/run_on_separate_thread", false); diff --git a/core/core_bind.cpp b/core/core_bind.cpp index 925551d933fe..66bf5f41e14e 100644 --- a/core/core_bind.cpp +++ b/core/core_bind.cpp @@ -577,6 +577,11 @@ String OS::get_cache_dir() const { return ::OS::get_singleton()->get_cache_path(); } +String OS::get_temp_dir() const { + // Exposed as `get_temp_dir()` instead of `get_temp_path()` for consistency with other exposed OS methods. + return ::OS::get_singleton()->get_temp_path(); +} + bool OS::is_debug_build() const { #ifdef DEBUG_ENABLED return true; @@ -705,6 +710,7 @@ void OS::_bind_methods() { ClassDB::bind_method(D_METHOD("get_config_dir"), &OS::get_config_dir); ClassDB::bind_method(D_METHOD("get_data_dir"), &OS::get_data_dir); ClassDB::bind_method(D_METHOD("get_cache_dir"), &OS::get_cache_dir); + ClassDB::bind_method(D_METHOD("get_temp_dir"), &OS::get_temp_dir); ClassDB::bind_method(D_METHOD("get_unique_id"), &OS::get_unique_id); ClassDB::bind_method(D_METHOD("get_keycode_string", "code"), &OS::get_keycode_string); diff --git a/core/core_bind.h b/core/core_bind.h index d013e348bd87..3b0442bd65a0 100644 --- a/core/core_bind.h +++ b/core/core_bind.h @@ -262,6 +262,7 @@ class OS : public Object { String get_config_dir() const; String get_data_dir() const; String get_cache_dir() const; + String get_temp_dir() const; Error set_thread_name(const String &p_name); ::Thread::ID get_thread_caller_id() const; diff --git a/core/core_constants.cpp b/core/core_constants.cpp index 25da49fa5c3e..cdb4f2c800d8 100644 --- a/core/core_constants.cpp +++ b/core/core_constants.cpp @@ -678,6 +678,7 @@ void register_global_constants() { BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_HIDE_QUATERNION_EDIT); BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_PASSWORD); BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_TOOL_BUTTON); + BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_ONESHOT); BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_MAX); BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_NONE); diff --git a/core/core_string_names.cpp b/core/core_string_names.cpp deleted file mode 100644 index 9bf625cc1578..000000000000 --- a/core/core_string_names.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************/ -/* core_string_names.cpp */ -/**************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* https://godotengine.org */ -/**************************************************************************/ -/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/**************************************************************************/ - -#include "core_string_names.h" - -CoreStringNames *CoreStringNames::singleton = nullptr; - -CoreStringNames::CoreStringNames() : - free_(StaticCString::create("free")), - changed(StaticCString::create("changed")), - script(StaticCString::create("script")), - script_changed(StaticCString::create("script_changed")), - _iter_init(StaticCString::create("_iter_init")), - _iter_next(StaticCString::create("_iter_next")), - _iter_get(StaticCString::create("_iter_get")), - get_rid(StaticCString::create("get_rid")), - _to_string(StaticCString::create("_to_string")), - _custom_features(StaticCString::create("_custom_features")), - - x(StaticCString::create("x")), - y(StaticCString::create("y")), - z(StaticCString::create("z")), - w(StaticCString::create("w")), - r(StaticCString::create("r")), - g(StaticCString::create("g")), - b(StaticCString::create("b")), - a(StaticCString::create("a")), - position(StaticCString::create("position")), - size(StaticCString::create("size")), - end(StaticCString::create("end")), - basis(StaticCString::create("basis")), - origin(StaticCString::create("origin")), - normal(StaticCString::create("normal")), - d(StaticCString::create("d")), - h(StaticCString::create("h")), - s(StaticCString::create("s")), - v(StaticCString::create("v")), - r8(StaticCString::create("r8")), - g8(StaticCString::create("g8")), - b8(StaticCString::create("b8")), - a8(StaticCString::create("a8")), - - call(StaticCString::create("call")), - call_deferred(StaticCString::create("call_deferred")), - bind(StaticCString::create("bind")), - notification(StaticCString::create("notification")), - property_list_changed(StaticCString::create("property_list_changed")) { -} diff --git a/core/core_string_names.h b/core/core_string_names.h index d4ba9110c30e..be3bc38e70ad 100644 --- a/core/core_string_names.h +++ b/core/core_string_names.h @@ -34,61 +34,56 @@ #include "core/string/string_name.h" class CoreStringNames { - friend void register_core_types(); - friend void unregister_core_types(); + inline static CoreStringNames *singleton = nullptr; +public: static void create() { singleton = memnew(CoreStringNames); } static void free() { memdelete(singleton); singleton = nullptr; } - CoreStringNames(); - -public: _FORCE_INLINE_ static CoreStringNames *get_singleton() { return singleton; } - static CoreStringNames *singleton; - - StringName free_; // "free", conflict with C++ keyword. - StringName changed; - StringName script; - StringName script_changed; - StringName _iter_init; - StringName _iter_next; - StringName _iter_get; - StringName get_rid; - StringName _to_string; - StringName _custom_features; + const StringName free_ = StaticCString::create("free"); // free would conflict with C++ keyword. + const StringName changed = StaticCString::create("changed"); + const StringName script = StaticCString::create("script"); + const StringName script_changed = StaticCString::create("script_changed"); + const StringName _iter_init = StaticCString::create("_iter_init"); + const StringName _iter_next = StaticCString::create("_iter_next"); + const StringName _iter_get = StaticCString::create("_iter_get"); + const StringName get_rid = StaticCString::create("get_rid"); + const StringName _to_string = StaticCString::create("_to_string"); + const StringName _custom_features = StaticCString::create("_custom_features"); - StringName x; - StringName y; - StringName z; - StringName w; - StringName r; - StringName g; - StringName b; - StringName a; - StringName position; - StringName size; - StringName end; - StringName basis; - StringName origin; - StringName normal; - StringName d; - StringName h; - StringName s; - StringName v; - StringName r8; - StringName g8; - StringName b8; - StringName a8; + const StringName x = StaticCString::create("x"); + const StringName y = StaticCString::create("y"); + const StringName z = StaticCString::create("z"); + const StringName w = StaticCString::create("w"); + const StringName r = StaticCString::create("r"); + const StringName g = StaticCString::create("g"); + const StringName b = StaticCString::create("b"); + const StringName a = StaticCString::create("a"); + const StringName position = StaticCString::create("position"); + const StringName size = StaticCString::create("size"); + const StringName end = StaticCString::create("end"); + const StringName basis = StaticCString::create("basis"); + const StringName origin = StaticCString::create("origin"); + const StringName normal = StaticCString::create("normal"); + const StringName d = StaticCString::create("d"); + const StringName h = StaticCString::create("h"); + const StringName s = StaticCString::create("s"); + const StringName v = StaticCString::create("v"); + const StringName r8 = StaticCString::create("r8"); + const StringName g8 = StaticCString::create("g8"); + const StringName b8 = StaticCString::create("b8"); + const StringName a8 = StaticCString::create("a8"); - StringName call; - StringName call_deferred; - StringName bind; - StringName notification; - StringName property_list_changed; + const StringName call = StaticCString::create("call"); + const StringName call_deferred = StaticCString::create("call_deferred"); + const StringName bind = StaticCString::create("bind"); + const StringName notification = StaticCString::create("notification"); + const StringName property_list_changed = StaticCString::create("property_list_changed"); }; #define CoreStringName(m_name) CoreStringNames::get_singleton()->m_name diff --git a/core/crypto/crypto.h b/core/crypto/crypto.h index c19e6b6773bb..dc4441c9b88c 100644 --- a/core/crypto/crypto.h +++ b/core/crypto/crypto.h @@ -155,6 +155,10 @@ class ResourceFormatLoaderCrypto : public ResourceFormatLoader { virtual void get_recognized_extensions(List *p_extensions) const override; virtual bool handles_type(const String &p_type) const override; virtual String get_resource_type(const String &p_path) const override; + + // Treat certificates as text files, do not generate a `*.{crt,key,pub}.uid` file. + virtual ResourceUID::ID get_resource_uid(const String &p_path) const override { return ResourceUID::INVALID_ID; } + virtual bool has_custom_uid_support() const override { return true; } }; class ResourceFormatSaverCrypto : public ResourceFormatSaver { diff --git a/core/debugger/remote_debugger_peer.cpp b/core/debugger/remote_debugger_peer.cpp index d38fbc8d9116..499b221ce6a7 100644 --- a/core/debugger/remote_debugger_peer.cpp +++ b/core/debugger/remote_debugger_peer.cpp @@ -223,7 +223,7 @@ RemoteDebuggerPeer *RemoteDebuggerPeerTCP::create(const String &p_uri) { String debug_host = p_uri.replace("tcp://", ""); uint16_t debug_port = 6007; - if (debug_host.contains(":")) { + if (debug_host.contains_char(':')) { int sep_pos = debug_host.rfind_char(':'); debug_port = debug_host.substr(sep_pos + 1).to_int(); debug_host = debug_host.substr(0, sep_pos); diff --git a/core/extension/extension_api_dump.cpp b/core/extension/extension_api_dump.cpp index 7263cafdf3cb..9429ad1ef8a4 100644 --- a/core/extension/extension_api_dump.cpp +++ b/core/extension/extension_api_dump.cpp @@ -1205,7 +1205,7 @@ Dictionary GDExtensionAPIDump::generate_extension_api(bool p_include_docs) { if (F.name.begins_with("_")) { continue; //hidden property } - if (F.name.contains("/")) { + if (F.name.contains_char('/')) { // Ignore properties with '/' (slash) in the name. These are only meant for use in the inspector. continue; } diff --git a/core/extension/gdextension_interface.cpp b/core/extension/gdextension_interface.cpp index 203f7960dc53..85d53c31ecaa 100644 --- a/core/extension/gdextension_interface.cpp +++ b/core/extension/gdextension_interface.cpp @@ -700,6 +700,91 @@ static GDExtensionTypeFromVariantConstructorFunc gdextension_get_variant_to_type ERR_FAIL_V_MSG(nullptr, "Getting Variant conversion function with invalid type"); } +static GDExtensionVariantGetInternalPtrFunc gdextension_variant_get_ptr_internal_getter(GDExtensionVariantType p_type) { + switch (p_type) { + case GDEXTENSION_VARIANT_TYPE_BOOL: + return reinterpret_cast(static_cast(VariantInternal::get_bool)); + case GDEXTENSION_VARIANT_TYPE_INT: + return reinterpret_cast(static_cast(VariantInternal::get_int)); + case GDEXTENSION_VARIANT_TYPE_FLOAT: + return reinterpret_cast(static_cast(VariantInternal::get_float)); + case GDEXTENSION_VARIANT_TYPE_STRING: + return reinterpret_cast(static_cast(VariantInternal::get_string)); + case GDEXTENSION_VARIANT_TYPE_VECTOR2: + return reinterpret_cast(static_cast(VariantInternal::get_vector2)); + case GDEXTENSION_VARIANT_TYPE_VECTOR2I: + return reinterpret_cast(static_cast(VariantInternal::get_vector2i)); + case GDEXTENSION_VARIANT_TYPE_RECT2: + return reinterpret_cast(static_cast(VariantInternal::get_rect2)); + case GDEXTENSION_VARIANT_TYPE_RECT2I: + return reinterpret_cast(static_cast(VariantInternal::get_rect2i)); + case GDEXTENSION_VARIANT_TYPE_VECTOR3: + return reinterpret_cast(static_cast(VariantInternal::get_vector3)); + case GDEXTENSION_VARIANT_TYPE_VECTOR3I: + return reinterpret_cast(static_cast(VariantInternal::get_vector3i)); + case GDEXTENSION_VARIANT_TYPE_TRANSFORM2D: + return reinterpret_cast(static_cast(VariantInternal::get_transform2d)); + case GDEXTENSION_VARIANT_TYPE_VECTOR4: + return reinterpret_cast(static_cast(VariantInternal::get_vector4)); + case GDEXTENSION_VARIANT_TYPE_VECTOR4I: + return reinterpret_cast(static_cast(VariantInternal::get_vector4i)); + case GDEXTENSION_VARIANT_TYPE_PLANE: + return reinterpret_cast(static_cast(VariantInternal::get_plane)); + case GDEXTENSION_VARIANT_TYPE_QUATERNION: + return reinterpret_cast(static_cast(VariantInternal::get_quaternion)); + case GDEXTENSION_VARIANT_TYPE_AABB: + return reinterpret_cast(static_cast(VariantInternal::get_aabb)); + case GDEXTENSION_VARIANT_TYPE_BASIS: + return reinterpret_cast(static_cast(VariantInternal::get_basis)); + case GDEXTENSION_VARIANT_TYPE_TRANSFORM3D: + return reinterpret_cast(static_cast(VariantInternal::get_transform)); + case GDEXTENSION_VARIANT_TYPE_PROJECTION: + return reinterpret_cast(static_cast(VariantInternal::get_projection)); + case GDEXTENSION_VARIANT_TYPE_COLOR: + return reinterpret_cast(static_cast(VariantInternal::get_color)); + case GDEXTENSION_VARIANT_TYPE_STRING_NAME: + return reinterpret_cast(static_cast(VariantInternal::get_string_name)); + case GDEXTENSION_VARIANT_TYPE_NODE_PATH: + return reinterpret_cast(static_cast(VariantInternal::get_node_path)); + case GDEXTENSION_VARIANT_TYPE_RID: + return reinterpret_cast(static_cast(VariantInternal::get_rid)); + case GDEXTENSION_VARIANT_TYPE_OBJECT: + return reinterpret_cast(static_cast(VariantInternal::get_object)); + case GDEXTENSION_VARIANT_TYPE_CALLABLE: + return reinterpret_cast(static_cast(VariantInternal::get_callable)); + case GDEXTENSION_VARIANT_TYPE_SIGNAL: + return reinterpret_cast(static_cast(VariantInternal::get_signal)); + case GDEXTENSION_VARIANT_TYPE_DICTIONARY: + return reinterpret_cast(static_cast(VariantInternal::get_dictionary)); + case GDEXTENSION_VARIANT_TYPE_ARRAY: + return reinterpret_cast(static_cast(VariantInternal::get_array)); + case GDEXTENSION_VARIANT_TYPE_PACKED_BYTE_ARRAY: + return reinterpret_cast(static_cast(VariantInternal::get_byte_array)); + case GDEXTENSION_VARIANT_TYPE_PACKED_INT32_ARRAY: + return reinterpret_cast(static_cast(VariantInternal::get_int32_array)); + case GDEXTENSION_VARIANT_TYPE_PACKED_INT64_ARRAY: + return reinterpret_cast(static_cast(VariantInternal::get_int64_array)); + case GDEXTENSION_VARIANT_TYPE_PACKED_FLOAT32_ARRAY: + return reinterpret_cast(static_cast(VariantInternal::get_float32_array)); + case GDEXTENSION_VARIANT_TYPE_PACKED_FLOAT64_ARRAY: + return reinterpret_cast(static_cast(VariantInternal::get_float64_array)); + case GDEXTENSION_VARIANT_TYPE_PACKED_STRING_ARRAY: + return reinterpret_cast(static_cast(VariantInternal::get_string_array)); + case GDEXTENSION_VARIANT_TYPE_PACKED_VECTOR2_ARRAY: + return reinterpret_cast(static_cast(VariantInternal::get_vector2_array)); + case GDEXTENSION_VARIANT_TYPE_PACKED_VECTOR3_ARRAY: + return reinterpret_cast(static_cast(VariantInternal::get_vector3_array)); + case GDEXTENSION_VARIANT_TYPE_PACKED_COLOR_ARRAY: + return reinterpret_cast(static_cast(VariantInternal::get_color_array)); + case GDEXTENSION_VARIANT_TYPE_PACKED_VECTOR4_ARRAY: + return reinterpret_cast(static_cast(VariantInternal::get_vector4_array)); + case GDEXTENSION_VARIANT_TYPE_NIL: + case GDEXTENSION_VARIANT_TYPE_VARIANT_MAX: + ERR_FAIL_V_MSG(nullptr, "Getting Variant get internal pointer function with invalid type."); + } + ERR_FAIL_V_MSG(nullptr, "Getting Variant get internal pointer function with invalid type."); +} + // ptrcalls static GDExtensionPtrOperatorEvaluator gdextension_variant_get_ptr_operator_evaluator(GDExtensionVariantOperator p_operator, GDExtensionVariantType p_type_a, GDExtensionVariantType p_type_b) { return (GDExtensionPtrOperatorEvaluator)Variant::get_ptr_operator_evaluator(Variant::Operator(p_operator), Variant::Type(p_type_a), Variant::Type(p_type_b)); @@ -1625,6 +1710,7 @@ void gdextension_setup_interface() { REGISTER_INTERFACE_FUNC(variant_can_convert_strict); REGISTER_INTERFACE_FUNC(get_variant_from_type_constructor); REGISTER_INTERFACE_FUNC(get_variant_to_type_constructor); + REGISTER_INTERFACE_FUNC(variant_get_ptr_internal_getter); REGISTER_INTERFACE_FUNC(variant_get_ptr_operator_evaluator); REGISTER_INTERFACE_FUNC(variant_get_ptr_builtin_method); REGISTER_INTERFACE_FUNC(variant_get_ptr_constructor); diff --git a/core/extension/gdextension_interface.h b/core/extension/gdextension_interface.h index 374dbfd07115..b401acef8295 100644 --- a/core/extension/gdextension_interface.h +++ b/core/extension/gdextension_interface.h @@ -198,6 +198,7 @@ typedef struct { typedef void (*GDExtensionVariantFromTypeConstructorFunc)(GDExtensionUninitializedVariantPtr, GDExtensionTypePtr); typedef void (*GDExtensionTypeFromVariantConstructorFunc)(GDExtensionUninitializedTypePtr, GDExtensionVariantPtr); +typedef void *(*GDExtensionVariantGetInternalPtrFunc)(GDExtensionVariantPtr); typedef void (*GDExtensionPtrOperatorEvaluator)(GDExtensionConstTypePtr p_left, GDExtensionConstTypePtr p_right, GDExtensionTypePtr r_result); typedef void (*GDExtensionPtrBuiltInMethod)(GDExtensionTypePtr p_base, const GDExtensionConstTypePtr *p_args, GDExtensionTypePtr r_return, int p_argument_count); typedef void (*GDExtensionPtrConstructor)(GDExtensionUninitializedTypePtr p_base, const GDExtensionConstTypePtr *p_args); @@ -841,7 +842,7 @@ typedef void (*GDExtensionInterfaceMemFree)(void *p_ptr); * * Logs an error to Godot's built-in debugger and to the OS terminal. * - * @param p_description The code trigging the error. + * @param p_description The code triggering the error. * @param p_function The function name where the error occurred. * @param p_file The file where the error occurred. * @param p_line The line where the error occurred. @@ -855,7 +856,7 @@ typedef void (*GDExtensionInterfacePrintError)(const char *p_description, const * * Logs an error with a message to Godot's built-in debugger and to the OS terminal. * - * @param p_description The code trigging the error. + * @param p_description The code triggering the error. * @param p_message The message to show along with the error. * @param p_function The function name where the error occurred. * @param p_file The file where the error occurred. @@ -870,7 +871,7 @@ typedef void (*GDExtensionInterfacePrintErrorWithMessage)(const char *p_descript * * Logs a warning to Godot's built-in debugger and to the OS terminal. * - * @param p_description The code trigging the warning. + * @param p_description The code triggering the warning. * @param p_function The function name where the warning occurred. * @param p_file The file where the warning occurred. * @param p_line The line where the warning occurred. @@ -884,7 +885,7 @@ typedef void (*GDExtensionInterfacePrintWarning)(const char *p_description, cons * * Logs a warning with a message to Godot's built-in debugger and to the OS terminal. * - * @param p_description The code trigging the warning. + * @param p_description The code triggering the warning. * @param p_message The message to show along with the warning. * @param p_function The function name where the warning occurred. * @param p_file The file where the warning occurred. @@ -899,7 +900,7 @@ typedef void (*GDExtensionInterfacePrintWarningWithMessage)(const char *p_descri * * Logs a script error to Godot's built-in debugger and to the OS terminal. * - * @param p_description The code trigging the error. + * @param p_description The code triggering the error. * @param p_function The function name where the error occurred. * @param p_file The file where the error occurred. * @param p_line The line where the error occurred. @@ -913,7 +914,7 @@ typedef void (*GDExtensionInterfacePrintScriptError)(const char *p_description, * * Logs a script error with a message to Godot's built-in debugger and to the OS terminal. * - * @param p_description The code trigging the error. + * @param p_description The code triggering the error. * @param p_message The message to show along with the error. * @param p_function The function name where the error occurred. * @param p_file The file where the error occurred. @@ -1383,6 +1384,23 @@ typedef GDExtensionVariantFromTypeConstructorFunc (*GDExtensionInterfaceGetVaria */ typedef GDExtensionTypeFromVariantConstructorFunc (*GDExtensionInterfaceGetVariantToTypeConstructor)(GDExtensionVariantType p_type); +/** + * @name variant_get_ptr_internal_getter + * @since 4.4 + * + * Provides a function pointer for retrieving a pointer to a variant's internal value. + * Access to a variant's internal value can be used to modify it in-place, or to retrieve its value without the overhead of variant conversion functions. + * It is recommended to cache the getter for all variant types in a function table to avoid retrieval overhead upon use. + * + * @note Each function assumes the variant's type has already been determined and matches the function. + * Invoking the function with a variant of a mismatched type has undefined behavior, and may lead to a segmentation fault. + * + * @param p_type The Variant type. + * + * @return A pointer to a type-specific function that returns a pointer to the internal value of a variant. Check the implementation of this function (gdextension_variant_get_ptr_internal_getter) for pointee type info of each variant type. + */ +typedef GDExtensionVariantGetInternalPtrFunc (*GDExtensionInterfaceGetVariantGetInternalPtrFunc)(GDExtensionVariantType p_type); + /** * @name variant_get_ptr_operator_evaluator * @since 4.1 diff --git a/core/input/input_event.cpp b/core/input/input_event.cpp index 045ac83cd818..bd793ef6b8fc 100644 --- a/core/input/input_event.cpp +++ b/core/input/input_event.cpp @@ -754,6 +754,8 @@ Ref InputEventMouseButton::xformed_by(const Transform2D &p_xform, co mb->set_factor(factor); mb->set_button_index(button_index); + mb->merge_meta_from(this); + return mb; } @@ -974,6 +976,8 @@ Ref InputEventMouseMotion::xformed_by(const Transform2D &p_xform, co mm->set_velocity(p_xform.basis_xform(get_velocity())); mm->set_screen_velocity(get_screen_velocity()); + mm->merge_meta_from(this); + return mm; } @@ -1366,6 +1370,8 @@ Ref InputEventScreenTouch::xformed_by(const Transform2D &p_xform, co st->set_canceled(canceled); st->set_double_tap(double_tap); + st->merge_meta_from(this); + return st; } @@ -1494,6 +1500,8 @@ Ref InputEventScreenDrag::xformed_by(const Transform2D &p_xform, con sd->set_velocity(p_xform.basis_xform(velocity)); sd->set_screen_velocity(get_screen_velocity()); + sd->merge_meta_from(this); + return sd; } @@ -1705,6 +1713,8 @@ Ref InputEventMagnifyGesture::xformed_by(const Transform2D &p_xform, ev->set_position(p_xform.xform(get_position() + p_local_ofs)); ev->set_factor(get_factor()); + ev->merge_meta_from(this); + return ev; } @@ -1745,6 +1755,8 @@ Ref InputEventPanGesture::xformed_by(const Transform2D &p_xform, con ev->set_position(p_xform.xform(get_position() + p_local_ofs)); ev->set_delta(get_delta()); + ev->merge_meta_from(this); + return ev; } diff --git a/core/input/input_map.cpp b/core/input/input_map.cpp index abd2c80ce1ce..2c056c4f08a6 100644 --- a/core/input/input_map.cpp +++ b/core/input/input_map.cpp @@ -519,12 +519,15 @@ const HashMap>> &InputMap::get_builtins() { default_builtin_cache.insert("ui_text_completion_query", inputs); inputs = List>(); - inputs.push_back(InputEventKey::create_reference(Key::ENTER)); - inputs.push_back(InputEventKey::create_reference(Key::KP_ENTER)); + inputs.push_back(InputEventKey::create_reference(KeyModifierMask::SHIFT | Key::TAB)); + inputs.push_back(InputEventKey::create_reference(KeyModifierMask::SHIFT | Key::ENTER)); + inputs.push_back(InputEventKey::create_reference(KeyModifierMask::SHIFT | Key::KP_ENTER)); default_builtin_cache.insert("ui_text_completion_accept", inputs); inputs = List>(); inputs.push_back(InputEventKey::create_reference(Key::TAB)); + inputs.push_back(InputEventKey::create_reference(Key::ENTER)); + inputs.push_back(InputEventKey::create_reference(Key::KP_ENTER)); default_builtin_cache.insert("ui_text_completion_replace", inputs); // Newlines @@ -534,7 +537,6 @@ const HashMap>> &InputMap::get_builtins() { default_builtin_cache.insert("ui_text_newline", inputs); inputs = List>(); - inputs.push_back(InputEventKey::create_reference(Key::ENTER | KeyModifierMask::CMD_OR_CTRL)); inputs.push_back(InputEventKey::create_reference(Key::KP_ENTER | KeyModifierMask::CMD_OR_CTRL)); default_builtin_cache.insert("ui_text_newline_blank", inputs); diff --git a/core/io/dir_access.cpp b/core/io/dir_access.cpp index 14588923cb3c..ca92b3e1181c 100644 --- a/core/io/dir_access.cpp +++ b/core/io/dir_access.cpp @@ -32,8 +32,8 @@ #include "core/config/project_settings.h" #include "core/io/file_access.h" -#include "core/os/memory.h" #include "core/os/os.h" +#include "core/os/time.h" #include "core/templates/local_vector.h" thread_local Error DirAccess::last_dir_open_error = OK; @@ -323,6 +323,80 @@ Ref DirAccess::create(AccessType p_access) { return da; } +Ref DirAccess::create_temp(const String &p_prefix, bool p_keep, Error *r_error) { + const String ERROR_COMMON_PREFIX = "Error while creating temporary directory"; + + if (!p_prefix.is_valid_filename()) { + *r_error = ERR_FILE_BAD_PATH; + ERR_FAIL_V_MSG(Ref(), vformat(R"(%s: "%s" is not a valid prefix.)", ERROR_COMMON_PREFIX, p_prefix)); + } + + Ref dir_access = DirAccess::open(OS::get_singleton()->get_temp_path()); + + uint32_t suffix_i = 0; + String path; + while (true) { + String datetime = Time::get_singleton()->get_datetime_string_from_system().replace("-", "").replace("T", "").replace(":", ""); + datetime += itos(Time::get_singleton()->get_ticks_usec()); + String suffix = datetime + (suffix_i > 0 ? itos(suffix_i) : ""); + path = (p_prefix.is_empty() ? "" : p_prefix + "-") + suffix; + if (!path.is_valid_filename()) { + *r_error = ERR_FILE_BAD_PATH; + return Ref(); + } + if (!DirAccess::exists(path)) { + break; + } + suffix_i += 1; + } + + Error err = dir_access->make_dir(path); + if (err != OK) { + *r_error = err; + ERR_FAIL_V_MSG(Ref(), vformat(R"(%s: "%s" couldn't create directory "%s".)", ERROR_COMMON_PREFIX, path)); + } + err = dir_access->change_dir(path); + if (err != OK) { + *r_error = err; + return Ref(); + } + + dir_access->_is_temp = true; + dir_access->_temp_keep_after_free = p_keep; + dir_access->_temp_path = dir_access->get_current_dir(); + + *r_error = OK; + return dir_access; +} + +Ref DirAccess::_create_temp(const String &p_prefix, bool p_keep) { + return create_temp(p_prefix, p_keep, &last_dir_open_error); +} + +void DirAccess::_delete_temp() { + if (!_is_temp || _temp_keep_after_free) { + return; + } + + if (!DirAccess::exists(_temp_path)) { + return; + } + + Error err; + { + Ref dir_access = DirAccess::open(_temp_path, &err); + if (err != OK) { + return; + } + err = dir_access->erase_contents_recursive(); + if (err != OK) { + return; + } + } + + DirAccess::remove_absolute(_temp_path); +} + Error DirAccess::get_open_error() { return last_dir_open_error; } @@ -555,6 +629,7 @@ bool DirAccess::is_case_sensitive(const String &p_path) const { void DirAccess::_bind_methods() { ClassDB::bind_static_method("DirAccess", D_METHOD("open", "path"), &DirAccess::_open); ClassDB::bind_static_method("DirAccess", D_METHOD("get_open_error"), &DirAccess::get_open_error); + ClassDB::bind_static_method("DirAccess", D_METHOD("create_temp", "prefix", "keep"), &DirAccess::_create_temp, DEFVAL(""), DEFVAL(false)); ClassDB::bind_method(D_METHOD("list_dir_begin"), &DirAccess::list_dir_begin, DEFVAL(false), DEFVAL(false)); ClassDB::bind_method(D_METHOD("get_next"), &DirAccess::_get_next); @@ -588,6 +663,8 @@ void DirAccess::_bind_methods() { ClassDB::bind_method(D_METHOD("read_link", "path"), &DirAccess::read_link); ClassDB::bind_method(D_METHOD("create_link", "source", "target"), &DirAccess::create_link); + ClassDB::bind_method(D_METHOD("is_bundle", "path"), &DirAccess::is_bundle); + ClassDB::bind_method(D_METHOD("set_include_navigational", "enable"), &DirAccess::set_include_navigational); ClassDB::bind_method(D_METHOD("get_include_navigational"), &DirAccess::get_include_navigational); ClassDB::bind_method(D_METHOD("set_include_hidden", "enable"), &DirAccess::set_include_hidden); @@ -598,3 +675,7 @@ void DirAccess::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "include_navigational"), "set_include_navigational", "get_include_navigational"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "include_hidden"), "set_include_hidden", "get_include_hidden"); } + +DirAccess::~DirAccess() { + _delete_temp(); +} diff --git a/core/io/dir_access.h b/core/io/dir_access.h index 2392944f7618..bdeb4324831d 100644 --- a/core/io/dir_access.h +++ b/core/io/dir_access.h @@ -61,6 +61,13 @@ class DirAccess : public RefCounted { bool include_navigational = false; bool include_hidden = false; + bool _is_temp = false; + bool _temp_keep_after_free = false; + String _temp_path; + void _delete_temp(); + + static Ref _create_temp(const String &p_prefix = "", bool p_keep = false); + protected: static void _bind_methods(); @@ -136,6 +143,7 @@ class DirAccess : public RefCounted { } static Ref open(const String &p_path, Error *r_error = nullptr); + static Ref create_temp(const String &p_prefix = "", bool p_keep = false, Error *r_error = nullptr); static int _get_drive_count(); static String get_drive_name(int p_idx); @@ -160,9 +168,11 @@ class DirAccess : public RefCounted { bool get_include_hidden() const; virtual bool is_case_sensitive(const String &p_path) const; + virtual bool is_bundle(const String &p_file) const { return false; } +public: DirAccess() {} - virtual ~DirAccess() {} + virtual ~DirAccess(); }; #endif // DIR_ACCESS_H diff --git a/core/io/file_access.compat.inc b/core/io/file_access.compat.inc index ed16050126e1..97c7849e6773 100644 --- a/core/io/file_access.compat.inc +++ b/core/io/file_access.compat.inc @@ -34,8 +34,79 @@ Ref FileAccess::_open_encrypted_bind_compat_98918(const String &p_pa return open_encrypted(p_path, p_mode_flags, p_key, Vector()); } +void FileAccess::store_8_bind_compat_78289(uint8_t p_dest) { + store_8(p_dest); +} + +void FileAccess::store_16_bind_compat_78289(uint16_t p_dest) { + store_16(p_dest); +} + +void FileAccess::store_32_bind_compat_78289(uint32_t p_dest) { + store_32(p_dest); +} + +void FileAccess::store_64_bind_compat_78289(uint64_t p_dest) { + store_64(p_dest); +} + +void FileAccess::store_buffer_bind_compat_78289(const Vector &p_buffer) { + store_buffer(p_buffer); +} + +void FileAccess::store_var_bind_compat_78289(const Variant &p_var, bool p_full_objects) { + store_var(p_var, p_full_objects); +} + +void FileAccess::store_half_bind_compat_78289(float p_dest) { + store_half(p_dest); +} + +void FileAccess::store_float_bind_compat_78289(float p_dest) { + store_float(p_dest); +} + +void FileAccess::store_double_bind_compat_78289(double p_dest) { + store_double(p_dest); +} + +void FileAccess::store_real_bind_compat_78289(real_t p_real) { + store_real(p_real); +} + +void FileAccess::store_string_bind_compat_78289(const String &p_string) { + store_string(p_string); +} + +void FileAccess::store_line_bind_compat_78289(const String &p_line) { + store_line(p_line); +} + +void FileAccess::store_csv_line_bind_compat_78289(const Vector &p_values, const String &p_delim) { + store_csv_line(p_values, p_delim); +} + +void FileAccess::store_pascal_string_bind_compat_78289(const String &p_string) { + store_pascal_string(p_string); +} + void FileAccess::_bind_compatibility_methods() { ClassDB::bind_compatibility_static_method("FileAccess", D_METHOD("open_encrypted", "path", "mode_flags", "key"), &FileAccess::_open_encrypted_bind_compat_98918); + + ClassDB::bind_compatibility_method(D_METHOD("store_8", "value"), &FileAccess::store_8_bind_compat_78289); + ClassDB::bind_compatibility_method(D_METHOD("store_16", "value"), &FileAccess::store_16_bind_compat_78289); + ClassDB::bind_compatibility_method(D_METHOD("store_32", "value"), &FileAccess::store_32_bind_compat_78289); + ClassDB::bind_compatibility_method(D_METHOD("store_64", "value"), &FileAccess::store_64_bind_compat_78289); + ClassDB::bind_compatibility_method(D_METHOD("store_half", "value"), &FileAccess::store_half_bind_compat_78289); + ClassDB::bind_compatibility_method(D_METHOD("store_float", "value"), &FileAccess::store_float_bind_compat_78289); + ClassDB::bind_compatibility_method(D_METHOD("store_double", "value"), &FileAccess::store_double_bind_compat_78289); + ClassDB::bind_compatibility_method(D_METHOD("store_real", "value"), &FileAccess::store_real_bind_compat_78289); + ClassDB::bind_compatibility_method(D_METHOD("store_buffer", "buffer"), &FileAccess::store_buffer_bind_compat_78289); + ClassDB::bind_compatibility_method(D_METHOD("store_line", "line"), &FileAccess::store_line_bind_compat_78289); + ClassDB::bind_compatibility_method(D_METHOD("store_csv_line", "values", "delim"), &FileAccess::store_csv_line_bind_compat_78289, DEFVAL(",")); + ClassDB::bind_compatibility_method(D_METHOD("store_string", "string"), &FileAccess::store_string_bind_compat_78289); + ClassDB::bind_compatibility_method(D_METHOD("store_var", "value", "full_objects"), &FileAccess::store_var_bind_compat_78289, DEFVAL(false)); + ClassDB::bind_compatibility_method(D_METHOD("store_pascal_string", "string"), &FileAccess::store_pascal_string_bind_compat_78289); } -#endif // DISABLE_DEPRECATED +#endif diff --git a/core/io/file_access.cpp b/core/io/file_access.cpp index ef5ca502d44c..c04ad1cf495f 100644 --- a/core/io/file_access.cpp +++ b/core/io/file_access.cpp @@ -38,6 +38,7 @@ #include "core/io/file_access_pack.h" #include "core/io/marshalls.h" #include "core/os/os.h" +#include "core/os/time.h" FileAccess::CreateFunc FileAccess::create_func[ACCESS_MAX] = {}; @@ -84,6 +85,79 @@ Ref FileAccess::create_for_path(const String &p_path) { return ret; } +Ref FileAccess::create_temp(int p_mode_flags, const String &p_prefix, const String &p_extension, bool p_keep, Error *r_error) { + const String ERROR_COMMON_PREFIX = "Error while creating temporary file"; + + if (!p_prefix.is_valid_filename()) { + *r_error = ERR_FILE_BAD_PATH; + ERR_FAIL_V_MSG(Ref(), vformat(R"(%s: "%s" is not a valid prefix.)", ERROR_COMMON_PREFIX, p_prefix)); + } + + if (!p_extension.is_valid_filename()) { + *r_error = ERR_FILE_BAD_PATH; + ERR_FAIL_V_MSG(Ref(), vformat(R"(%s: "%s" is not a valid extension.)", ERROR_COMMON_PREFIX, p_extension)); + } + + const String TEMP_DIR = OS::get_singleton()->get_temp_path(); + String extension = p_extension.trim_prefix("."); + + uint32_t suffix_i = 0; + String path; + while (true) { + String datetime = Time::get_singleton()->get_datetime_string_from_system().replace("-", "").replace("T", "").replace(":", ""); + datetime += itos(Time::get_singleton()->get_ticks_usec()); + String suffix = datetime + (suffix_i > 0 ? itos(suffix_i) : ""); + path = TEMP_DIR.path_join((p_prefix.is_empty() ? "" : p_prefix + "-") + suffix + (extension.is_empty() ? "" : "." + extension)); + if (!DirAccess::exists(path)) { + break; + } + suffix_i += 1; + } + + Error err; + { + // Create file first with WRITE mode. + // Otherwise, it would fail to open with a READ mode. + Ref ret = FileAccess::open(path, FileAccess::ModeFlags::WRITE, &err); + if (err != OK) { + *r_error = err; + ERR_FAIL_V_MSG(Ref(), vformat(R"(%s: could not create "%s".)", ERROR_COMMON_PREFIX, path)); + } + ret->flush(); + } + + // Open then the temp file with the correct mode flag. + Ref ret = FileAccess::open(path, p_mode_flags, &err); + if (err != OK) { + *r_error = err; + ERR_FAIL_V_MSG(Ref(), vformat(R"(%s: could not open "%s".)", ERROR_COMMON_PREFIX, path)); + } + if (ret.is_valid()) { + ret->_is_temp_file = true; + ret->_temp_keep_after_use = p_keep; + ret->_temp_path = ret->get_path_absolute(); + } + + *r_error = OK; + return ret; +} + +Ref FileAccess::_create_temp(int p_mode_flags, const String &p_prefix, const String &p_extension, bool p_keep) { + return create_temp(p_mode_flags, p_prefix, p_extension, p_keep, &last_file_open_error); +} + +void FileAccess::_delete_temp() { + if (!_is_temp_file || _temp_keep_after_use) { + return; + } + + if (!FileAccess::exists(_temp_path)) { + return; + } + + DirAccess::remove_absolute(_temp_path); +} + Error FileAccess::reopen(const String &p_path, int p_mode_flags) { return open_internal(p_path, p_mode_flags); } @@ -268,6 +342,10 @@ uint64_t FileAccess::get_64() const { return data; } +float FileAccess::get_half() const { + return Math::half_to_float(get_16()); +} + float FileAccess::get_float() const { MarshallFloat m; m.i = get_32(); @@ -487,56 +565,60 @@ String FileAccess::get_as_utf8_string(bool p_skip_cr) const { w[len] = 0; String s; - s.parse_utf8((const char *)w, -1, p_skip_cr); + s.parse_utf8((const char *)w, len, p_skip_cr); return s; } -void FileAccess::store_8(uint8_t p_dest) { - store_buffer(&p_dest, sizeof(uint8_t)); +bool FileAccess::store_8(uint8_t p_dest) { + return store_buffer(&p_dest, sizeof(uint8_t)); } -void FileAccess::store_16(uint16_t p_dest) { +bool FileAccess::store_16(uint16_t p_dest) { if (big_endian) { p_dest = BSWAP16(p_dest); } - store_buffer(reinterpret_cast(&p_dest), sizeof(uint16_t)); + return store_buffer(reinterpret_cast(&p_dest), sizeof(uint16_t)); } -void FileAccess::store_32(uint32_t p_dest) { +bool FileAccess::store_32(uint32_t p_dest) { if (big_endian) { p_dest = BSWAP32(p_dest); } - store_buffer(reinterpret_cast(&p_dest), sizeof(uint32_t)); + return store_buffer(reinterpret_cast(&p_dest), sizeof(uint32_t)); } -void FileAccess::store_64(uint64_t p_dest) { +bool FileAccess::store_64(uint64_t p_dest) { if (big_endian) { p_dest = BSWAP64(p_dest); } - store_buffer(reinterpret_cast(&p_dest), sizeof(uint64_t)); + return store_buffer(reinterpret_cast(&p_dest), sizeof(uint64_t)); } -void FileAccess::store_real(real_t p_real) { +bool FileAccess::store_real(real_t p_real) { if constexpr (sizeof(real_t) == 4) { - store_float(p_real); + return store_float(p_real); } else { - store_double(p_real); + return store_double(p_real); } } -void FileAccess::store_float(float p_dest) { +bool FileAccess::store_half(float p_dest) { + return store_16(Math::make_half_float(p_dest)); +} + +bool FileAccess::store_float(float p_dest) { MarshallFloat m; m.f = p_dest; - store_32(m.i); + return store_32(m.i); } -void FileAccess::store_double(double p_dest) { +bool FileAccess::store_double(double p_dest) { MarshallDouble m; m.d = p_dest; - store_64(m.l); + return store_64(m.l); } uint64_t FileAccess::get_modified_time(const String &p_file) { @@ -620,19 +702,18 @@ Error FileAccess::set_read_only_attribute(const String &p_file, bool p_ro) { return err; } -void FileAccess::store_string(const String &p_string) { +bool FileAccess::store_string(const String &p_string) { if (p_string.length() == 0) { - return; + return true; } CharString cs = p_string.utf8(); - store_buffer((uint8_t *)&cs[0], cs.length()); + return store_buffer((uint8_t *)&cs[0], cs.length()); } -void FileAccess::store_pascal_string(const String &p_string) { +bool FileAccess::store_pascal_string(const String &p_string) { CharString cs = p_string.utf8(); - store_32(cs.length()); - store_buffer((uint8_t *)&cs[0], cs.length()); + return store_32(cs.length()) && store_buffer((uint8_t *)&cs[0], cs.length()); } String FileAccess::get_pascal_string() { @@ -643,24 +724,23 @@ String FileAccess::get_pascal_string() { cs[sl] = 0; String ret; - ret.parse_utf8(cs.ptr()); + ret.parse_utf8(cs.ptr(), sl); return ret; } -void FileAccess::store_line(const String &p_line) { - store_string(p_line); - store_8('\n'); +bool FileAccess::store_line(const String &p_line) { + return store_string(p_line) && store_8('\n'); } -void FileAccess::store_csv_line(const Vector &p_values, const String &p_delim) { - ERR_FAIL_COND(p_delim.length() != 1); +bool FileAccess::store_csv_line(const Vector &p_values, const String &p_delim) { + ERR_FAIL_COND_V(p_delim.length() != 1, false); String line = ""; int size = p_values.size(); for (int i = 0; i < size; ++i) { String value = p_values[i]; - if (value.contains("\"") || value.contains(p_delim) || value.contains("\n")) { + if (value.contains_char('"') || value.contains(p_delim) || value.contains_char('\n')) { value = "\"" + value.replace("\"", "\"\"") + "\""; } if (i < size - 1) { @@ -670,30 +750,43 @@ void FileAccess::store_csv_line(const Vector &p_values, const String &p_ line += value; } - store_line(line); + return store_line(line); } -void FileAccess::store_buffer(const Vector &p_buffer) { +bool FileAccess::store_buffer(const Vector &p_buffer) { uint64_t len = p_buffer.size(); + if (len == 0) { + return true; + } + const uint8_t *r = p_buffer.ptr(); - store_buffer(r, len); + return store_buffer(r, len); +} + +bool FileAccess::store_buffer(const uint8_t *p_src, uint64_t p_length) { + ERR_FAIL_COND_V(!p_src && p_length > 0, false); + for (uint64_t i = 0; i < p_length; i++) { + if (unlikely(!store_8(p_src[i]))) { + return false; + } + } + return true; } -void FileAccess::store_var(const Variant &p_var, bool p_full_objects) { +bool FileAccess::store_var(const Variant &p_var, bool p_full_objects) { int len; Error err = encode_variant(p_var, nullptr, len, p_full_objects); - ERR_FAIL_COND_MSG(err != OK, "Error when trying to encode Variant."); + ERR_FAIL_COND_V_MSG(err != OK, false, "Error when trying to encode Variant."); Vector buff; buff.resize(len); uint8_t *w = buff.ptrw(); err = encode_variant(p_var, &w[0], len, p_full_objects); - ERR_FAIL_COND_MSG(err != OK, "Error when trying to encode Variant."); + ERR_FAIL_COND_V_MSG(err != OK, false, "Error when trying to encode Variant."); - store_32(len); - store_buffer(buff); + return store_32(len) && store_buffer(buff); } Vector FileAccess::get_file_as_bytes(const String &p_path, Error *r_error) { @@ -815,6 +908,7 @@ void FileAccess::_bind_methods() { ClassDB::bind_static_method("FileAccess", D_METHOD("open_encrypted_with_pass", "path", "mode_flags", "pass"), &FileAccess::open_encrypted_pass); ClassDB::bind_static_method("FileAccess", D_METHOD("open_compressed", "path", "mode_flags", "compression_mode"), &FileAccess::open_compressed, DEFVAL(0)); ClassDB::bind_static_method("FileAccess", D_METHOD("get_open_error"), &FileAccess::get_open_error); + ClassDB::bind_static_method("FileAccess", D_METHOD("create_temp", "mode_flags", "prefix", "extension", "keep"), &FileAccess::_create_temp, DEFVAL(""), DEFVAL(""), DEFVAL(false)); ClassDB::bind_static_method("FileAccess", D_METHOD("get_file_as_bytes", "path"), &FileAccess::_get_file_as_bytes); ClassDB::bind_static_method("FileAccess", D_METHOD("get_file_as_string", "path"), &FileAccess::_get_file_as_string); @@ -833,6 +927,7 @@ void FileAccess::_bind_methods() { ClassDB::bind_method(D_METHOD("get_16"), &FileAccess::get_16); ClassDB::bind_method(D_METHOD("get_32"), &FileAccess::get_32); ClassDB::bind_method(D_METHOD("get_64"), &FileAccess::get_64); + ClassDB::bind_method(D_METHOD("get_half"), &FileAccess::get_half); ClassDB::bind_method(D_METHOD("get_float"), &FileAccess::get_float); ClassDB::bind_method(D_METHOD("get_double"), &FileAccess::get_double); ClassDB::bind_method(D_METHOD("get_real"), &FileAccess::get_real); @@ -851,10 +946,11 @@ void FileAccess::_bind_methods() { ClassDB::bind_method(D_METHOD("store_16", "value"), &FileAccess::store_16); ClassDB::bind_method(D_METHOD("store_32", "value"), &FileAccess::store_32); ClassDB::bind_method(D_METHOD("store_64", "value"), &FileAccess::store_64); + ClassDB::bind_method(D_METHOD("store_half", "value"), &FileAccess::store_half); ClassDB::bind_method(D_METHOD("store_float", "value"), &FileAccess::store_float); ClassDB::bind_method(D_METHOD("store_double", "value"), &FileAccess::store_double); ClassDB::bind_method(D_METHOD("store_real", "value"), &FileAccess::store_real); - ClassDB::bind_method(D_METHOD("store_buffer", "buffer"), (void(FileAccess::*)(const Vector &)) & FileAccess::store_buffer); + ClassDB::bind_method(D_METHOD("store_buffer", "buffer"), (bool(FileAccess::*)(const Vector &)) & FileAccess::store_buffer); ClassDB::bind_method(D_METHOD("store_line", "line"), &FileAccess::store_line); ClassDB::bind_method(D_METHOD("store_csv_line", "values", "delim"), &FileAccess::store_csv_line, DEFVAL(",")); ClassDB::bind_method(D_METHOD("store_string", "string"), &FileAccess::store_string); @@ -902,3 +998,7 @@ void FileAccess::_bind_methods() { BIND_BITFIELD_FLAG(UNIX_SET_GROUP_ID); BIND_BITFIELD_FLAG(UNIX_RESTRICTED_DELETE); } + +FileAccess::~FileAccess() { + _delete_temp(); +} diff --git a/core/io/file_access.h b/core/io/file_access.h index 88c8110a513c..da3cf0e28a80 100644 --- a/core/io/file_access.h +++ b/core/io/file_access.h @@ -112,6 +112,21 @@ class FileAccess : public RefCounted { #ifndef DISABLE_DEPRECATED static Ref _open_encrypted_bind_compat_98918(const String &p_path, ModeFlags p_mode_flags, const Vector &p_key); + void store_8_bind_compat_78289(uint8_t p_dest); + void store_16_bind_compat_78289(uint16_t p_dest); + void store_32_bind_compat_78289(uint32_t p_dest); + void store_64_bind_compat_78289(uint64_t p_dest); + void store_buffer_bind_compat_78289(const Vector &p_buffer); + void store_var_bind_compat_78289(const Variant &p_var, bool p_full_objects = false); + void store_half_bind_compat_78289(float p_dest); + void store_float_bind_compat_78289(float p_dest); + void store_double_bind_compat_78289(double p_dest); + void store_real_bind_compat_78289(real_t p_real); + void store_string_bind_compat_78289(const String &p_string); + void store_line_bind_compat_78289(const String &p_line); + void store_csv_line_bind_compat_78289(const Vector &p_values, const String &p_delim = ","); + void store_pascal_string_bind_compat_78289(const String &p_string); + static void _bind_compatibility_methods(); #endif @@ -128,6 +143,13 @@ class FileAccess : public RefCounted { static Ref _open(const String &p_path, ModeFlags p_mode_flags); + bool _is_temp_file = false; + bool _temp_keep_after_use = false; + String _temp_path; + void _delete_temp(); + + static Ref _create_temp(int p_mode_flags, const String &p_prefix = "", const String &p_extension = "", bool p_keep = false); + public: static void set_file_close_fail_notify_callback(FileCloseFailNotify p_cbk) { close_fail_notify = p_cbk; } @@ -148,6 +170,7 @@ class FileAccess : public RefCounted { virtual uint32_t get_32() const; ///< get 32 bits uint virtual uint64_t get_64() const; ///< get 64 bits uint + virtual float get_half() const; virtual float get_float() const; virtual double get_double() const; virtual real_t get_real() const; @@ -163,6 +186,7 @@ class FileAccess : public RefCounted { virtual String get_as_utf8_string(bool p_skip_cr = false) const; /** + * Use this for files WRITTEN in _big_ endian machines (ie, amiga/mac) * It's not about the current CPU type but file formats. * This flag gets reset to `false` (little endian) on each open. @@ -174,26 +198,27 @@ class FileAccess : public RefCounted { virtual Error resize(int64_t p_length) = 0; virtual void flush() = 0; - virtual void store_8(uint8_t p_dest); ///< store a byte - virtual void store_16(uint16_t p_dest); ///< store 16 bits uint - virtual void store_32(uint32_t p_dest); ///< store 32 bits uint - virtual void store_64(uint64_t p_dest); ///< store 64 bits uint + virtual bool store_8(uint8_t p_dest); ///< store a byte + virtual bool store_16(uint16_t p_dest); ///< store 16 bits uint + virtual bool store_32(uint32_t p_dest); ///< store 32 bits uint + virtual bool store_64(uint64_t p_dest); ///< store 64 bits uint - virtual void store_float(float p_dest); - virtual void store_double(double p_dest); - virtual void store_real(real_t p_real); + virtual bool store_half(float p_dest); + virtual bool store_float(float p_dest); + virtual bool store_double(double p_dest); + virtual bool store_real(real_t p_real); - virtual void store_string(const String &p_string); - virtual void store_line(const String &p_line); - virtual void store_csv_line(const Vector &p_values, const String &p_delim = ","); + virtual bool store_string(const String &p_string); + virtual bool store_line(const String &p_line); + virtual bool store_csv_line(const Vector &p_values, const String &p_delim = ","); - virtual void store_pascal_string(const String &p_string); + virtual bool store_pascal_string(const String &p_string); virtual String get_pascal_string(); - virtual void store_buffer(const uint8_t *p_src, uint64_t p_length) = 0; ///< store an array of bytes, needs to be overwritten by children. - void store_buffer(const Vector &p_buffer); + virtual bool store_buffer(const uint8_t *p_src, uint64_t p_length) = 0; ///< store an array of bytes, needs to be overwritten by children. + bool store_buffer(const Vector &p_buffer); - void store_var(const Variant &p_var, bool p_full_objects = false); + bool store_var(const Variant &p_var, bool p_full_objects = false); virtual void close() = 0; @@ -204,6 +229,7 @@ class FileAccess : public RefCounted { static Ref create(AccessType p_access); /// Create a file access (for the current platform) this is the only portable way of accessing files. static Ref create_for_path(const String &p_path); static Ref open(const String &p_path, int p_mode_flags, Error *r_error = nullptr); /// Create a file access (for the current platform) this is the only portable way of accessing files. + static Ref create_temp(int p_mode_flags, const String &p_prefix = "", const String &p_extension = "", bool p_keep = false, Error *r_error = nullptr); static Ref open_encrypted(const String &p_path, ModeFlags p_mode_flags, const Vector &p_key, const Vector &p_iv = Vector()); static Ref open_encrypted_pass(const String &p_path, ModeFlags p_mode_flags, const String &p_pass); @@ -239,8 +265,9 @@ class FileAccess : public RefCounted { create_func[p_access] = _create_builtin; } +public: FileAccess() {} - virtual ~FileAccess() {} + virtual ~FileAccess(); }; VARIANT_ENUM_CAST(FileAccess::CompressionMode); diff --git a/core/io/file_access_compressed.cpp b/core/io/file_access_compressed.cpp index f7f2852e0aaa..53ef93d09b9e 100644 --- a/core/io/file_access_compressed.cpp +++ b/core/io/file_access_compressed.cpp @@ -40,18 +40,6 @@ void FileAccessCompressed::configure(const String &p_magic, Compression::Mode p_ block_size = p_block_size; } -#define WRITE_FIT(m_bytes) \ - { \ - if (write_pos + (m_bytes) > write_max) { \ - write_max = write_pos + (m_bytes); \ - } \ - if (write_max > write_buffer_size) { \ - write_buffer_size = next_power_of_2(write_max); \ - buffer.resize(write_buffer_size); \ - write_ptr = buffer.ptrw(); \ - } \ - } - Error FileAccessCompressed::open_after_magic(Ref p_base) { f = p_base; cmode = (Compression::Mode)f->get_32(); @@ -309,13 +297,23 @@ void FileAccessCompressed::flush() { // compressed files keep data in memory till close() } -void FileAccessCompressed::store_buffer(const uint8_t *p_src, uint64_t p_length) { - ERR_FAIL_COND_MSG(f.is_null(), "File must be opened before use."); - ERR_FAIL_COND_MSG(!writing, "File has not been opened in write mode."); +bool FileAccessCompressed::store_buffer(const uint8_t *p_src, uint64_t p_length) { + ERR_FAIL_COND_V_MSG(f.is_null(), false, "File must be opened before use."); + ERR_FAIL_COND_V_MSG(!writing, false, "File has not been opened in write mode."); + + if (write_pos + (p_length) > write_max) { + write_max = write_pos + (p_length); + } + if (write_max > write_buffer_size) { + write_buffer_size = next_power_of_2(write_max); + ERR_FAIL_COND_V(buffer.resize(write_buffer_size) != OK, false); + write_ptr = buffer.ptrw(); + } - WRITE_FIT(p_length); memcpy(write_ptr + write_pos, p_src, p_length); + write_pos += p_length; + return true; } bool FileAccessCompressed::file_exists(const String &p_name) { diff --git a/core/io/file_access_compressed.h b/core/io/file_access_compressed.h index ea9837dd0394..607a45fc0a06 100644 --- a/core/io/file_access_compressed.h +++ b/core/io/file_access_compressed.h @@ -89,7 +89,7 @@ class FileAccessCompressed : public FileAccess { virtual Error resize(int64_t p_length) override { return ERR_UNAVAILABLE; } virtual void flush() override; - virtual void store_buffer(const uint8_t *p_src, uint64_t p_length) override; + virtual bool store_buffer(const uint8_t *p_src, uint64_t p_length) override; virtual bool file_exists(const String &p_name) override; ///< return true if a file exists diff --git a/core/io/file_access_encrypted.cpp b/core/io/file_access_encrypted.cpp index ba26f2e07bc6..c899c860c6d6 100644 --- a/core/io/file_access_encrypted.cpp +++ b/core/io/file_access_encrypted.cpp @@ -228,16 +228,17 @@ Error FileAccessEncrypted::get_error() const { return eofed ? ERR_FILE_EOF : OK; } -void FileAccessEncrypted::store_buffer(const uint8_t *p_src, uint64_t p_length) { - ERR_FAIL_COND_MSG(!writing, "File has not been opened in write mode."); - ERR_FAIL_COND(!p_src && p_length > 0); +bool FileAccessEncrypted::store_buffer(const uint8_t *p_src, uint64_t p_length) { + ERR_FAIL_COND_V_MSG(!writing, false, "File has not been opened in write mode."); + ERR_FAIL_COND_V(!p_src && p_length > 0, false); if (pos + p_length >= get_length()) { - data.resize(pos + p_length); + ERR_FAIL_COND_V(data.resize(pos + p_length) != OK, false); } memcpy(data.ptrw() + pos, p_src, p_length); pos += p_length; + return true; } void FileAccessEncrypted::flush() { diff --git a/core/io/file_access_encrypted.h b/core/io/file_access_encrypted.h index 63a8cab145b1..a373fc0cb5d9 100644 --- a/core/io/file_access_encrypted.h +++ b/core/io/file_access_encrypted.h @@ -82,7 +82,7 @@ class FileAccessEncrypted : public FileAccess { virtual Error resize(int64_t p_length) override { return ERR_UNAVAILABLE; } virtual void flush() override; - virtual void store_buffer(const uint8_t *p_src, uint64_t p_length) override; ///< store an array of bytes + virtual bool store_buffer(const uint8_t *p_src, uint64_t p_length) override; ///< store an array of bytes virtual bool file_exists(const String &p_name) override; ///< return true if a file exists diff --git a/core/io/file_access_memory.cpp b/core/io/file_access_memory.cpp index 8d7401163272..b5ab18407b3e 100644 --- a/core/io/file_access_memory.cpp +++ b/core/io/file_access_memory.cpp @@ -147,16 +147,16 @@ void FileAccessMemory::flush() { ERR_FAIL_NULL(data); } -void FileAccessMemory::store_buffer(const uint8_t *p_src, uint64_t p_length) { - ERR_FAIL_COND(!p_src && p_length > 0); +bool FileAccessMemory::store_buffer(const uint8_t *p_src, uint64_t p_length) { + ERR_FAIL_COND_V(!p_src && p_length > 0, false); uint64_t left = length - pos; uint64_t write = MIN(p_length, left); - if (write < p_length) { - WARN_PRINT("Writing less data than requested"); - } - memcpy(&data[pos], p_src, write); pos += write; + + ERR_FAIL_COND_V_MSG(write < p_length, false, "Writing less data than requested."); + + return true; } diff --git a/core/io/file_access_memory.h b/core/io/file_access_memory.h index 39e1528d9782..6845cf7130d0 100644 --- a/core/io/file_access_memory.h +++ b/core/io/file_access_memory.h @@ -61,7 +61,7 @@ class FileAccessMemory : public FileAccess { virtual Error resize(int64_t p_length) override { return ERR_UNAVAILABLE; } virtual void flush() override; - virtual void store_buffer(const uint8_t *p_src, uint64_t p_length) override; ///< store an array of bytes + virtual bool store_buffer(const uint8_t *p_src, uint64_t p_length) override; ///< store an array of bytes virtual bool file_exists(const String &p_name) override; ///< return true if a file exists diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp index 8b6b445cea7f..5ccd8a8fb758 100644 --- a/core/io/file_access_pack.cpp +++ b/core/io/file_access_pack.cpp @@ -71,7 +71,7 @@ void PackedData::add_path(const String &p_pkg_path, const String &p_path, uint64 // Search for directory. PackedDir *cd = root; - if (simplified_path.contains("/")) { // In a subdirectory. + if (simplified_path.contains_char('/')) { // In a subdirectory. Vector ds = simplified_path.get_base_dir().split("/"); for (int j = 0; j < ds.size(); j++) { @@ -104,7 +104,7 @@ void PackedData::remove_path(const String &p_path) { // Search for directory. PackedDir *cd = root; - if (simplified_path.contains("/")) { // In a subdirectory. + if (simplified_path.contains_char('/')) { // In a subdirectory. Vector ds = simplified_path.get_base_dir().split("/"); for (int j = 0; j < ds.size(); j++) { @@ -309,7 +309,7 @@ bool PackedSourcePCK::try_open_pack(const String &p_path, bool p_replace_files, cs[sl] = 0; String path; - path.parse_utf8(cs.ptr()); + path.parse_utf8(cs.ptr(), sl); uint64_t ofs = f->get_64(); uint64_t size = f->get_64(); @@ -417,8 +417,8 @@ void FileAccessPack::flush() { ERR_FAIL(); } -void FileAccessPack::store_buffer(const uint8_t *p_src, uint64_t p_length) { - ERR_FAIL(); +bool FileAccessPack::store_buffer(const uint8_t *p_src, uint64_t p_length) { + ERR_FAIL_V(false); } bool FileAccessPack::file_exists(const String &p_name) { diff --git a/core/io/file_access_pack.h b/core/io/file_access_pack.h index b957a43de275..701197116496 100644 --- a/core/io/file_access_pack.h +++ b/core/io/file_access_pack.h @@ -184,7 +184,7 @@ class FileAccessPack : public FileAccess { virtual Error resize(int64_t p_length) override { return ERR_UNAVAILABLE; } virtual void flush() override; - virtual void store_buffer(const uint8_t *p_src, uint64_t p_length) override; + virtual bool store_buffer(const uint8_t *p_src, uint64_t p_length) override; virtual bool file_exists(const String &p_name) override; diff --git a/core/io/file_access_zip.cpp b/core/io/file_access_zip.cpp index 41907d1a3fc8..047b27cf8239 100644 --- a/core/io/file_access_zip.cpp +++ b/core/io/file_access_zip.cpp @@ -322,8 +322,8 @@ void FileAccessZip::flush() { ERR_FAIL(); } -void FileAccessZip::store_buffer(const uint8_t *p_src, uint64_t p_length) { - ERR_FAIL(); +bool FileAccessZip::store_buffer(const uint8_t *p_src, uint64_t p_length) { + ERR_FAIL_V(false); } bool FileAccessZip::file_exists(const String &p_name) { diff --git a/core/io/file_access_zip.h b/core/io/file_access_zip.h index 1e11e050dfb9..57f1d203588a 100644 --- a/core/io/file_access_zip.h +++ b/core/io/file_access_zip.h @@ -101,7 +101,7 @@ class FileAccessZip : public FileAccess { virtual Error resize(int64_t p_length) override { return ERR_UNAVAILABLE; } virtual void flush() override; - virtual void store_buffer(const uint8_t *p_src, uint64_t p_length) override; + virtual bool store_buffer(const uint8_t *p_src, uint64_t p_length) override; virtual bool file_exists(const String &p_name) override; ///< return true if a file exists diff --git a/core/io/http_client_tcp.cpp b/core/io/http_client_tcp.cpp index 1382aecb38d6..3147b59c6017 100644 --- a/core/io/http_client_tcp.cpp +++ b/core/io/http_client_tcp.cpp @@ -484,7 +484,7 @@ Error HTTPClientTCP::poll() { // End of response, parse. response_str.push_back(0); String response; - response.parse_utf8((const char *)response_str.ptr()); + response.parse_utf8((const char *)response_str.ptr(), response_str.size()); Vector responses = response.split("\n"); body_size = -1; chunked = false; diff --git a/core/io/image.cpp b/core/io/image.cpp index 128bbf3e6f08..f466848a5261 100644 --- a/core/io/image.cpp +++ b/core/io/image.cpp @@ -2788,8 +2788,7 @@ Error Image::compress_from_channels(CompressMode p_mode, UsedChannels p_channels } break; case COMPRESS_S3TC: { - // BC3 is unsupported currently. - if ((p_channels == USED_CHANNELS_R || p_channels == USED_CHANNELS_RGB || p_channels == USED_CHANNELS_L) && _image_compress_bc_rd_func) { + if (_image_compress_bc_rd_func) { Error result = _image_compress_bc_rd_func(this, p_channels); // If the image was compressed successfully, we return here. If not, we fall back to the default compression scheme. diff --git a/core/io/ip_address.cpp b/core/io/ip_address.cpp index a93876a2b510..9342792493f3 100644 --- a/core/io/ip_address.cpp +++ b/core/io/ip_address.cpp @@ -202,7 +202,7 @@ IPAddress::IPAddress(const String &p_string) { // Wildcard (not a valid IP) wildcard = true; - } else if (p_string.contains(":")) { + } else if (p_string.contains_char(':')) { // IPv6 _parse_ipv6(p_string); valid = true; diff --git a/core/io/json.h b/core/io/json.h index 67b5e09afa0e..3443b5ca28b3 100644 --- a/core/io/json.h +++ b/core/io/json.h @@ -105,6 +105,10 @@ class ResourceFormatLoaderJSON : public ResourceFormatLoader { virtual void get_recognized_extensions(List *p_extensions) const override; virtual bool handles_type(const String &p_type) const override; virtual String get_resource_type(const String &p_path) const override; + + // Treat JSON as a text file, do not generate a `*.json.uid` file. + virtual ResourceUID::ID get_resource_uid(const String &p_path) const override { return ResourceUID::INVALID_ID; } + virtual bool has_custom_uid_support() const override { return true; } }; class ResourceFormatSaverJSON : public ResourceFormatSaver { diff --git a/core/io/marshalls.h b/core/io/marshalls.h index 6f015ac386e3..82c760c28d22 100644 --- a/core/io/marshalls.h +++ b/core/io/marshalls.h @@ -84,6 +84,12 @@ static inline unsigned int encode_uint32(uint32_t p_uint, uint8_t *p_arr) { return sizeof(uint32_t); } +static inline unsigned int encode_half(float p_float, uint8_t *p_arr) { + encode_uint16(Math::make_half_float(p_float), p_arr); + + return sizeof(uint16_t); +} + static inline unsigned int encode_float(float p_float, uint8_t *p_arr) { MarshallFloat mf; mf.f = p_float; @@ -172,6 +178,10 @@ static inline uint32_t decode_uint32(const uint8_t *p_arr) { return u; } +static inline float decode_half(const uint8_t *p_arr) { + return Math::half_to_float(decode_uint16(p_arr)); +} + static inline float decode_float(const uint8_t *p_arr) { MarshallFloat mf; mf.i = decode_uint32(p_arr); diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index ed11f96d0340..542b63355011 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -165,7 +165,7 @@ StringName ResourceLoaderBinary::_get_string() { } f->get_buffer((uint8_t *)&str_buf[0], len); String s; - s.parse_utf8(&str_buf[0]); + s.parse_utf8(&str_buf[0], len); return s; } @@ -921,7 +921,7 @@ static String get_ustring(Ref f) { str_buf.resize(len); f->get_buffer((uint8_t *)&str_buf[0], len); String s; - s.parse_utf8(&str_buf[0]); + s.parse_utf8(&str_buf[0], len); return s; } @@ -935,7 +935,7 @@ String ResourceLoaderBinary::get_unicode_string() { } f->get_buffer((uint8_t *)&str_buf[0], len); String s; - s.parse_utf8(&str_buf[0]); + s.parse_utf8(&str_buf[0], len); return s; } diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index 1615f145db24..ffab8f1f4ff0 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -885,7 +885,7 @@ bool ResourceLoader::_ensure_load_progress() { // Some servers may need a new engine iteration to allow the load to progress. // Since the only known one is the rendering server (in single thread mode), let's keep it simple and just sync it. // This may be refactored in the future to support other servers and have less coupling. - if (OS::get_singleton()->get_render_thread_mode() == OS::RENDER_SEPARATE_THREAD) { + if (OS::get_singleton()->is_separate_thread_rendering_enabled()) { return false; // Not needed. } RenderingServer::get_singleton()->sync(); diff --git a/core/io/resource_uid.cpp b/core/io/resource_uid.cpp index 946bc524e516..2c221b367608 100644 --- a/core/io/resource_uid.cpp +++ b/core/io/resource_uid.cpp @@ -145,7 +145,12 @@ String ResourceUID::uid_to_path(const String &p_uid) { } String ResourceUID::path_to_uid(const String &p_path) { - return singleton->id_to_text(ResourceLoader::get_resource_uid(p_path)); + const ID id = ResourceLoader::get_resource_uid(p_path); + if (id == INVALID_ID) { + return p_path; + } else { + return singleton->id_to_text(id); + } } String ResourceUID::ensure_path(const String &p_uid_or_path) { diff --git a/core/io/stream_peer.cpp b/core/io/stream_peer.cpp index 3f1c468fb31d..045904fb5d55 100644 --- a/core/io/stream_peer.cpp +++ b/core/io/stream_peer.cpp @@ -178,6 +178,18 @@ void StreamPeer::put_64(int64_t p_val) { put_data(buf, 8); } +void StreamPeer::put_half(float p_val) { + uint8_t buf[2]; + + encode_half(p_val, buf); + uint16_t *p16 = (uint16_t *)buf; + if (big_endian) { + *p16 = BSWAP16(*p16); + } + + put_data(buf, 2); +} + void StreamPeer::put_float(float p_val) { uint8_t buf[4]; @@ -294,6 +306,18 @@ int64_t StreamPeer::get_64() { return r; } +float StreamPeer::get_half() { + uint8_t buf[2]; + get_data(buf, 2); + + uint16_t *p16 = (uint16_t *)buf; + if (big_endian) { + *p16 = BSWAP16(*p16); + } + + return decode_half(buf); +} + float StreamPeer::get_float() { uint8_t buf[4]; get_data(buf, 4); @@ -385,6 +409,7 @@ void StreamPeer::_bind_methods() { ClassDB::bind_method(D_METHOD("put_u32", "value"), &StreamPeer::put_u32); ClassDB::bind_method(D_METHOD("put_64", "value"), &StreamPeer::put_64); ClassDB::bind_method(D_METHOD("put_u64", "value"), &StreamPeer::put_u64); + ClassDB::bind_method(D_METHOD("put_half", "value"), &StreamPeer::put_half); ClassDB::bind_method(D_METHOD("put_float", "value"), &StreamPeer::put_float); ClassDB::bind_method(D_METHOD("put_double", "value"), &StreamPeer::put_double); ClassDB::bind_method(D_METHOD("put_string", "value"), &StreamPeer::put_string); @@ -399,6 +424,7 @@ void StreamPeer::_bind_methods() { ClassDB::bind_method(D_METHOD("get_u32"), &StreamPeer::get_u32); ClassDB::bind_method(D_METHOD("get_64"), &StreamPeer::get_64); ClassDB::bind_method(D_METHOD("get_u64"), &StreamPeer::get_u64); + ClassDB::bind_method(D_METHOD("get_half"), &StreamPeer::get_half); ClassDB::bind_method(D_METHOD("get_float"), &StreamPeer::get_float); ClassDB::bind_method(D_METHOD("get_double"), &StreamPeer::get_double); ClassDB::bind_method(D_METHOD("get_string", "bytes"), &StreamPeer::get_string, DEFVAL(-1)); diff --git a/core/io/stream_peer.h b/core/io/stream_peer.h index 29cdb8261516..44bbfbf1d524 100644 --- a/core/io/stream_peer.h +++ b/core/io/stream_peer.h @@ -73,6 +73,7 @@ class StreamPeer : public RefCounted { void put_u32(uint32_t p_val); void put_64(int64_t p_val); void put_u64(uint64_t p_val); + void put_half(float p_val); void put_float(float p_val); void put_double(double p_val); void put_string(const String &p_string); @@ -87,6 +88,7 @@ class StreamPeer : public RefCounted { int32_t get_32(); uint64_t get_u64(); int64_t get_64(); + float get_half(); float get_float(); double get_double(); String get_string(int p_bytes = -1); diff --git a/core/io/translation_loader_po.h b/core/io/translation_loader_po.h index a695826e5995..1f9782c4253c 100644 --- a/core/io/translation_loader_po.h +++ b/core/io/translation_loader_po.h @@ -43,6 +43,10 @@ class TranslationLoaderPO : public ResourceFormatLoader { virtual bool handles_type(const String &p_type) const override; virtual String get_resource_type(const String &p_path) const override; + // Treat translations as text/binary files, do not generate a `*.{po,mo}.uid` file. + virtual ResourceUID::ID get_resource_uid(const String &p_path) const override { return ResourceUID::INVALID_ID; } + virtual bool has_custom_uid_support() const override { return true; } + TranslationLoaderPO() {} }; diff --git a/core/math/a_star.cpp b/core/math/a_star.cpp index c85201a97393..a70aea5663f7 100644 --- a/core/math/a_star.cpp +++ b/core/math/a_star.cpp @@ -40,7 +40,7 @@ int64_t AStar3D::get_available_point_id() const { while (points.has(cur_new_id)) { cur_new_id++; } - const_cast(last_free_id) = cur_new_id; + last_free_id = cur_new_id; } return last_free_id; diff --git a/core/math/a_star.h b/core/math/a_star.h index cbaafc101836..e510923bd0f8 100644 --- a/core/math/a_star.h +++ b/core/math/a_star.h @@ -108,7 +108,7 @@ class AStar3D : public RefCounted { } }; - int64_t last_free_id = 0; + mutable int64_t last_free_id = 0; uint64_t pass = 1; OAHashMap points; diff --git a/core/math/bvh_logic.inc b/core/math/bvh_logic.inc index dd3b135bb56e..aaa91bc9d302 100644 --- a/core/math/bvh_logic.inc +++ b/core/math/bvh_logic.inc @@ -1,4 +1,3 @@ - // for slow incremental optimization, we will periodically remove each // item from the tree and reinsert, to give it a chance to find a better position void _logic_item_remove_and_reinsert(uint32_t p_ref_id) { diff --git a/core/math/bvh_misc.inc b/core/math/bvh_misc.inc index 9b35a1d36dc5..ef1261a75972 100644 --- a/core/math/bvh_misc.inc +++ b/core/math/bvh_misc.inc @@ -1,4 +1,3 @@ - int _handle_get_tree_id(BVHHandle p_handle) const { if (USE_PAIRS) { return _extra[p_handle.id()].tree_id; diff --git a/core/math/bvh_structs.inc b/core/math/bvh_structs.inc index d40c631ce22a..6326cd63ef3d 100644 --- a/core/math/bvh_structs.inc +++ b/core/math/bvh_structs.inc @@ -1,4 +1,3 @@ - public: struct ItemRef { uint32_t tnode_id; // -1 is invalid diff --git a/core/math/projection.cpp b/core/math/projection.cpp index 4a0faef08f1c..20638826a6e5 100644 --- a/core/math/projection.cpp +++ b/core/math/projection.cpp @@ -912,14 +912,10 @@ void Projection::set_light_atlas_rect(const Rect2 &p_rect) { } Projection::operator String() const { - String str; - for (int i = 0; i < 4; i++) { - for (int j = 0; j < 4; j++) { - str += String((j > 0) ? ", " : "\n") + rtos(columns[i][j]); - } - } - - return str; + return "[X: " + columns[0].operator String() + + ", Y: " + columns[1].operator String() + + ", Z: " + columns[2].operator String() + + ", W: " + columns[3].operator String() + "]"; } real_t Projection::get_aspect() const { diff --git a/core/math/vector4.cpp b/core/math/vector4.cpp index b6b914f36dab..8ac2c4bf1f17 100644 --- a/core/math/vector4.cpp +++ b/core/math/vector4.cpp @@ -213,7 +213,7 @@ Vector4 Vector4::clampf(real_t p_min, real_t p_max) const { } Vector4::operator String() const { - return "(" + String::num_real(x, false) + ", " + String::num_real(y, false) + ", " + String::num_real(z, false) + ", " + String::num_real(w, false) + ")"; + return "(" + String::num_real(x, true) + ", " + String::num_real(y, true) + ", " + String::num_real(z, true) + ", " + String::num_real(w, true) + ")"; } static_assert(sizeof(Vector4) == 4 * sizeof(real_t)); diff --git a/core/object/class_db.cpp b/core/object/class_db.cpp index d48e1a3622f6..865b6acc4234 100644 --- a/core/object/class_db.cpp +++ b/core/object/class_db.cpp @@ -1116,7 +1116,7 @@ void ClassDB::bind_integer_constant(const StringName &p_class, const StringName String enum_name = p_enum; if (!enum_name.is_empty()) { - if (enum_name.contains(".")) { + if (enum_name.contains_char('.')) { enum_name = enum_name.get_slicec('.', 1); } diff --git a/core/object/object.h b/core/object/object.h index 8f93b75bd869..da8e8d1b86ee 100644 --- a/core/object/object.h +++ b/core/object/object.h @@ -88,6 +88,7 @@ enum PropertyHint { PROPERTY_HINT_LAYERS_AVOIDANCE, PROPERTY_HINT_DICTIONARY_TYPE, PROPERTY_HINT_TOOL_BUTTON, + PROPERTY_HINT_ONESHOT, ///< the property will be changed by self after setting, such as AudioStreamPlayer.playing, Particles.emitting. PROPERTY_HINT_MAX, }; @@ -571,7 +572,7 @@ class Object { CONNECT_PERSIST = 2, // hint for scene to save this connection CONNECT_ONE_SHOT = 4, CONNECT_REFERENCE_COUNTED = 8, - CONNECT_INHERITED = 16, // Used in editor builds. + CONNECT_INHERITED = 16, // Whether or not the connection is in an instance of a scene. }; struct Connection { diff --git a/core/object/ref_counted.h b/core/object/ref_counted.h index 22eb5a7a3fef..927e457de2c3 100644 --- a/core/object/ref_counted.h +++ b/core/object/ref_counted.h @@ -222,7 +222,7 @@ struct PtrToArg> { return Ref(); } // p_ptr points to a RefCounted object - return Ref(const_cast(*reinterpret_cast(p_ptr))); + return Ref(*reinterpret_cast(p_ptr)); } typedef Ref EncodeT; diff --git a/core/object/script_language.cpp b/core/object/script_language.cpp index 542cb2b24d90..5afe45ca359f 100644 --- a/core/object/script_language.cpp +++ b/core/object/script_language.cpp @@ -568,7 +568,7 @@ void ScriptLanguage::frame() { } TypedArray ScriptLanguage::CodeCompletionOption::get_option_characteristics(const String &p_base) { - // Return characacteristics of the match found by order of importance. + // Return characteristics of the match found by order of importance. // Matches will be ranked by a lexicographical order on the vector returned by this function. // The lower values indicate better matches and that they should go before in the order of appearance. if (last_matches == matches) { diff --git a/core/object/worker_thread_pool.h b/core/object/worker_thread_pool.h index 62296ac04052..58e86e3e48eb 100644 --- a/core/object/worker_thread_pool.h +++ b/core/object/worker_thread_pool.h @@ -258,7 +258,13 @@ class WorkerThreadPool : public Object { bool is_group_task_completed(GroupID p_group) const; void wait_for_group_task_completion(GroupID p_group); - _FORCE_INLINE_ int get_thread_count() const { return threads.size(); } + _FORCE_INLINE_ int get_thread_count() const { +#ifdef THREADS_ENABLED + return threads.size(); +#else + return 1; +#endif + } static WorkerThreadPool *get_singleton() { return singleton; } static int get_thread_index(); diff --git a/core/os/condition_variable.h b/core/os/condition_variable.h index c819fa6b402b..6530b40b1ca0 100644 --- a/core/os/condition_variable.h +++ b/core/os/condition_variable.h @@ -57,12 +57,12 @@ class ConditionVariable { public: template _ALWAYS_INLINE_ void wait(const MutexLock &p_lock) const { - condition.wait(const_cast &>(p_lock._get_lock())); + condition.wait(p_lock._get_lock()); } template _ALWAYS_INLINE_ void wait(const MutexLock> &p_lock) const { - condition.wait(const_cast &>(p_lock.mutex._get_lock())); + condition.wait(p_lock.mutex._get_lock()); } _ALWAYS_INLINE_ void notify_one() const { diff --git a/core/os/os.cpp b/core/os/os.cpp index 59a0579ce36b..ff713ab3027a 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -276,6 +276,10 @@ String OS::get_cache_path() const { return "."; } +String OS::get_temp_path() const { + return "."; +} + // Path to macOS .app bundle resources String OS::get_bundle_resource_dir() const { return "."; @@ -514,6 +518,10 @@ bool OS::has_feature(const String &p_feature) { if (p_feature == "wasm") { return true; } +#elif defined(__loongarch64) + if (p_feature == "loongarch64") { + return true; + } #endif #if defined(IOS_SIMULATOR) diff --git a/core/os/os.h b/core/os/os.h index ffdb905abaf7..4edfc68e2f7b 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -111,7 +111,7 @@ class OS { friend int test_main(int argc, char *argv[]); HasServerFeatureCallback has_server_feature_callback = nullptr; - RenderThreadMode _render_thread_mode = RENDER_THREAD_SAFE; + bool _separate_thread_render = false; // Functions used by Main to initialize/deinitialize the OS. void add_logger(Logger *p_logger); @@ -274,7 +274,7 @@ class OS { virtual uint64_t get_static_memory_peak_usage() const; virtual Dictionary get_memory_info() const; - RenderThreadMode get_render_thread_mode() const { return _render_thread_mode; } + bool is_separate_thread_rendering_enabled() const { return _separate_thread_render; } virtual String get_locale() const; String get_locale_language() const; @@ -287,6 +287,7 @@ class OS { virtual String get_data_path() const; virtual String get_config_path() const; virtual String get_cache_path() const; + virtual String get_temp_path() const; virtual String get_bundle_resource_dir() const; virtual String get_bundle_icon_path() const; diff --git a/core/os/spin_lock.h b/core/os/spin_lock.h index 8c2d5667ffd3..eb7b1721d742 100644 --- a/core/os/spin_lock.h +++ b/core/os/spin_lock.h @@ -31,8 +31,15 @@ #ifndef SPIN_LOCK_H #define SPIN_LOCK_H +#include "core/os/thread.h" #include "core/typedefs.h" +#ifdef THREADS_ENABLED + +// Note the implementations below avoid false sharing by ensuring their +// sizes match the assumed cache line. We can't use align attributes +// because these objects may end up unaligned in semi-tightly packed arrays. + #ifdef _MSC_VER #include #endif @@ -42,7 +49,10 @@ #include class SpinLock { - mutable os_unfair_lock _lock = OS_UNFAIR_LOCK_INIT; + union { + mutable os_unfair_lock _lock = OS_UNFAIR_LOCK_INIT; + char aligner[Thread::CACHE_LINE_BYTES]; + }; public: _ALWAYS_INLINE_ void lock() const { @@ -54,9 +64,7 @@ class SpinLock { } }; -#else - -#include "core/os/thread.h" +#else // __APPLE__ #include @@ -84,8 +92,11 @@ _ALWAYS_INLINE_ static void _cpu_pause() { static_assert(std::atomic_bool::is_always_lock_free); -class alignas(Thread::CACHE_LINE_BYTES) SpinLock { - mutable std::atomic locked = ATOMIC_VAR_INIT(false); +class SpinLock { + union { + mutable std::atomic locked = ATOMIC_VAR_INIT(false); + char aligner[Thread::CACHE_LINE_BYTES]; + }; public: _ALWAYS_INLINE_ void lock() const { @@ -107,4 +118,14 @@ class alignas(Thread::CACHE_LINE_BYTES) SpinLock { #endif // __APPLE__ +#else // THREADS_ENABLED + +class SpinLock { +public: + void lock() const {} + void unlock() const {} +}; + +#endif // THREADS_ENABLED + #endif // SPIN_LOCK_H diff --git a/core/register_core_types.cpp b/core/register_core_types.cpp index 3a578d01a6ba..685ba9d3d98f 100644 --- a/core/register_core_types.cpp +++ b/core/register_core_types.cpp @@ -313,17 +313,28 @@ void register_core_settings() { GLOBAL_DEF("threading/worker_pool/low_priority_thread_ratio", 0.3); } +void register_early_core_singletons() { + GDREGISTER_CLASS(core_bind::Engine); + Engine::get_singleton()->add_singleton(Engine::Singleton("Engine", core_bind::Engine::get_singleton())); + + GDREGISTER_CLASS(ProjectSettings); + Engine::get_singleton()->add_singleton(Engine::Singleton("ProjectSettings", ProjectSettings::get_singleton())); + + GDREGISTER_CLASS(core_bind::OS); + Engine::get_singleton()->add_singleton(Engine::Singleton("OS", core_bind::OS::get_singleton())); + + GDREGISTER_CLASS(Time); + Engine::get_singleton()->add_singleton(Engine::Singleton("Time", Time::get_singleton())); +} + void register_core_singletons() { OS::get_singleton()->benchmark_begin_measure("Core", "Register Singletons"); - GDREGISTER_CLASS(ProjectSettings); GDREGISTER_ABSTRACT_CLASS(IP); GDREGISTER_CLASS(core_bind::Geometry2D); GDREGISTER_CLASS(core_bind::Geometry3D); GDREGISTER_CLASS(core_bind::ResourceLoader); GDREGISTER_CLASS(core_bind::ResourceSaver); - GDREGISTER_CLASS(core_bind::OS); - GDREGISTER_CLASS(core_bind::Engine); GDREGISTER_CLASS(core_bind::special::ClassDB); GDREGISTER_CLASS(core_bind::Marshalls); GDREGISTER_CLASS(TranslationServer); @@ -331,23 +342,18 @@ void register_core_singletons() { GDREGISTER_CLASS(InputMap); GDREGISTER_CLASS(Expression); GDREGISTER_CLASS(core_bind::EngineDebugger); - GDREGISTER_CLASS(Time); - Engine::get_singleton()->add_singleton(Engine::Singleton("ProjectSettings", ProjectSettings::get_singleton())); Engine::get_singleton()->add_singleton(Engine::Singleton("IP", IP::get_singleton(), "IP")); Engine::get_singleton()->add_singleton(Engine::Singleton("Geometry2D", core_bind::Geometry2D::get_singleton())); Engine::get_singleton()->add_singleton(Engine::Singleton("Geometry3D", core_bind::Geometry3D::get_singleton())); Engine::get_singleton()->add_singleton(Engine::Singleton("ResourceLoader", core_bind::ResourceLoader::get_singleton())); Engine::get_singleton()->add_singleton(Engine::Singleton("ResourceSaver", core_bind::ResourceSaver::get_singleton())); - Engine::get_singleton()->add_singleton(Engine::Singleton("OS", core_bind::OS::get_singleton())); - Engine::get_singleton()->add_singleton(Engine::Singleton("Engine", core_bind::Engine::get_singleton())); Engine::get_singleton()->add_singleton(Engine::Singleton("ClassDB", _classdb)); Engine::get_singleton()->add_singleton(Engine::Singleton("Marshalls", core_bind::Marshalls::get_singleton())); Engine::get_singleton()->add_singleton(Engine::Singleton("TranslationServer", TranslationServer::get_singleton())); Engine::get_singleton()->add_singleton(Engine::Singleton("Input", Input::get_singleton())); Engine::get_singleton()->add_singleton(Engine::Singleton("InputMap", InputMap::get_singleton())); Engine::get_singleton()->add_singleton(Engine::Singleton("EngineDebugger", core_bind::EngineDebugger::get_singleton())); - Engine::get_singleton()->add_singleton(Engine::Singleton("Time", Time::get_singleton())); Engine::get_singleton()->add_singleton(Engine::Singleton("GDExtensionManager", GDExtensionManager::get_singleton())); Engine::get_singleton()->add_singleton(Engine::Singleton("ResourceUID", ResourceUID::get_singleton())); Engine::get_singleton()->add_singleton(Engine::Singleton("WorkerThreadPool", worker_thread_pool)); diff --git a/core/register_core_types.h b/core/register_core_types.h index eba569272ee2..b8db5c5d2600 100644 --- a/core/register_core_types.h +++ b/core/register_core_types.h @@ -34,6 +34,7 @@ void register_core_types(); void register_core_settings(); void register_core_extensions(); +void register_early_core_singletons(); void register_core_singletons(); void unregister_core_types(); void unregister_core_extensions(); diff --git a/core/string/print_string.cpp b/core/string/print_string.cpp index 0f019c405f02..adceb6365e66 100644 --- a/core/string/print_string.cpp +++ b/core/string/print_string.cpp @@ -93,80 +93,178 @@ void __print_line_rich(const String &p_string) { // Convert a subset of BBCode tags to ANSI escape codes for correct display in the terminal. // Support of those ANSI escape codes varies across terminal emulators, // especially for italic and strikethrough. - String p_string_ansi = p_string; - - p_string_ansi = p_string_ansi.replace("[b]", "\u001b[1m"); - p_string_ansi = p_string_ansi.replace("[/b]", "\u001b[22m"); - p_string_ansi = p_string_ansi.replace("[i]", "\u001b[3m"); - p_string_ansi = p_string_ansi.replace("[/i]", "\u001b[23m"); - p_string_ansi = p_string_ansi.replace("[u]", "\u001b[4m"); - p_string_ansi = p_string_ansi.replace("[/u]", "\u001b[24m"); - p_string_ansi = p_string_ansi.replace("[s]", "\u001b[9m"); - p_string_ansi = p_string_ansi.replace("[/s]", "\u001b[29m"); - - p_string_ansi = p_string_ansi.replace("[indent]", " "); - p_string_ansi = p_string_ansi.replace("[/indent]", ""); - p_string_ansi = p_string_ansi.replace("[code]", "\u001b[2m"); - p_string_ansi = p_string_ansi.replace("[/code]", "\u001b[22m"); - p_string_ansi = p_string_ansi.replace("[url]", ""); - p_string_ansi = p_string_ansi.replace("[/url]", ""); - p_string_ansi = p_string_ansi.replace("[center]", "\n\t\t\t"); - p_string_ansi = p_string_ansi.replace("[/center]", ""); - p_string_ansi = p_string_ansi.replace("[right]", "\n\t\t\t\t\t\t"); - p_string_ansi = p_string_ansi.replace("[/right]", ""); - - if (p_string_ansi.contains("[color")) { - p_string_ansi = p_string_ansi.replace("[color=black]", "\u001b[30m"); - p_string_ansi = p_string_ansi.replace("[color=red]", "\u001b[91m"); - p_string_ansi = p_string_ansi.replace("[color=green]", "\u001b[92m"); - p_string_ansi = p_string_ansi.replace("[color=lime]", "\u001b[92m"); - p_string_ansi = p_string_ansi.replace("[color=yellow]", "\u001b[93m"); - p_string_ansi = p_string_ansi.replace("[color=blue]", "\u001b[94m"); - p_string_ansi = p_string_ansi.replace("[color=magenta]", "\u001b[95m"); - p_string_ansi = p_string_ansi.replace("[color=pink]", "\u001b[38;5;218m"); - p_string_ansi = p_string_ansi.replace("[color=purple]", "\u001b[38;5;98m"); - p_string_ansi = p_string_ansi.replace("[color=cyan]", "\u001b[96m"); - p_string_ansi = p_string_ansi.replace("[color=white]", "\u001b[97m"); - p_string_ansi = p_string_ansi.replace("[color=orange]", "\u001b[38;5;208m"); - p_string_ansi = p_string_ansi.replace("[color=gray]", "\u001b[90m"); - p_string_ansi = p_string_ansi.replace("[/color]", "\u001b[39m"); - } - if (p_string_ansi.contains("[bgcolor")) { - p_string_ansi = p_string_ansi.replace("[bgcolor=black]", "\u001b[40m"); - p_string_ansi = p_string_ansi.replace("[bgcolor=red]", "\u001b[101m"); - p_string_ansi = p_string_ansi.replace("[bgcolor=green]", "\u001b[102m"); - p_string_ansi = p_string_ansi.replace("[bgcolor=lime]", "\u001b[102m"); - p_string_ansi = p_string_ansi.replace("[bgcolor=yellow]", "\u001b[103m"); - p_string_ansi = p_string_ansi.replace("[bgcolor=blue]", "\u001b[104m"); - p_string_ansi = p_string_ansi.replace("[bgcolor=magenta]", "\u001b[105m"); - p_string_ansi = p_string_ansi.replace("[bgcolor=pink]", "\u001b[48;5;218m"); - p_string_ansi = p_string_ansi.replace("[bgcolor=purple]", "\u001b[48;5;98m"); - p_string_ansi = p_string_ansi.replace("[bgcolor=cyan]", "\u001b[106m"); - p_string_ansi = p_string_ansi.replace("[bgcolor=white]", "\u001b[107m"); - p_string_ansi = p_string_ansi.replace("[bgcolor=orange]", "\u001b[48;5;208m"); - p_string_ansi = p_string_ansi.replace("[bgcolor=gray]", "\u001b[100m"); - p_string_ansi = p_string_ansi.replace("[/bgcolor]", "\u001b[49m"); - } - if (p_string_ansi.contains("[fgcolor")) { - p_string_ansi = p_string_ansi.replace("[fgcolor=black]", "\u001b[30;40m"); - p_string_ansi = p_string_ansi.replace("[fgcolor=red]", "\u001b[91;101m"); - p_string_ansi = p_string_ansi.replace("[fgcolor=green]", "\u001b[92;102m"); - p_string_ansi = p_string_ansi.replace("[fgcolor=lime]", "\u001b[92;102m"); - p_string_ansi = p_string_ansi.replace("[fgcolor=yellow]", "\u001b[93;103m"); - p_string_ansi = p_string_ansi.replace("[fgcolor=blue]", "\u001b[94;104m"); - p_string_ansi = p_string_ansi.replace("[fgcolor=magenta]", "\u001b[95;105m"); - p_string_ansi = p_string_ansi.replace("[fgcolor=pink]", "\u001b[38;5;218;48;5;218m"); - p_string_ansi = p_string_ansi.replace("[fgcolor=purple]", "\u001b[38;5;98;48;5;98m"); - p_string_ansi = p_string_ansi.replace("[fgcolor=cyan]", "\u001b[96;106m"); - p_string_ansi = p_string_ansi.replace("[fgcolor=white]", "\u001b[97;107m"); - p_string_ansi = p_string_ansi.replace("[fgcolor=orange]", "\u001b[38;5;208;48;5;208m"); - p_string_ansi = p_string_ansi.replace("[fgcolor=gray]", "\u001b[90;100m"); - p_string_ansi = p_string_ansi.replace("[/fgcolor]", "\u001b[39;49m"); - } - p_string_ansi += "\u001b[0m"; // Reset. + String output; + int pos = 0; + while (pos <= p_string.length()) { + int brk_pos = p_string.find_char('[', pos); + + if (brk_pos < 0) { + brk_pos = p_string.length(); + } + + String txt = brk_pos > pos ? p_string.substr(pos, brk_pos - pos) : ""; + if (brk_pos == p_string.length()) { + output += txt; + break; + } + + int brk_end = p_string.find_char(']', brk_pos + 1); + + if (brk_end == -1) { + txt += p_string.substr(brk_pos, p_string.length() - brk_pos); + output += txt; + break; + } + pos = brk_end + 1; + output += txt; + + String tag = p_string.substr(brk_pos + 1, brk_end - brk_pos - 1); + if (tag == "b") { + output += "\u001b[1m"; + } else if (tag == "/b") { + output += "\u001b[22m"; + } else if (tag == "i") { + output += "\u001b[3m"; + } else if (tag == "/i") { + output += "\u001b[23m"; + } else if (tag == "u") { + output += "\u001b[4m"; + } else if (tag == "/u") { + output += "\u001b[24m"; + } else if (tag == "s") { + output += "\u001b[9m"; + } else if (tag == "/s") { + output += "\u001b[29m"; + } else if (tag == "indent") { + output += " "; + } else if (tag == "/indent") { + output += ""; + } else if (tag == "code") { + output += "\u001b[2m"; + } else if (tag == "/code") { + output += "\u001b[22m"; + } else if (tag == "url") { + output += ""; + } else if (tag == "/url") { + output += ""; + } else if (tag == "center") { + output += "\n\t\t\t"; + } else if (tag == "center") { + output += ""; + } else if (tag == "right") { + output += "\n\t\t\t\t\t\t"; + } else if (tag == "/right") { + output += ""; + } else if (tag.begins_with("color=")) { + String color_name = tag.trim_prefix("color="); + if (color_name == "black") { + output += "\u001b[30m"; + } else if (color_name == "red") { + output += "\u001b[91m"; + } else if (color_name == "green") { + output += "\u001b[92m"; + } else if (color_name == "lime") { + output += "\u001b[92m"; + } else if (color_name == "yellow") { + output += "\u001b[93m"; + } else if (color_name == "blue") { + output += "\u001b[94m"; + } else if (color_name == "magenta") { + output += "\u001b[95m"; + } else if (color_name == "pink") { + output += "\u001b[38;5;218m"; + } else if (color_name == "purple") { + output += "\u001b[38;5;98m"; + } else if (color_name == "cyan") { + output += "\u001b[96m"; + } else if (color_name == "white") { + output += "\u001b[97m"; + } else if (color_name == "orange") { + output += "\u001b[38;5;208m"; + } else if (color_name == "gray") { + output += "\u001b[90m"; + } else { + Color c = Color::from_string(color_name, Color()); + output += vformat("\u001b[38;2;%d;%d;%dm", c.r * 255, c.g * 255, c.b * 255); + } + } else if (tag == "/color") { + output += "\u001b[39m"; + } else if (tag.begins_with("bgcolor=")) { + String color_name = tag.trim_prefix("bgcolor="); + if (color_name == "black") { + output += "\u001b[40m"; + } else if (color_name == "red") { + output += "\u001b[101m"; + } else if (color_name == "green") { + output += "\u001b[102m"; + } else if (color_name == "lime") { + output += "\u001b[102m"; + } else if (color_name == "yellow") { + output += "\u001b[103m"; + } else if (color_name == "blue") { + output += "\u001b[104m"; + } else if (color_name == "magenta") { + output += "\u001b[105m"; + } else if (color_name == "pink") { + output += "\u001b[48;5;218m"; + } else if (color_name == "purple") { + output += "\u001b[48;5;98m"; + } else if (color_name == "cyan") { + output += "\u001b[106m"; + } else if (color_name == "white") { + output += "\u001b[107m"; + } else if (color_name == "orange") { + output += "\u001b[48;5;208m"; + } else if (color_name == "gray") { + output += "\u001b[100m"; + } else { + Color c = Color::from_string(color_name, Color()); + output += vformat("\u001b[48;2;%d;%d;%dm", c.r * 255, c.g * 255, c.b * 255); + } + } else if (tag == "/bgcolor") { + output += "\u001b[49m"; + } else if (tag.begins_with("fgcolor=")) { + String color_name = tag.trim_prefix("fgcolor="); + if (color_name == "black") { + output += "\u001b[30;40m"; + } else if (color_name == "red") { + output += "\u001b[91;101m"; + } else if (color_name == "green") { + output += "\u001b[92;102m"; + } else if (color_name == "lime") { + output += "\u001b[92;102m"; + } else if (color_name == "yellow") { + output += "\u001b[93;103m"; + } else if (color_name == "blue") { + output += "\u001b[94;104m"; + } else if (color_name == "magenta") { + output += "\u001b[95;105m"; + } else if (color_name == "pink") { + output += "\u001b[38;5;218;48;5;218m"; + } else if (color_name == "purple") { + output += "\u001b[38;5;98;48;5;98m"; + } else if (color_name == "cyan") { + output += "\u001b[96;106m"; + } else if (color_name == "white") { + output += "\u001b[97;107m"; + } else if (color_name == "orange") { + output += "\u001b[38;5;208;48;5;208m"; + } else if (color_name == "gray") { + output += "\u001b[90;100m"; + } else { + Color c = Color::from_string(color_name, Color()); + output += vformat("\u001b[38;2;%d;%d;%d;48;2;%d;%d;%dm", c.r * 255, c.g * 255, c.b * 255, c.r * 255, c.g * 255, c.b * 255); + } + } else if (tag == "/fgcolor") { + output += "\u001b[39;49m"; + } else { + output += vformat("[%s]", tag); + } + } + output += "\u001b[0m"; // Reset. - OS::get_singleton()->print_rich("%s\n", p_string_ansi.utf8().get_data()); + OS::get_singleton()->print_rich("%s\n", output.utf8().get_data()); _global_lock(); PrintHandlerList *l = print_handler_list; diff --git a/core/string/string_name.cpp b/core/string/string_name.cpp index dff19b3a41ae..2d3c376d0cbe 100644 --- a/core/string/string_name.cpp +++ b/core/string/string_name.cpp @@ -191,12 +191,6 @@ bool StringName::operator!=(const char *p_name) const { return !(operator==(p_name)); } -bool StringName::operator!=(const StringName &p_name) const { - // the real magic of all this mess happens here. - // this is why path comparisons are very fast - return _data != p_name._data; -} - char32_t StringName::operator[](int p_index) const { if (_data) { if (_data->cname) { diff --git a/core/string/string_name.h b/core/string/string_name.h index d4b70d311dcf..957f64492d41 100644 --- a/core/string/string_name.h +++ b/core/string/string_name.h @@ -132,10 +132,13 @@ class StringName { return _data >= p_name._data; } _FORCE_INLINE_ bool operator==(const StringName &p_name) const { - // the real magic of all this mess happens here. - // this is why path comparisons are very fast + // The real magic of all this mess happens here. + // This is why path comparisons are very fast. return _data == p_name._data; } + _FORCE_INLINE_ bool operator!=(const StringName &p_name) const { + return _data != p_name._data; + } _FORCE_INLINE_ uint32_t hash() const { if (_data) { return _data->hash; @@ -146,7 +149,6 @@ class StringName { _FORCE_INLINE_ const void *data_unique_pointer() const { return (void *)_data; } - bool operator!=(const StringName &p_name) const; _FORCE_INLINE_ operator String() const { if (_data) { diff --git a/core/string/translation.cpp b/core/string/translation.cpp index 020949371f2e..d944135a7097 100644 --- a/core/string/translation.cpp +++ b/core/string/translation.cpp @@ -80,8 +80,10 @@ void Translation::set_locale(const String &p_locale) { if (Thread::is_main_thread()) { _notify_translation_changed_if_applies(); } else { - // Avoid calling non-thread-safe functions here. - callable_mp(this, &Translation::_notify_translation_changed_if_applies).call_deferred(); + // This has to happen on the main thread (bypassing the ResourceLoader per-thread call queue) + // because it interacts with the generally non-thread-safe window management, leading to + // different issues across platforms otherwise. + MessageQueue::get_main_singleton()->push_callable(callable_mp(this, &Translation::_notify_translation_changed_if_applies)); } } diff --git a/modules/text_server_adv/thorvg_bounds_iterator.h b/core/string/translation_server.compat.inc similarity index 76% rename from modules/text_server_adv/thorvg_bounds_iterator.h rename to core/string/translation_server.compat.inc index afa2c137641e..11f508c6543e 100644 --- a/modules/text_server_adv/thorvg_bounds_iterator.h +++ b/core/string/translation_server.compat.inc @@ -1,5 +1,5 @@ /**************************************************************************/ -/* thorvg_bounds_iterator.h */ +/* translation_server.compat.inc */ /**************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,31 +28,14 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ -#ifndef THORVG_BOUNDS_ITERATOR_H -#define THORVG_BOUNDS_ITERATOR_H +#ifndef DISABLE_DEPRECATED -#ifdef GDEXTENSION -// Headers for building as GDExtension plug-in. +String TranslationServer::_standardize_locale_bind_compat_98972(const String &p_locale) const { + return standardize_locale(p_locale, false); +} -#include -#include +void TranslationServer::_bind_compatibility_methods() { + ClassDB::bind_compatibility_method(D_METHOD("standardize_locale", "locale"), &TranslationServer::_standardize_locale_bind_compat_98972); +} -using namespace godot; - -#elif defined(GODOT_MODULE) -// Headers for building as built-in module. - -#include "core/typedefs.h" - -#include "modules/modules_enabled.gen.h" // For svg. -#endif - -#ifdef MODULE_SVG_ENABLED - -#include - -void tvg_get_bounds(tvg::Picture *p_picture, float &r_min_x, float &r_min_y, float &r_max_x, float &r_max_y); - -#endif // MODULE_SVG_ENABLED - -#endif // THORVG_BOUNDS_ITERATOR_H +#endif // DISABLE_DEPRECATED diff --git a/core/string/translation_server.cpp b/core/string/translation_server.cpp index 31c221dad729..cb2bfad6df24 100644 --- a/core/string/translation_server.cpp +++ b/core/string/translation_server.cpp @@ -29,6 +29,7 @@ /**************************************************************************/ #include "translation_server.h" +#include "translation_server.compat.inc" #include "core/config/project_settings.h" #include "core/io/resource_loader.h" @@ -218,8 +219,8 @@ TranslationServer::Locale::Locale(const TranslationServer &p_server, const Strin } } -String TranslationServer::standardize_locale(const String &p_locale) const { - return Locale(*this, p_locale, false).operator String(); +String TranslationServer::standardize_locale(const String &p_locale, bool p_add_defaults) const { + return Locale(*this, p_locale, p_add_defaults).operator String(); } int TranslationServer::compare_locales(const String &p_locale_a, const String &p_locale_b) const { @@ -482,6 +483,7 @@ void TranslationServer::setup() { main_domain->set_pseudolocalization_skip_placeholders_enabled(GLOBAL_DEF("internationalization/pseudolocalization/skip_placeholders", true)); #ifdef TOOLS_ENABLED + ProjectSettings::get_singleton()->set_custom_property_info(PropertyInfo(Variant::STRING, "internationalization/locale/test", PROPERTY_HINT_LOCALE_ID, "")); ProjectSettings::get_singleton()->set_custom_property_info(PropertyInfo(Variant::STRING, "internationalization/locale/fallback", PROPERTY_HINT_LOCALE_ID, "")); #endif } @@ -591,7 +593,7 @@ void TranslationServer::_bind_methods() { ClassDB::bind_method(D_METHOD("get_tool_locale"), &TranslationServer::get_tool_locale); ClassDB::bind_method(D_METHOD("compare_locales", "locale_a", "locale_b"), &TranslationServer::compare_locales); - ClassDB::bind_method(D_METHOD("standardize_locale", "locale"), &TranslationServer::standardize_locale); + ClassDB::bind_method(D_METHOD("standardize_locale", "locale", "add_defaults"), &TranslationServer::standardize_locale, DEFVAL(false)); ClassDB::bind_method(D_METHOD("get_all_languages"), &TranslationServer::get_all_languages); ClassDB::bind_method(D_METHOD("get_language_name", "language"), &TranslationServer::get_language_name); diff --git a/core/string/translation_server.h b/core/string/translation_server.h index bc59c34a38aa..b6e4bba6e512 100644 --- a/core/string/translation_server.h +++ b/core/string/translation_server.h @@ -52,10 +52,14 @@ class TranslationServer : public Object { static inline TranslationServer *singleton = nullptr; bool _load_translations(const String &p_from); - String _standardize_locale(const String &p_locale, bool p_add_defaults) const; static void _bind_methods(); +#ifndef DISABLE_DEPRECATED + String _standardize_locale_bind_compat_98972(const String &p_locale) const; + static void _bind_compatibility_methods(); +#endif + struct LocaleScriptInfo { String name; String script; @@ -129,7 +133,7 @@ class TranslationServer : public Object { void set_pseudolocalization_enabled(bool p_enabled); void reload_pseudolocalization(); - String standardize_locale(const String &p_locale) const; + String standardize_locale(const String &p_locale, bool p_add_defaults = false) const; int compare_locales(const String &p_locale_a, const String &p_locale_b) const; diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index 9e99fc3b2f57..805ddd4bc3fd 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -65,6 +65,15 @@ const char16_t Char16String::_null = 0; const char32_t String::_null = 0; const char32_t String::_replacement_char = 0xfffd; +// strlen equivalent function for char32_t * arguments. +_FORCE_INLINE_ size_t strlen(const char32_t *p_str) { + const char32_t *ptr = p_str; + while (*ptr != 0) { + ++ptr; + } + return ptr - p_str; +} + bool select_word(const String &p_s, int p_col, int &r_beg, int &r_end) { const String &s = p_s; int beg = CLAMP(p_col, 0, s.length()); @@ -320,21 +329,14 @@ void String::copy_from(const char *p_cstr) { resize(len + 1); // include 0 + const char *end = p_cstr + len; char32_t *dst = ptrw(); - for (size_t i = 0; i <= len; i++) { -#if CHAR_MIN == 0 - uint8_t c = p_cstr[i]; -#else - uint8_t c = p_cstr[i] >= 0 ? p_cstr[i] : uint8_t(256 + p_cstr[i]); -#endif - if (c == 0 && i < len) { - print_unicode_error("NUL character", true); - dst[i] = _replacement_char; - } else { - dst[i] = c; - } + for (; p_cstr < end; ++p_cstr, ++dst) { + // If char is int8_t, a set sign bit will be reinterpreted as 256 - val implicitly. + *dst = static_cast(*p_cstr); } + *dst = 0; } void String::copy_from(const char *p_cstr, const int p_clip_to) { @@ -357,22 +359,14 @@ void String::copy_from(const char *p_cstr, const int p_clip_to) { resize(len + 1); // include 0 + const char *end = p_cstr + len; char32_t *dst = ptrw(); - for (int i = 0; i < len; i++) { -#if CHAR_MIN == 0 - uint8_t c = p_cstr[i]; -#else - uint8_t c = p_cstr[i] >= 0 ? p_cstr[i] : uint8_t(256 + p_cstr[i]); -#endif - if (c == 0) { - print_unicode_error("NUL character", true); - dst[i] = _replacement_char; - } else { - dst[i] = c; - } + for (; p_cstr < end; ++p_cstr, ++dst) { + // If char is int8_t, a set sign bit will be reinterpreted as 256 - val implicitly. + *dst = static_cast(*p_cstr); } - dst[len] = 0; + *dst = 0; } void String::copy_from(const wchar_t *p_cstr) { @@ -424,11 +418,7 @@ void String::copy_from(const char32_t *p_cstr) { return; } - int len = 0; - const char32_t *ptr = p_cstr; - while (*(ptr++) != 0) { - len++; - } + const int len = strlen(p_cstr); if (len == 0) { resize(0); @@ -464,27 +454,25 @@ void String::copy_from(const char32_t *p_cstr, const int p_clip_to) { // p_length <= p_char strlen void String::copy_from_unchecked(const char32_t *p_char, const int p_length) { resize(p_length + 1); + + const char32_t *end = p_char + p_length; char32_t *dst = ptrw(); - dst[p_length] = 0; - for (int i = 0; i < p_length; i++) { - if (p_char[i] == 0) { - print_unicode_error("NUL character", true); - dst[i] = _replacement_char; + for (; p_char < end; ++p_char, ++dst) { + const char32_t chr = *p_char; + if ((chr & 0xfffff800) == 0xd800) { + print_unicode_error(vformat("Unpaired surrogate (%x)", (uint32_t)chr)); + *dst = _replacement_char; continue; } - if ((p_char[i] & 0xfffff800) == 0xd800) { - print_unicode_error(vformat("Unpaired surrogate (%x)", (uint32_t)p_char[i])); - dst[i] = _replacement_char; - continue; - } - if (p_char[i] > 0x10ffff) { - print_unicode_error(vformat("Invalid unicode codepoint (%x)", (uint32_t)p_char[i])); - dst[i] = _replacement_char; + if (chr > 0x10ffff) { + print_unicode_error(vformat("Invalid unicode codepoint (%x)", (uint32_t)chr)); + *dst = _replacement_char; continue; } - dst[i] = p_char[i]; + *dst = chr; } + *dst = 0; } void String::operator=(const char *p_str) { @@ -629,12 +617,7 @@ String &String::operator+=(char32_t p_char) { bool String::operator==(const char *p_str) const { // compare Latin-1 encoded c-string - int len = 0; - const char *aux = p_str; - - while (*(aux++) != 0) { - len++; - } + int len = strlen(p_str); if (length() != len) { return false; @@ -668,12 +651,7 @@ bool String::operator==(const wchar_t *p_str) const { } bool String::operator==(const char32_t *p_str) const { - int len = 0; - const char32_t *aux = p_str; - - while (*(aux++) != 0) { - len++; - } + const int len = strlen(p_str); if (length() != len) { return false; @@ -1109,17 +1087,21 @@ String String::_camelcase_to_underscore() const { String new_string; int start_index = 0; - for (int i = 1; i < size(); i++) { - bool is_prev_upper = is_unicode_upper_case(cstr[i - 1]); - bool is_prev_lower = is_unicode_lower_case(cstr[i - 1]); - bool is_prev_digit = is_digit(cstr[i - 1]); + if (length() == 0) { + return *this; + } + + bool is_prev_upper = is_unicode_upper_case(cstr[0]); + bool is_prev_lower = is_unicode_lower_case(cstr[0]); + bool is_prev_digit = is_digit(cstr[0]); - bool is_curr_upper = is_unicode_upper_case(cstr[i]); - bool is_curr_lower = is_unicode_lower_case(cstr[i]); - bool is_curr_digit = is_digit(cstr[i]); + for (int i = 1; i < length(); i++) { + const bool is_curr_upper = is_unicode_upper_case(cstr[i]); + const bool is_curr_lower = is_unicode_lower_case(cstr[i]); + const bool is_curr_digit = is_digit(cstr[i]); bool is_next_lower = false; - if (i + 1 < size()) { + if (i + 1 < length()) { is_next_lower = is_unicode_lower_case(cstr[i + 1]); } @@ -1132,6 +1114,10 @@ String String::_camelcase_to_underscore() const { new_string += substr(start_index, i - start_index) + "_"; start_index = i; } + + is_prev_upper = is_curr_upper; + is_prev_lower = is_curr_lower; + is_prev_digit = is_curr_digit; } new_string += substr(start_index, size() - start_index); @@ -1278,7 +1264,7 @@ String String::get_slice(const char *p_splitter, int p_slice) const { } int i = 0; - int splitter_length = strlen(p_splitter); + const int splitter_length = strlen(p_splitter); while (true) { pos = find(p_splitter, pos); if (pos == -1) { @@ -1429,6 +1415,7 @@ Vector String::split(const char *p_splitter, bool p_allow_empty, int p_m int from = 0; int len = length(); + const int splitter_length = strlen(p_splitter); while (true) { int end; @@ -1459,7 +1446,7 @@ Vector String::split(const char *p_splitter, bool p_allow_empty, int p_m break; } - from = end + strlen(p_splitter); + from = end + splitter_length; } return ret; @@ -3310,6 +3297,10 @@ int String::find(const String &p_str, int p_from) const { return -1; // won't find anything! } + if (src_len == 1) { + return find_char(p_str[0], p_from); // Optimize with single-char find. + } + const char32_t *src = get_data(); const char32_t *str = p_str.get_data(); @@ -3350,6 +3341,10 @@ int String::find(const char *p_str, int p_from) const { return -1; // won't find anything! } + if (src_len == 1) { + return find_char(*p_str, p_from); // Optimize with single-char find. + } + const char32_t *src = get_data(); if (src_len == 1) { @@ -4077,7 +4072,7 @@ String String::format(const Variant &values, const String &placeholder) const { Variant v_val = values_arr[i]; String val = v_val; - if (placeholder.contains("_")) { + if (placeholder.contains_char('_')) { new_string = new_string.replace(placeholder.replace("_", i_as_str), val); } else { new_string = new_string.replace_first(placeholder, val); @@ -4604,7 +4599,7 @@ String String::simplify_path() const { dirs.remove_at(i); i--; } else if (d == "..") { - if (i != 0) { + if (i != 0 && dirs[i - 1] != "..") { dirs.remove_at(i); dirs.remove_at(i - 1); i -= 2; @@ -5285,7 +5280,7 @@ bool String::is_valid_html_color() const { } // Changes made to the set of invalid filename characters must also be reflected in the String documentation for is_valid_filename. -static const char *invalid_filename_characters = ": / \\ ? * \" | % < >"; +static const char *invalid_filename_characters[] = { ":", "/", "\\", "?", "*", "\"", "|", "%", "<", ">" }; bool String::is_valid_filename() const { String stripped = strip_edges(); @@ -5297,8 +5292,7 @@ bool String::is_valid_filename() const { return false; } - Vector chars = String(invalid_filename_characters).split(" "); - for (const String &ch : chars) { + for (const char *ch : invalid_filename_characters) { if (contains(ch)) { return false; } @@ -5307,10 +5301,9 @@ bool String::is_valid_filename() const { } String String::validate_filename() const { - Vector chars = String(invalid_filename_characters).split(" "); String name = strip_edges(); - for (int i = 0; i < chars.size(); i++) { - name = name.replace(chars[i], "_"); + for (const char *ch : invalid_filename_characters) { + name = name.replace(ch, "_"); } return name; } diff --git a/core/string/ustring.h b/core/string/ustring.h index d6e563223a90..3849bf3ce3c7 100644 --- a/core/string/ustring.h +++ b/core/string/ustring.h @@ -432,6 +432,7 @@ class String { _FORCE_INLINE_ bool is_empty() const { return length() == 0; } _FORCE_INLINE_ bool contains(const char *p_str) const { return find(p_str) != -1; } _FORCE_INLINE_ bool contains(const String &p_str) const { return find(p_str) != -1; } + _FORCE_INLINE_ bool contains_char(char32_t p_chr) const { return find_char(p_chr) != -1; } _FORCE_INLINE_ bool containsn(const char *p_str) const { return findn(p_str) != -1; } _FORCE_INLINE_ bool containsn(const String &p_str) const { return findn(p_str) != -1; } diff --git a/core/variant/dictionary.cpp b/core/variant/dictionary.cpp index 501ca6920558..0da9a589ab7d 100644 --- a/core/variant/dictionary.cpp +++ b/core/variant/dictionary.cpp @@ -693,6 +693,15 @@ Dictionary::Dictionary() { _p->refcount.init(); } +Dictionary::Dictionary(std::initializer_list> p_init) { + _p = memnew(DictionaryPrivate); + _p->refcount.init(); + + for (const KeyValue &E : p_init) { + operator[](E.key) = E.value; + } +} + Dictionary::~Dictionary() { _unref(); } diff --git a/core/variant/dictionary.h b/core/variant/dictionary.h index bbfb5b30837d..fe15e8f3668e 100644 --- a/core/variant/dictionary.h +++ b/core/variant/dictionary.h @@ -33,6 +33,7 @@ #include "core/string/ustring.h" #include "core/templates/list.h" +#include "core/templates/pair.h" #include "core/variant/array.h" class Variant; @@ -112,6 +113,7 @@ class Dictionary { Dictionary(const Dictionary &p_base, uint32_t p_key_type, const StringName &p_key_class_name, const Variant &p_key_script, uint32_t p_value_type, const StringName &p_value_class_name, const Variant &p_value_script); Dictionary(const Dictionary &p_from); + Dictionary(std::initializer_list> p_init); Dictionary(); ~Dictionary(); }; diff --git a/core/variant/method_ptrcall.h b/core/variant/method_ptrcall.h index 1e10709b12bd..540dcc4a4d91 100644 --- a/core/variant/method_ptrcall.h +++ b/core/variant/method_ptrcall.h @@ -160,7 +160,7 @@ MAKE_PTRARG_BY_REFERENCE(Variant); template struct PtrToArg { _FORCE_INLINE_ static T *convert(const void *p_ptr) { - return likely(p_ptr) ? const_cast(*reinterpret_cast(p_ptr)) : nullptr; + return likely(p_ptr) ? *reinterpret_cast(p_ptr) : nullptr; } typedef Object *EncodeT; _FORCE_INLINE_ static void encode(T *p_var, void *p_ptr) { diff --git a/core/variant/typed_dictionary.h b/core/variant/typed_dictionary.h index 67fc33b4fc73..86b4183c3d13 100644 --- a/core/variant/typed_dictionary.h +++ b/core/variant/typed_dictionary.h @@ -59,6 +59,14 @@ class TypedDictionary : public Dictionary { _FORCE_INLINE_ TypedDictionary() { set_typed(Variant::OBJECT, K::get_class_static(), Variant(), Variant::OBJECT, V::get_class_static(), Variant()); } + + _FORCE_INLINE_ TypedDictionary(std::initializer_list> p_init) : + Dictionary() { + set_typed(Variant::OBJECT, K::get_class_static(), Variant(), Variant::OBJECT, V::get_class_static(), Variant()); + for (const KeyValue &E : p_init) { + operator[](E.key) = E.value; + } + } }; template @@ -135,6 +143,13 @@ struct GetTypeInfo &> { _FORCE_INLINE_ TypedDictionary() { \ set_typed(Variant::OBJECT, T::get_class_static(), Variant(), m_variant_type, StringName(), Variant()); \ } \ + _FORCE_INLINE_ TypedDictionary(std::initializer_list> p_init) : \ + Dictionary() { \ + set_typed(Variant::OBJECT, T::get_class_static(), Variant(), m_variant_type, StringName(), Variant()); \ + for (const KeyValue &E : p_init) { \ + operator[](E.key) = E.value; \ + } \ + } \ }; \ template \ struct GetTypeInfo> { \ @@ -217,6 +232,13 @@ struct GetTypeInfo &> { _FORCE_INLINE_ TypedDictionary() { \ set_typed(m_variant_type_key, StringName(), Variant(), m_variant_type_value, StringName(), Variant()); \ } \ + _FORCE_INLINE_ TypedDictionary(std::initializer_list> p_init) : \ + Dictionary() { \ + set_typed(m_variant_type_key, StringName(), Variant(), m_variant_type_value, StringName(), Variant()); \ + for (const KeyValue &E : p_init) { \ + operator[](E.key) = E.value; \ + } \ + } \ }; \ template <> \ struct GetTypeInfo> { \ diff --git a/core/variant/variant.cpp b/core/variant/variant.cpp index 3e74dc4e67ae..8aca56c1d56f 100644 --- a/core/variant/variant.cpp +++ b/core/variant/variant.cpp @@ -3560,9 +3560,6 @@ bool Variant::is_ref_counted() const { return type == OBJECT && _get_obj().id.is_ref_counted(); } -void Variant::static_assign(const Variant &p_variant) { -} - bool Variant::is_type_shared(Variant::Type p_type) { switch (p_type) { case OBJECT: diff --git a/core/variant/variant.h b/core/variant/variant.h index 9702c67a3719..babd2cf08474 100644 --- a/core/variant/variant.h +++ b/core/variant/variant.h @@ -792,7 +792,6 @@ class Variant { String stringify(int recursion_count = 0) const; String to_json_string() const; - void static_assign(const Variant &p_variant); static void get_constants_for_type(Variant::Type p_type, List *p_constants); static int get_constants_count_for_type(Variant::Type p_type); static bool has_constant(Variant::Type p_type, const StringName &p_value); @@ -801,6 +800,8 @@ class Variant { static void get_enums_for_type(Variant::Type p_type, List *p_enums); static void get_enumerations_for_enum(Variant::Type p_type, const StringName &p_enum_name, List *p_enumerations); static int get_enum_value(Variant::Type p_type, const StringName &p_enum_name, const StringName &p_enumeration, bool *r_valid = nullptr); + static bool has_enum(Variant::Type p_type, const StringName &p_enum_name); + static StringName get_enum_for_enumeration(Variant::Type p_type, const StringName &p_enumeration); typedef String (*ObjectDeConstruct)(const Variant &p_object, void *ud); typedef void (*ObjectConstruct)(const String &p_text, void *ud, Variant &r_value); diff --git a/core/variant/variant_call.cpp b/core/variant/variant_call.cpp index 381b848b2b45..d612cb9cead1 100644 --- a/core/variant/variant_call.cpp +++ b/core/variant/variant_call.cpp @@ -1091,6 +1091,11 @@ struct _VariantCall { static ConstantData *constant_data; static void add_constant(int p_type, const StringName &p_constant_name, int64_t p_constant_value) { +#ifdef DEBUG_ENABLED + ERR_FAIL_COND(constant_data[p_type].value.has(p_constant_name)); + ERR_FAIL_COND(enum_data[p_type].value.has(p_constant_name)); + ERR_FAIL_COND(enum_data[p_type].value_to_enum.has(p_constant_name)); +#endif constant_data[p_type].value[p_constant_name] = p_constant_value; #ifdef DEBUG_ENABLED constant_data[p_type].value_ordered.push_back(p_constant_name); @@ -1106,12 +1111,19 @@ struct _VariantCall { struct EnumData { HashMap> value; + HashMap value_to_enum; }; static EnumData *enum_data; static void add_enum_constant(int p_type, const StringName &p_enum_type_name, const StringName &p_enumeration_name, int p_enum_value) { +#ifdef DEBUG_ENABLED + ERR_FAIL_COND(constant_data[p_type].value.has(p_enumeration_name)); + ERR_FAIL_COND(enum_data[p_type].value.has(p_enumeration_name)); + ERR_FAIL_COND(enum_data[p_type].value_to_enum.has(p_enumeration_name)); +#endif enum_data[p_type].value[p_enum_type_name][p_enumeration_name] = p_enum_value; + enum_data[p_type].value_to_enum[p_enumeration_name] = p_enum_type_name; } }; @@ -1561,6 +1573,23 @@ int Variant::get_enum_value(Variant::Type p_type, const StringName &p_enum_name, return V->value; } +bool Variant::has_enum(Variant::Type p_type, const StringName &p_enum_name) { + ERR_FAIL_INDEX_V(p_type, Variant::VARIANT_MAX, false); + + _VariantCall::EnumData &enum_data = _VariantCall::enum_data[p_type]; + + return enum_data.value.has(p_enum_name); +} + +StringName Variant::get_enum_for_enumeration(Variant::Type p_type, const StringName &p_enumeration) { + ERR_FAIL_INDEX_V(p_type, Variant::VARIANT_MAX, StringName()); + + _VariantCall::EnumData &enum_data = _VariantCall::enum_data[p_type]; + + const StringName *enum_name = enum_data.value_to_enum.getptr(p_enumeration); + return (enum_name == nullptr) ? StringName() : *enum_name; +} + #ifdef DEBUG_METHODS_ENABLED #define bind_method(m_type, m_method, m_arg_names, m_default_args) \ METHOD_CLASS(m_type, m_method, &m_type::m_method); \ @@ -2660,10 +2689,6 @@ static void _register_variant_builtin_constants() { _VariantCall::add_variant_constant(Variant::COLOR, Color::get_named_color_name(i), Color::get_named_color(i)); } - _VariantCall::add_constant(Variant::VECTOR3, "AXIS_X", Vector3::AXIS_X); - _VariantCall::add_constant(Variant::VECTOR3, "AXIS_Y", Vector3::AXIS_Y); - _VariantCall::add_constant(Variant::VECTOR3, "AXIS_Z", Vector3::AXIS_Z); - _VariantCall::add_enum_constant(Variant::VECTOR3, "Axis", "AXIS_X", Vector3::AXIS_X); _VariantCall::add_enum_constant(Variant::VECTOR3, "Axis", "AXIS_Y", Vector3::AXIS_Y); _VariantCall::add_enum_constant(Variant::VECTOR3, "Axis", "AXIS_Z", Vector3::AXIS_Z); @@ -2685,32 +2710,19 @@ static void _register_variant_builtin_constants() { _VariantCall::add_variant_constant(Variant::VECTOR3, "MODEL_FRONT", Vector3(0, 0, 1)); _VariantCall::add_variant_constant(Variant::VECTOR3, "MODEL_REAR", Vector3(0, 0, -1)); - _VariantCall::add_constant(Variant::VECTOR4, "AXIS_X", Vector4::AXIS_X); - _VariantCall::add_constant(Variant::VECTOR4, "AXIS_Y", Vector4::AXIS_Y); - _VariantCall::add_constant(Variant::VECTOR4, "AXIS_Z", Vector4::AXIS_Z); - _VariantCall::add_constant(Variant::VECTOR4, "AXIS_W", Vector4::AXIS_W); - _VariantCall::add_enum_constant(Variant::VECTOR4, "Axis", "AXIS_X", Vector4::AXIS_X); _VariantCall::add_enum_constant(Variant::VECTOR4, "Axis", "AXIS_Y", Vector4::AXIS_Y); _VariantCall::add_enum_constant(Variant::VECTOR4, "Axis", "AXIS_Z", Vector4::AXIS_Z); _VariantCall::add_enum_constant(Variant::VECTOR4, "Axis", "AXIS_W", Vector4::AXIS_W); + _VariantCall::add_variant_constant(Variant::VECTOR4, "ZERO", Vector4(0, 0, 0, 0)); _VariantCall::add_variant_constant(Variant::VECTOR4, "ONE", Vector4(1, 1, 1, 1)); _VariantCall::add_variant_constant(Variant::VECTOR4, "INF", Vector4(INFINITY, INFINITY, INFINITY, INFINITY)); - _VariantCall::add_constant(Variant::VECTOR3I, "AXIS_X", Vector3i::AXIS_X); - _VariantCall::add_constant(Variant::VECTOR3I, "AXIS_Y", Vector3i::AXIS_Y); - _VariantCall::add_constant(Variant::VECTOR3I, "AXIS_Z", Vector3i::AXIS_Z); - _VariantCall::add_enum_constant(Variant::VECTOR3I, "Axis", "AXIS_X", Vector3i::AXIS_X); _VariantCall::add_enum_constant(Variant::VECTOR3I, "Axis", "AXIS_Y", Vector3i::AXIS_Y); _VariantCall::add_enum_constant(Variant::VECTOR3I, "Axis", "AXIS_Z", Vector3i::AXIS_Z); - _VariantCall::add_constant(Variant::VECTOR4I, "AXIS_X", Vector4i::AXIS_X); - _VariantCall::add_constant(Variant::VECTOR4I, "AXIS_Y", Vector4i::AXIS_Y); - _VariantCall::add_constant(Variant::VECTOR4I, "AXIS_Z", Vector4i::AXIS_Z); - _VariantCall::add_constant(Variant::VECTOR4I, "AXIS_W", Vector4i::AXIS_W); - _VariantCall::add_enum_constant(Variant::VECTOR4I, "Axis", "AXIS_X", Vector4i::AXIS_X); _VariantCall::add_enum_constant(Variant::VECTOR4I, "Axis", "AXIS_Y", Vector4i::AXIS_Y); _VariantCall::add_enum_constant(Variant::VECTOR4I, "Axis", "AXIS_Z", Vector4i::AXIS_Z); @@ -2732,15 +2744,9 @@ static void _register_variant_builtin_constants() { _VariantCall::add_variant_constant(Variant::VECTOR3I, "FORWARD", Vector3i(0, 0, -1)); _VariantCall::add_variant_constant(Variant::VECTOR3I, "BACK", Vector3i(0, 0, 1)); - _VariantCall::add_constant(Variant::VECTOR2, "AXIS_X", Vector2::AXIS_X); - _VariantCall::add_constant(Variant::VECTOR2, "AXIS_Y", Vector2::AXIS_Y); - _VariantCall::add_enum_constant(Variant::VECTOR2, "Axis", "AXIS_X", Vector2::AXIS_X); _VariantCall::add_enum_constant(Variant::VECTOR2, "Axis", "AXIS_Y", Vector2::AXIS_Y); - _VariantCall::add_constant(Variant::VECTOR2I, "AXIS_X", Vector2i::AXIS_X); - _VariantCall::add_constant(Variant::VECTOR2I, "AXIS_Y", Vector2i::AXIS_Y); - _VariantCall::add_enum_constant(Variant::VECTOR2I, "Axis", "AXIS_X", Vector2i::AXIS_X); _VariantCall::add_enum_constant(Variant::VECTOR2I, "Axis", "AXIS_Y", Vector2i::AXIS_Y); @@ -2789,13 +2795,6 @@ static void _register_variant_builtin_constants() { _VariantCall::add_variant_constant(Variant::QUATERNION, "IDENTITY", Quaternion(0, 0, 0, 1)); - _VariantCall::add_constant(Variant::PROJECTION, "PLANE_NEAR", Projection::PLANE_NEAR); - _VariantCall::add_constant(Variant::PROJECTION, "PLANE_FAR", Projection::PLANE_FAR); - _VariantCall::add_constant(Variant::PROJECTION, "PLANE_LEFT", Projection::PLANE_LEFT); - _VariantCall::add_constant(Variant::PROJECTION, "PLANE_TOP", Projection::PLANE_TOP); - _VariantCall::add_constant(Variant::PROJECTION, "PLANE_RIGHT", Projection::PLANE_RIGHT); - _VariantCall::add_constant(Variant::PROJECTION, "PLANE_BOTTOM", Projection::PLANE_BOTTOM); - _VariantCall::add_enum_constant(Variant::PROJECTION, "Planes", "PLANE_NEAR", Projection::PLANE_NEAR); _VariantCall::add_enum_constant(Variant::PROJECTION, "Planes", "PLANE_FAR", Projection::PLANE_FAR); _VariantCall::add_enum_constant(Variant::PROJECTION, "Planes", "PLANE_LEFT", Projection::PLANE_LEFT); diff --git a/core/variant/variant_parser.cpp b/core/variant/variant_parser.cpp index f05b9cd83aba..bd0b0692b065 100644 --- a/core/variant/variant_parser.cpp +++ b/core/variant/variant_parser.cpp @@ -1961,7 +1961,7 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str case Variant::FLOAT: { String s = rtos_fix(p_variant.operator double()); if (s != "inf" && s != "inf_neg" && s != "nan") { - if (!s.contains(".") && !s.contains("e")) { + if (!s.contains_char('.') && !s.contains_char('e')) { s += ".0"; } } diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 1721134d085a..cc5c1e1e6829 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -370,7 +370,7 @@ Returns an "eased" value of [param x] based on an easing function defined with [param curve]. This easing function is based on an exponent. The [param curve] can be any floating-point number, with specific values leading to the following behaviors: [codeblock lang=text] - Lower than -1.0 (exclusive): Ease in-out - - 1.0: Linear + - -1.0: Linear - Between -1.0 and 0.0 (exclusive): Ease out-in - 0.0: Constant - Between 0.0 to 1.0 (exclusive): Ease out @@ -863,7 +863,6 @@ Converts one or more arguments of any type to string in the best way possible and prints them to the console. The following BBCode tags are supported: [code]b[/code], [code]i[/code], [code]u[/code], [code]s[/code], [code]indent[/code], [code]code[/code], [code]url[/code], [code]center[/code], [code]right[/code], [code]color[/code], [code]bgcolor[/code], [code]fgcolor[/code]. - Color tags only support the following named colors: [code]black[/code], [code]red[/code], [code]green[/code], [code]yellow[/code], [code]blue[/code], [code]magenta[/code], [code]pink[/code], [code]purple[/code], [code]cyan[/code], [code]white[/code], [code]orange[/code], [code]gray[/code]. Hexadecimal color codes are not supported. URL tags only support URLs wrapped by a URL tag, not URLs with a different title. When printing to standard output, the supported subset of BBCode is converted to ANSI escape codes for the terminal emulator to display. Support for ANSI escape codes varies across terminal emulators, especially for italic and strikethrough. In standard output, [code]code[/code] is represented with faint text but without any font change. Unsupported tags are left as-is in standard output. [codeblocks] @@ -2143,49 +2142,49 @@ Space key. - ! key. + Exclamation mark ([code]![/code]) key. - " key. + Double quotation mark ([code]"[/code]) key. - - # key. + + Number sign or [i]hash[/i] ([code]#[/code]) key. - $ key. + Dollar sign ([code]$[/code]) key. - % key. + Percent sign ([code]%[/code]) key. - & key. + Ampersand ([code]&[/code]) key. - ' key. + Apostrophe ([code]'[/code]) key. - - ( key. + + Left parenthesis ([code]([/code]) key. - - ) key. + + Right parenthesis ([code])[/code]) key. - * key. + Asterisk ([code]*[/code]) key. - + key. + Plus ([code]+[/code]) key. - , key. + Comma ([code],[/code]) key. - - - key. + + Minus ([code]-[/code]) key. - - . key. + + Period ([code].[/code]) key. - / key. + Slash ([code]/[/code]) key. Number 0 key. @@ -2218,25 +2217,25 @@ Number 9 key. - : key. + Colon ([code]:[/code]) key. - ; key. + Semicolon ([code];[/code]) key. - < key. + Less-than sign ([code]<[/code]) key. - = key. + Equal sign ([code]=[/code]) key. - > key. + Greater-than sign ([code]>[/code]) key. - ? key. + Question mark ([code]?[/code]) key. - - @ key. + + At sign ([code]@[/code]) key. A key. @@ -2316,41 +2315,41 @@ Z key. - - [ key. + + Left bracket ([code][lb][/code]) key. - \ key. + Backslash ([code]\[/code]) key. - - ] key. + + Right bracket ([code][rb][/code]) key. - - ^ key. + + Caret ([code]^[/code]) key. - - _ key. + + Underscore ([code]_[/code]) key. - - ` key. + + Backtick ([code]`[/code]) key. - - { key. + + Left brace ([code]{[/code]) key. - - | key. + + Vertical bar or [i]pipe[/i] ([code]|[/code]) key. - - } key. + + Right brace ([code]}[/code]) key. - ~ key. + Tilde ([code]~[/code]) key. - ¥ key. + Yen symbol ([code]¥[/code]) key. - - § key. + + Section sign ([code]§[/code]) key. Key Code mask. @@ -2941,7 +2940,10 @@ [/codeblock] [b]Note:[/b] A [Callable] cannot be properly serialized and stored in a file, so it is recommended to use [constant PROPERTY_USAGE_EDITOR] instead of [constant PROPERTY_USAGE_DEFAULT]. - + + Hints that a property will be changed on its own after setting, such as [member AudioStreamPlayer.playing] or [member GPUParticles3D.emitting]. + + Represents the size of the [enum PropertyHint] enum. diff --git a/doc/classes/AABB.xml b/doc/classes/AABB.xml index ae2de055cb04..57ac241eb229 100644 --- a/doc/classes/AABB.xml +++ b/doc/classes/AABB.xml @@ -345,14 +345,14 @@ - The ending point. This is usually the corner on the top-right and forward of the bounding box, and is equivalent to [code]position + size[/code]. Setting this point affects the [member size]. + The ending point. This is usually the corner on the top-right and back of the bounding box, and is equivalent to [code]position + size[/code]. Setting this point affects the [member size]. - The origin point. This is usually the corner on the bottom-left and back of the bounding box. + The origin point. This is usually the corner on the bottom-left and forward of the bounding box. The bounding box's width, height, and depth starting from [member position]. Setting this value also affects the [member end] point. - [b]Note:[/b] It's recommended setting the width, height, and depth to non-negative values. This is because most methods in Godot assume that the [member position] is the bottom-left-back corner, and the [member end] is the top-right-forward corner. To get an equivalent bounding box with non-negative size, use [method abs]. + [b]Note:[/b] It's recommended setting the width, height, and depth to non-negative values. This is because most methods in Godot assume that the [member position] is the bottom-left-forward corner, and the [member end] is the top-right-back corner. To get an equivalent bounding box with non-negative size, use [method abs]. diff --git a/doc/classes/AnimationLibrary.xml b/doc/classes/AnimationLibrary.xml index 7f87ea4616e7..51588a605261 100644 --- a/doc/classes/AnimationLibrary.xml +++ b/doc/classes/AnimationLibrary.xml @@ -31,6 +31,12 @@ Returns the keys for the [Animation]s stored in the library. + + + + Returns the key count for the [Animation]s stored in the library. + + diff --git a/doc/classes/AnimationMixer.xml b/doc/classes/AnimationMixer.xml index d762ffa5a65f..36cb675776a8 100644 --- a/doc/classes/AnimationMixer.xml +++ b/doc/classes/AnimationMixer.xml @@ -112,13 +112,13 @@ The most basic example is applying position to [CharacterBody3D]: [codeblocks] [gdscript] - var current_rotation: Quaternion + var current_rotation func _process(delta): if Input.is_action_just_pressed("animate"): current_rotation = get_quaternion() state_machine.travel("Animate") - var velocity: Vector3 = current_rotation * animation_tree.get_root_motion_position() / delta + var velocity = current_rotation * animation_tree.get_root_motion_position() / delta set_velocity(velocity) move_and_slide() [/gdscript] @@ -130,7 +130,20 @@ if Input.is_action_just_pressed("animate"): state_machine.travel("Animate") set_quaternion(get_quaternion() * animation_tree.get_root_motion_rotation()) - var velocity: Vector3 = (animation_tree.get_root_motion_rotation_accumulator().inverse() * get_quaternion()) * animation_tree.get_root_motion_position() / delta + var velocity = (animation_tree.get_root_motion_rotation_accumulator().inverse() * get_quaternion()) * animation_tree.get_root_motion_position() / delta + set_velocity(velocity) + move_and_slide() + [/gdscript] + [/codeblocks] + If [member root_motion_local] is [code]true[/code], return the pre-multiplied translation value with the inverted rotation. + In this case, the code can be written as follows: + [codeblocks] + [gdscript] + func _process(delta): + if Input.is_action_just_pressed("animate"): + state_machine.travel("Animate") + set_quaternion(get_quaternion() * animation_tree.get_root_motion_rotation()) + var velocity = get_quaternion() * animation_tree.get_root_motion_position() / delta set_velocity(velocity) move_and_slide() [/gdscript] @@ -145,13 +158,13 @@ For example, if an animation with only one key [code]Vector3(0, 0, 0)[/code] is played in the previous frame and then an animation with only one key [code]Vector3(1, 0, 1)[/code] is played in the next frame, the difference can be calculated as follows: [codeblocks] [gdscript] - var prev_root_motion_position_accumulator: Vector3 + var prev_root_motion_position_accumulator func _process(delta): if Input.is_action_just_pressed("animate"): state_machine.travel("Animate") - var current_root_motion_position_accumulator: Vector3 = animation_tree.get_root_motion_position_accumulator() - var difference: Vector3 = current_root_motion_position_accumulator - prev_root_motion_position_accumulator + var current_root_motion_position_accumulator = animation_tree.get_root_motion_position_accumulator() + var difference = current_root_motion_position_accumulator - prev_root_motion_position_accumulator prev_root_motion_position_accumulator = current_root_motion_position_accumulator transform.origin += difference [/gdscript] @@ -185,13 +198,13 @@ For example, if an animation with only one key [code]Quaternion(0, 0, 0, 1)[/code] is played in the previous frame and then an animation with only one key [code]Quaternion(0, 0.707, 0, 0.707)[/code] is played in the next frame, the difference can be calculated as follows: [codeblocks] [gdscript] - var prev_root_motion_rotation_accumulator: Quaternion + var prev_root_motion_rotation_accumulator func _process(delta): if Input.is_action_just_pressed("animate"): state_machine.travel("Animate") - var current_root_motion_rotation_accumulator: Quaternion = animation_tree.get_root_motion_rotation_accumulator() - var difference: Quaternion = prev_root_motion_rotation_accumulator.inverse() * current_root_motion_rotation_accumulator + var current_root_motion_rotation_accumulator = animation_tree.get_root_motion_rotation_accumulator() + var difference = prev_root_motion_rotation_accumulator.inverse() * current_root_motion_rotation_accumulator prev_root_motion_rotation_accumulator = current_root_motion_rotation_accumulator transform.basis *= Basis(difference) [/gdscript] @@ -208,8 +221,8 @@ The most basic example is applying scale to [CharacterBody3D]: [codeblocks] [gdscript] - var current_scale: Vector3 = Vector3(1, 1, 1) - var scale_accum: Vector3 = Vector3(1, 1, 1) + var current_scale = Vector3(1, 1, 1) + var scale_accum = Vector3(1, 1, 1) func _process(delta): if Input.is_action_just_pressed("animate"): @@ -229,13 +242,13 @@ For example, if an animation with only one key [code]Vector3(1, 1, 1)[/code] is played in the previous frame and then an animation with only one key [code]Vector3(2, 2, 2)[/code] is played in the next frame, the difference can be calculated as follows: [codeblocks] [gdscript] - var prev_root_motion_scale_accumulator: Vector3 + var prev_root_motion_scale_accumulator func _process(delta): if Input.is_action_just_pressed("animate"): state_machine.travel("Animate") - var current_root_motion_scale_accumulator: Vector3 = animation_tree.get_root_motion_scale_accumulator() - var difference: Vector3 = current_root_motion_scale_accumulator - prev_root_motion_scale_accumulator + var current_root_motion_scale_accumulator = animation_tree.get_root_motion_scale_accumulator() + var difference = current_root_motion_scale_accumulator - prev_root_motion_scale_accumulator prev_root_motion_scale_accumulator = current_root_motion_scale_accumulator transform.basis = transform.basis.scaled(difference) [/gdscript] @@ -304,6 +317,9 @@ This is used by the editor. If set to [code]true[/code], the scene will be saved with the effects of the reset animation (the animation with the key [code]"RESET"[/code]) applied as if it had been seeked to time 0, with the editor keeping the values that the scene had before saving. This makes it more convenient to preview and edit animations in the editor, as changes to the scene will not be saved as long as they are set in the reset animation. + + If [code]true[/code], [method get_root_motion_position] value is extracted as a local translation value before blending. In other words, it is treated like the translation is done after the rotation. + The path to the Animation track used for root motion. Paths must be valid scene-tree paths to a node, and must be specified starting from the parent node of the node that will reproduce the animation. The [member root_motion_track] uses the same format as [method Animation.track_set_path], but note that a bone must be specified. If the track has type [constant Animation.TYPE_POSITION_3D], [constant Animation.TYPE_ROTATION_3D], or [constant Animation.TYPE_SCALE_3D] the transformation will be canceled visually, and the animation will appear to stay in place. See also [method get_root_motion_position], [method get_root_motion_rotation], [method get_root_motion_scale], and [RootMotionView]. diff --git a/doc/classes/AnimationNodeOneShot.xml b/doc/classes/AnimationNodeOneShot.xml index b2a8002d7427..28bea47e2198 100644 --- a/doc/classes/AnimationNodeOneShot.xml +++ b/doc/classes/AnimationNodeOneShot.xml @@ -70,14 +70,14 @@ If [code]true[/code], breaks the loop at the end of the loop cycle for transition, even if the animation is looping. - Determines how cross-fading between animations is eased. If empty, the transition will be linear. + Determines how cross-fading between animations is eased. If empty, the transition will be linear. Should be a unit [Curve]. The fade-in duration. For example, setting this to [code]1.0[/code] for a 5 second length animation will produce a cross-fade that starts at 0 second and ends at 1 second during the animation. [b]Note:[/b] [AnimationNodeOneShot] transitions the current state after the end of the fading. When [AnimationNodeOutput] is considered as the most upstream, so the [member fadein_time] is scaled depending on the downstream delta. For example, if this value is set to [code]1.0[/code] and a [AnimationNodeTimeScale] with a value of [code]2.0[/code] is chained downstream, the actual processing time will be 0.5 second. - Determines how cross-fading between animations is eased. If empty, the transition will be linear. + Determines how cross-fading between animations is eased. If empty, the transition will be linear. Should be a unit [Curve]. The fade-out duration. For example, setting this to [code]1.0[/code] for a 5 second length animation will produce a cross-fade that starts at 4 second and ends at 5 second during the animation. diff --git a/doc/classes/AnimationNodeStateMachineTransition.xml b/doc/classes/AnimationNodeStateMachineTransition.xml index c729eeebbaea..d7dffa691624 100644 --- a/doc/classes/AnimationNodeStateMachineTransition.xml +++ b/doc/classes/AnimationNodeStateMachineTransition.xml @@ -41,7 +41,7 @@ The transition type. - Ease curve for better control over cross-fade between this state and the next. + Ease curve for better control over cross-fade between this state and the next. Should be a unit [Curve]. The time to cross-fade between this state and the next. diff --git a/doc/classes/AnimationNodeTimeSeek.xml b/doc/classes/AnimationNodeTimeSeek.xml index d00b3fca3ad1..865e94ec4308 100644 --- a/doc/classes/AnimationNodeTimeSeek.xml +++ b/doc/classes/AnimationNodeTimeSeek.xml @@ -30,4 +30,9 @@ $DOCS_URL/tutorials/animation/animation_tree.html + + + If [code]true[/code], some processes are executed to handle keys between seeks, such as calculating root motion and finding the nearest discrete key. + + diff --git a/doc/classes/AnimationNodeTransition.xml b/doc/classes/AnimationNodeTransition.xml index 382166d823ed..af80fef73a2c 100644 --- a/doc/classes/AnimationNodeTransition.xml +++ b/doc/classes/AnimationNodeTransition.xml @@ -96,7 +96,7 @@ The number of enabled input ports for this animation node. - Determines how cross-fading between animations is eased. If empty, the transition will be linear. + Determines how cross-fading between animations is eased. If empty, the transition will be linear. Should be a unit [Curve]. Cross-fading time (in seconds) between each animation connected to the inputs. diff --git a/doc/classes/AudioStream.xml b/doc/classes/AudioStream.xml index 44edff122e77..d11e070d89b3 100644 --- a/doc/classes/AudioStream.xml +++ b/doc/classes/AudioStream.xml @@ -48,7 +48,7 @@ - Override this method to customize the returned value of [method instantiate_playback]. Should returned a new [AudioStreamPlayback] created when the stream is played (such as by an [AudioStreamPlayer]).. + Override this method to customize the returned value of [method instantiate_playback]. Should return a new [AudioStreamPlayback] created when the stream is played (such as by an [AudioStreamPlayer]). diff --git a/doc/classes/AudioStreamPlayer.xml b/doc/classes/AudioStreamPlayer.xml index 93680de21e0f..900318e4f455 100644 --- a/doc/classes/AudioStreamPlayer.xml +++ b/doc/classes/AudioStreamPlayer.xml @@ -22,6 +22,7 @@ Returns the position in the [AudioStream] of the latest sound, in seconds. Returns [code]0.0[/code] if no sounds are playing. [b]Note:[/b] The position is not always accurate, as the [AudioServer] does not mix audio every processed frame. To get more accurate results, add [method AudioServer.get_time_since_last_mix] to the returned position. + [b]Note:[/b] This method always returns [code]0.0[/code] if the [member stream] is an [AudioStreamInteractive], since it can have multiple clips playing at once. diff --git a/doc/classes/AudioStreamWAV.xml b/doc/classes/AudioStreamWAV.xml index 8d882deaee2b..566109c0437e 100644 --- a/doc/classes/AudioStreamWAV.xml +++ b/doc/classes/AudioStreamWAV.xml @@ -11,6 +11,38 @@ $DOCS_URL/tutorials/io/runtime_file_loading_and_saving.html + + + + + + Creates a new [AudioStreamWAV] instance from the given buffer. The keys and values of [param options] match the properties of [ResourceImporterWAV]. + The usage of [param options] is identical to [method AudioStreamWAV.load_from_file]. + + + + + + + + Creates a new [AudioStreamWAV] instance from the given file path. The keys and values of [param options] match the properties of [ResourceImporterWAV]. + [b]Example:[/b] Load the first file dropped as a WAV and play it: + [codeblock] + @onready var audio_player = $AudioStreamPlayer + + func _ready(): + get_window().files_dropped.connect(_on_files_dropped) + + func _on_files_dropped(files): + if files[0].get_extension() == "wav": + audio_player.stream = AudioStreamWAV.load_from_file(files[0], { + "force/max_rate": true, + "force/max_rate_hz": 11025 + }) + audio_player.play() + [/codeblock] + + diff --git a/doc/classes/BaseMaterial3D.xml b/doc/classes/BaseMaterial3D.xml index b4a256c54f94..1fdbe5ce4c1b 100644 --- a/doc/classes/BaseMaterial3D.xml +++ b/doc/classes/BaseMaterial3D.xml @@ -88,7 +88,7 @@ The strength of the anisotropy effect. This is multiplied by [member anisotropy_flowmap]'s alpha channel if a texture is defined there and the texture contains an alpha channel. - If [code]true[/code], anisotropy is enabled. Anisotropy changes the shape of the specular blob and aligns it to tangent space. This is useful for brushed aluminium and hair reflections. + If [code]true[/code], anisotropy is enabled. Anisotropy changes the shape of the specular blob and aligns it to tangent space. This is useful for brushed aluminum and hair reflections. [b]Note:[/b] Mesh tangents are needed for anisotropy to work. If the mesh does not contain tangents, the anisotropy effect will appear broken. [b]Note:[/b] Material anisotropy should not to be confused with anisotropic texture filtering, which can be enabled by setting [member texture_filter] to [constant TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC]. @@ -125,7 +125,6 @@ Controls how the object faces the camera. See [enum BillboardMode]. - [b]Note:[/b] When billboarding is enabled and the material also casts shadows, billboards will face [b]the[/b] camera in the scene when rendering shadows. In scenes with multiple cameras, the intended shadow cannot be determined and this will result in undefined behavior. See [url=https://github.com/godotengine/godot/pull/72638]GitHub Pull Request #72638[/url] for details. [b]Note:[/b] Billboard mode is not suitable for VR because the left-right vector of the camera is not horizontal when the screen is attached to your head instead of on the table. See [url=https://github.com/godotengine/godot/issues/41567]GitHub issue #41567[/url] for details. diff --git a/doc/classes/Basis.xml b/doc/classes/Basis.xml index 59c1195b003b..b8823cf18858 100644 --- a/doc/classes/Basis.xml +++ b/doc/classes/Basis.xml @@ -6,7 +6,12 @@ The [Basis] built-in [Variant] type is a 3×3 [url=https://en.wikipedia.org/wiki/Matrix_(mathematics)]matrix[/url] used to represent 3D rotation, scale, and shear. It is frequently used within a [Transform3D]. A [Basis] is composed by 3 axis vectors, each representing a column of the matrix: [member x], [member y], and [member z]. The length of each axis ([method Vector3.length]) influences the basis's scale, while the direction of all axes influence the rotation. Usually, these axes are perpendicular to one another. However, when you rotate any axis individually, the basis becomes sheared. Applying a sheared basis to a 3D model will make the model appear distorted. - A [Basis] is [b]orthogonal[/b] if its axes are perpendicular to each other. A basis is [b]normalized[/b] if the length of every axis is [code]1[/code]. A basis is [b]uniform[/b] if all axes share the same length (see [method get_scale]). A basis is [b]orthonormal[/b] if it is both orthogonal and normalized, which allows it to only represent rotations. A basis is [b]conformal[/b] if it is both orthogonal and uniform, which ensures it is not distorted. + A [Basis] is: + - [b]Orthogonal[/b] if its axes are perpendicular to each other. + - [b]Normalized[/b] if the length of every axis is [code]1.0[/code]. + - [b]Uniform[/b] if all axes share the same length (see [method get_scale]). + - [b]Orthonormal[/b] if it is both orthogonal and normalized, which allows it to only represent rotations (see [method orthonormalized]). + - [b]Conformal[/b] if it is both orthogonal and uniform, which ensures it is not distorted. For a general introduction, see the [url=$DOCS_URL/tutorials/math/matrices_and_transforms.html]Matrices and transforms[/url] tutorial. [b]Note:[/b] Godot uses a [url=https://en.wikipedia.org/wiki/Right-hand_rule]right-handed coordinate system[/url], which is a common standard. For directions, the convention for built-in types like [Camera3D] is for -Z to point forward (+X is right, +Y is up, and +Z is back). Other objects may use different direction conventions. For more information, see the [url=$DOCS_URL/tutorials/assets_pipeline/importing_3d_scenes/model_export_considerations.html#d-asset-direction-conventions]3D asset direction conventions[/url] tutorial. [b]Note:[/b] The basis matrices are exposed as [url=https://www.mindcontrol.org/~hplus/graphics/matrix-layout.html]column-major[/url] order, which is the same as OpenGL. However, they are stored internally in row-major order, which is the same as DirectX. @@ -24,7 +29,7 @@ - Constructs a [Basis] identical to the [constant IDENTITY]. + Constructs a [Basis] identical to [constant IDENTITY]. [b]Note:[/b] In C#, this constructs a [Basis] with all of its components set to [constant Vector3.ZERO]. @@ -67,7 +72,7 @@ Returns the [url=https://en.wikipedia.org/wiki/Determinant]determinant[/url] of this basis's matrix. For advanced math, this number can be used to determine a few attributes: - - If the determinant is exactly [code]0[/code], the basis is not invertible (see [method inverse]). + - If the determinant is exactly [code]0.0[/code], the basis is not invertible (see [method inverse]). - If the determinant is a negative number, the basis represents a negative scale. [b]Note:[/b] If the basis's scale is the same for every axis, its determinant is always that scale by the power of 2. @@ -78,21 +83,21 @@ Constructs a new [Basis] that only represents rotation from the given [Vector3] of [url=https://en.wikipedia.org/wiki/Euler_angles]Euler angles[/url], in radians. - - The [member Vector3.x] should contain the angle around the [member x] axis (pitch). - - The [member Vector3.y] should contain the angle around the [member y] axis (yaw). + - The [member Vector3.x] should contain the angle around the [member x] axis (pitch); + - The [member Vector3.y] should contain the angle around the [member y] axis (yaw); - The [member Vector3.z] should contain the angle around the [member z] axis (roll). [codeblocks] [gdscript] # Creates a Basis whose z axis points down. var my_basis = Basis.from_euler(Vector3(TAU / 4, 0, 0)) - print(my_basis.z) # Prints (0, -1, 0). + print(my_basis.z) # Prints (0, -1, 0) [/gdscript] [csharp] // Creates a Basis whose z axis points down. var myBasis = Basis.FromEuler(new Vector3(Mathf.Tau / 4.0f, 0.0f, 0.0f)); - GD.Print(myBasis.Z); // Prints (0, -1, 0). + GD.Print(myBasis.Z); // Prints (0, -1, 0) [/csharp] [/codeblocks] The order of each consecutive rotation can be changed with [param order] (see [enum EulerOrder] constants). By default, the YXZ convention is used ([constant EULER_ORDER_YXZ]): the basis rotates first around the Y axis (yaw), then X (pitch), and lastly Z (roll). When using the opposite method [method get_euler], this order is reversed. @@ -107,16 +112,16 @@ [gdscript] var my_basis = Basis.from_scale(Vector3(2, 4, 8)) - print(my_basis.x) # Prints (2, 0, 0). - print(my_basis.y) # Prints (0, 4, 0). - print(my_basis.z) # Prints (0, 0, 8). + print(my_basis.x) # Prints (2, 0, 0) + print(my_basis.y) # Prints (0, 4, 0) + print(my_basis.z) # Prints (0, 0, 8) [/gdscript] [csharp] var myBasis = Basis.FromScale(new Vector3(2.0f, 4.0f, 8.0f)); - GD.Print(myBasis.X); // Prints (2, 0, 0). - GD.Print(myBasis.Y); // Prints (0, 4, 0). - GD.Print(myBasis.Z); // Prints (0, 0, 8). + GD.Print(myBasis.X); // Prints (2, 0, 0) + GD.Print(myBasis.Y); // Prints (0, 4, 0) + GD.Print(myBasis.Z); // Prints (0, 0, 8) [/csharp] [/codeblocks] [b]Note:[/b] In linear algebra, the matrix of this basis is also known as a [url=https://en.wikipedia.org/wiki/Diagonal_matrix]diagonal matrix[/url]. @@ -126,11 +131,12 @@ - Returns this basis's rotation as a [Vector3] of [url=https://en.wikipedia.org/wiki/Euler_angles]Euler angles[/url], in radians. + Returns this basis's rotation as a [Vector3] of [url=https://en.wikipedia.org/wiki/Euler_angles]Euler angles[/url], in radians. For the returned value: - The [member Vector3.x] contains the angle around the [member x] axis (pitch); - The [member Vector3.y] contains the angle around the [member y] axis (yaw); - The [member Vector3.z] contains the angle around the [member z] axis (roll). The order of each consecutive rotation can be changed with [param order] (see [enum EulerOrder] constants). By default, the YXZ convention is used ([constant EULER_ORDER_YXZ]): Z (roll) is calculated first, then X (pitch), and lastly Y (yaw). When using the opposite method [method from_euler], this order is reversed. + [b]Note:[/b] For this method to return correctly, the basis needs to be [i]orthonormal[/i] (see [method orthonormalized]). [b]Note:[/b] Euler angles are much more intuitive but are not suitable for 3D math. Because of this, consider using the [method get_rotation_quaternion] method instead, which returns a [Quaternion]. [b]Note:[/b] In the Inspector dock, a basis's rotation is often displayed in Euler angles (in degrees), as is the case with the [member Node3D.rotation] property. @@ -145,7 +151,7 @@ - Returns the length of each axis of this basis, as a [Vector3]. If the basis is not sheared, this is the scaling factor. It is not affected by rotation. + Returns the length of each axis of this basis, as a [Vector3]. If the basis is not sheared, this value is the scaling factor. It is not affected by rotation. [codeblocks] [gdscript] var my_basis = Basis( @@ -157,7 +163,7 @@ my_basis = my_basis.rotated(Vector3.UP, TAU / 2) my_basis = my_basis.rotated(Vector3.RIGHT, TAU / 4) - print(my_basis.get_scale()) # Prints (2, 4, 8). + print(my_basis.get_scale()) # Prints (2, 4, 8) [/gdscript] [csharp] var myBasis = new Basis( @@ -169,7 +175,7 @@ myBasis = myBasis.Rotated(Vector3.Up, Mathf.Tau / 2.0f); myBasis = myBasis.Rotated(Vector3.Right, Mathf.Tau / 4.0f); - GD.Print(myBasis.Scale); // Prints (2, 4, 8). + GD.Print(myBasis.Scale); // Prints (2, 4, 8) [/csharp] [/codeblocks] [b]Note:[/b] If the value returned by [method determinant] is negative, the scale is also negative. @@ -214,7 +220,7 @@ - Returns the orthonormalized version of this basis. An orthonormal basis is both [i]orthogonal[/i] (the axes are perpendicular to each other) and [i]normalized[/i] (the axes have a length of [code]1[/code]), which also means it can only represent rotation. + Returns the orthonormalized version of this basis. An orthonormal basis is both [i]orthogonal[/i] (the axes are perpendicular to each other) and [i]normalized[/i] (the axes have a length of [code]1.0[/code]), which also means it can only represent a rotation. It is often useful to call this method to avoid rounding errors on a rotating basis: [codeblocks] [gdscript] @@ -242,8 +248,8 @@ - Returns this basis rotated around the given [param axis] by [param angle] (in radians). The [param axis] must be a normalized vector (see [method Vector3.normalized]). - Positive values rotate this basis clockwise around the axis, while negative values rotate it counterclockwise. + Returns a copy of this basis rotated around the given [param axis] by the given [param angle] (in radians). + The [param axis] must be a normalized vector (see [method Vector3.normalized]). If [param angle] is positive, the basis is rotated counter-clockwise around the axis. [codeblocks] [gdscript] var my_basis = Basis.IDENTITY @@ -279,9 +285,9 @@ ) my_basis = my_basis.scaled(Vector3(0, 2, -2)) - print(my_basis.x) # Prints (0, 2, -2). - print(my_basis.y) # Prints (0, 4, -4). - print(my_basis.z) # Prints (0, 6, -6). + print(my_basis.x) # Prints (0, 2, -2) + print(my_basis.y) # Prints (0, 4, -4) + print(my_basis.z) # Prints (0, 6, -6) [/gdscript] [csharp] var myBasis = new Basis( @@ -291,9 +297,9 @@ ); myBasis = myBasis.Scaled(new Vector3(0.0f, 2.0f, -2.0f)); - GD.Print(myBasis.X); // Prints (0, 2, -2). - GD.Print(myBasis.Y); // Prints (0, 4, -4). - GD.Print(myBasis.Z); // Prints (0, 6, -6). + GD.Print(myBasis.X); // Prints (0, 2, -2) + GD.Print(myBasis.Y); // Prints (0, 4, -4) + GD.Print(myBasis.Z); // Prints (0, 6, -6) [/csharp] [/codeblocks] @@ -354,9 +360,9 @@ ) my_basis = my_basis.transposed() - print(my_basis.x) # Prints (1, 4, 7). - print(my_basis.y) # Prints (2, 5, 8). - print(my_basis.z) # Prints (3, 6, 9). + print(my_basis.x) # Prints (1, 4, 7) + print(my_basis.y) # Prints (2, 5, 8) + print(my_basis.z) # Prints (3, 6, 9) [/gdscript] [csharp] var myBasis = new Basis( @@ -366,9 +372,9 @@ ); myBasis = myBasis.Transposed(); - GD.Print(myBasis.X); // Prints (1, 4, 7). - GD.Print(myBasis.Y); // Prints (2, 5, 8). - GD.Print(myBasis.Z); // Prints (3, 6, 9). + GD.Print(myBasis.X); // Prints (1, 4, 7) + GD.Print(myBasis.Y); // Prints (2, 5, 8) + GD.Print(myBasis.Z); // Prints (3, 6, 9) [/csharp] [/codeblocks] @@ -390,23 +396,24 @@ - The identity basis. This is a basis with no rotation, no shear, and its scale being [code]1[/code]. This means that: + The identity [Basis]. This is an orthonormal basis with no rotation, no shear, and a scale of [constant Vector3.ONE]. This also means that: - The [member x] points right ([constant Vector3.RIGHT]); - The [member y] points up ([constant Vector3.UP]); - The [member z] points back ([constant Vector3.BACK]). [codeblock] - var basis := Basis.IDENTITY + var basis = Basis.IDENTITY print("| X | Y | Z") - print("| %s | %s | %s" % [basis.x.x, basis.y.x, basis.z.x]) - print("| %s | %s | %s" % [basis.x.y, basis.y.y, basis.z.y]) - print("| %s | %s | %s" % [basis.x.z, basis.y.z, basis.z.z]) + print("| %.f | %.f | %.f" % [basis.x.x, basis.y.x, basis.z.x]) + print("| %.f | %.f | %.f" % [basis.x.y, basis.y.y, basis.z.y]) + print("| %.f | %.f | %.f" % [basis.x.z, basis.y.z, basis.z.z]) # Prints: # | X | Y | Z # | 1 | 0 | 0 # | 0 | 1 | 0 # | 0 | 0 | 1 [/codeblock] - This is identical to creating [constructor Basis] without any parameters. This constant can be used to make your code clearer, and for consistency with C#. + If a [Vector3] or another [Basis] is transformed (multiplied) by this constant, no transformation occurs. + [b]Note:[/b] In GDScript, this constant is equivalent to creating a [constructor Basis] without any arguments. It can be used to make your code clearer, and for consistency with C#. When any basis is multiplied by [constant FLIP_X], it negates all components of the [member x] axis (the X column). diff --git a/doc/classes/CPUParticles2D.xml b/doc/classes/CPUParticles2D.xml index e8fa13fd0d25..be469080ed1d 100644 --- a/doc/classes/CPUParticles2D.xml +++ b/doc/classes/CPUParticles2D.xml @@ -57,7 +57,7 @@ - Sets the [Curve] of the parameter specified by [enum Parameter]. + Sets the [Curve] of the parameter specified by [enum Parameter]. Should be a unit [Curve]. @@ -90,7 +90,7 @@ Number of particles emitted in one emission cycle. - Each particle's rotation will be animated along this [Curve]. + Each particle's rotation will be animated along this [Curve]. Should be a unit [Curve]. Maximum initial rotation applied to each particle, in degrees. @@ -99,7 +99,7 @@ Minimum equivalent of [member angle_max]. - Each particle's angular velocity will vary along this [Curve]. + Each particle's angular velocity will vary along this [Curve]. Should be a unit [Curve]. Maximum initial angular velocity (rotation speed) applied to each particle in [i]degrees[/i] per second. @@ -108,7 +108,7 @@ Minimum equivalent of [member angular_velocity_max]. - Each particle's animation offset will vary along this [Curve]. + Each particle's animation offset will vary along this [Curve]. Should be a unit [Curve]. Maximum animation offset that corresponds to frame index in the texture. [code]0[/code] is the first frame, [code]1[/code] is the last one. See [member CanvasItemMaterial.particles_animation]. @@ -117,7 +117,7 @@ Minimum equivalent of [member anim_offset_max]. - Each particle's animation speed will vary along this [Curve]. + Each particle's animation speed will vary along this [Curve]. Should be a unit [Curve]. Maximum particle animation speed. Animation speed of [code]1[/code] means that the particles will make full [code]0[/code] to [code]1[/code] offset cycle during lifetime, [code]2[/code] means [code]2[/code] cycles etc. @@ -136,7 +136,7 @@ Each particle's color will vary along this [Gradient] (multiplied with [member color]). - Damping will vary along this [Curve]. + Damping will vary along this [Curve]. Should be a unit [Curve]. The maximum rate at which particles lose velocity. For example value of [code]100[/code] means that the particle will go from [code]100[/code] velocity to [code]0[/code] in [code]1[/code] second. @@ -184,7 +184,7 @@ Gravity applied to every particle. - Each particle's hue will vary along this [Curve]. + Each particle's hue will vary along this [Curve]. Should be a unit [Curve]. Maximum initial hue variation applied to each particle. It will shift the particle color's hue. @@ -205,7 +205,7 @@ Particle lifetime randomness ratio. - Each particle's linear acceleration will vary along this [Curve]. + Each particle's linear acceleration will vary along this [Curve]. Should be a unit [Curve]. Maximum linear acceleration applied to each particle in the direction of motion. @@ -220,7 +220,7 @@ If [code]true[/code], only one emission cycle occurs. If set [code]true[/code] during a cycle, emission will stop at the cycle's end. - Each particle's orbital velocity will vary along this [Curve]. + Each particle's orbital velocity will vary along this [Curve]. Should be a unit [Curve]. Maximum orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second. @@ -235,7 +235,7 @@ Particle system starts as if it had already run for this many seconds. - Each particle's radial acceleration will vary along this [Curve]. + Each particle's radial acceleration will vary along this [Curve]. Should be a unit [Curve]. Maximum radial acceleration applied to each particle. Makes particle accelerate away from the origin or towards it if negative. @@ -247,7 +247,7 @@ Emission lifetime randomness ratio. - Each particle's scale will vary along this [Curve]. + Each particle's scale will vary along this [Curve]. Should be a unit [Curve]. Maximum initial scale applied to each particle. @@ -256,11 +256,11 @@ Minimum equivalent of [member scale_amount_max]. - Each particle's horizontal scale will vary along this [Curve]. + Each particle's horizontal scale will vary along this [Curve]. Should be a unit [Curve]. [member split_scale] must be enabled. - Each particle's vertical scale will vary along this [Curve]. + Each particle's vertical scale will vary along this [Curve]. Should be a unit [Curve]. [member split_scale] must be enabled. @@ -273,7 +273,7 @@ Each particle's initial direction range from [code]+spread[/code] to [code]-spread[/code] degrees. - Each particle's tangential acceleration will vary along this [Curve]. + Each particle's tangential acceleration will vary along this [Curve]. Should be a unit [Curve]. Maximum tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. diff --git a/doc/classes/CPUParticles3D.xml b/doc/classes/CPUParticles3D.xml index 04ee95457c40..805299556a83 100644 --- a/doc/classes/CPUParticles3D.xml +++ b/doc/classes/CPUParticles3D.xml @@ -63,7 +63,7 @@ - Sets the [Curve] of the parameter specified by [enum Parameter]. + Sets the [Curve] of the parameter specified by [enum Parameter]. Should be a unit [Curve]. @@ -96,7 +96,7 @@ Number of particles emitted in one emission cycle. - Each particle's rotation will be animated along this [Curve]. + Each particle's rotation will be animated along this [Curve]. Should be a unit [Curve]. Maximum angle. @@ -105,7 +105,7 @@ Minimum angle. - Each particle's angular velocity (rotation speed) will vary along this [Curve] over its lifetime. + Each particle's angular velocity (rotation speed) will vary along this [Curve] over its lifetime. Should be a unit [Curve]. Maximum initial angular velocity (rotation speed) applied to each particle in [i]degrees[/i] per second. @@ -114,7 +114,7 @@ Minimum initial angular velocity (rotation speed) applied to each particle in [i]degrees[/i] per second. - Each particle's animation offset will vary along this [Curve]. + Each particle's animation offset will vary along this [Curve]. Should be a unit [Curve]. Maximum animation offset. @@ -123,7 +123,7 @@ Minimum animation offset. - Each particle's animation speed will vary along this [Curve]. + Each particle's animation speed will vary along this [Curve]. Should be a unit [Curve]. Maximum particle animation speed. @@ -144,7 +144,7 @@ [b]Note:[/b] [member color_ramp] multiplies the particle mesh's vertex colors. To have a visible effect on a [BaseMaterial3D], [member BaseMaterial3D.vertex_color_use_as_albedo] [i]must[/i] be [code]true[/code]. For a [ShaderMaterial], [code]ALBEDO *= COLOR.rgb;[/code] must be inserted in the shader's [code]fragment()[/code] function. Otherwise, [member color_ramp] will have no visible effect. - Damping will vary along this [Curve]. + Damping will vary along this [Curve]. Should be a unit [Curve]. Maximum damping. @@ -212,7 +212,7 @@ Gravity applied to every particle. - Each particle's hue will vary along this [Curve]. + Each particle's hue will vary along this [Curve]. Should be a unit [Curve]. Maximum hue variation. @@ -233,7 +233,7 @@ Particle lifetime randomness ratio. - Each particle's linear acceleration will vary along this [Curve]. + Each particle's linear acceleration will vary along this [Curve]. Should be a unit [Curve]. Maximum linear acceleration. @@ -251,7 +251,7 @@ If [code]true[/code], only one emission cycle occurs. If set [code]true[/code] during a cycle, emission will stop at the cycle's end. - Each particle's orbital velocity will vary along this [Curve]. + Each particle's orbital velocity will vary along this [Curve]. Should be a unit [Curve]. Maximum orbit velocity. @@ -272,7 +272,7 @@ Particle system starts as if it had already run for this many seconds. - Each particle's radial acceleration will vary along this [Curve]. + Each particle's radial acceleration will vary along this [Curve]. Should be a unit [Curve]. Maximum radial acceleration. @@ -284,7 +284,7 @@ Emission lifetime randomness ratio. - Each particle's scale will vary along this [Curve]. + Each particle's scale will vary along this [Curve]. Should be a unit [Curve]. Maximum scale. @@ -311,7 +311,7 @@ Each particle's initial direction range from [code]+spread[/code] to [code]-spread[/code] degrees. Applied to X/Z plane and Y/Z planes. - Each particle's tangential acceleration will vary along this [Curve]. + Each particle's tangential acceleration will vary along this [Curve]. Should be a unit [Curve]. Maximum tangent acceleration. diff --git a/doc/classes/CanvasLayer.xml b/doc/classes/CanvasLayer.xml index 597ec7808998..e542eb7aee44 100644 --- a/doc/classes/CanvasLayer.xml +++ b/doc/classes/CanvasLayer.xml @@ -45,8 +45,8 @@ The custom [Viewport] node assigned to the [CanvasLayer]. If [code]null[/code], uses the default viewport instead. - If enabled, the [CanvasLayer] will use the viewport's transform, so it will move when camera moves instead of being anchored in a fixed position on the screen. - Together with [member follow_viewport_scale] it can be used for a pseudo 3D effect. + If enabled, the [CanvasLayer] stays in a fixed position on the screen. If disabled, the [CanvasLayer] maintains its position in world space. + Together with [member follow_viewport_scale], this can be used for a pseudo-3D effect. Scales the layer when using [member follow_viewport_enabled]. Layers moving into the foreground should have increasing scales, while layers moving into the background should have decreasing scales. diff --git a/doc/classes/CollisionShape3D.xml b/doc/classes/CollisionShape3D.xml index a4e0ed0b2829..69a7dd2b3664 100644 --- a/doc/classes/CollisionShape3D.xml +++ b/doc/classes/CollisionShape3D.xml @@ -29,6 +29,12 @@ + + The collision shape color that is displayed in the editor, or in the running project if [b]Debug > Visible Collision Shapes[/b] is checked at the top of the editor. If this is reset to its default value of [code]Color(0, 0, 0, 0)[/code], the value of [member ProjectSettings.debug/shapes/collision/shape_color] will be used instead. + + + If [code]true[/code], when the shape is displayed, it will show a solid fill color in addition to its wireframe. + A disabled collision shape has no effect in the world. diff --git a/doc/classes/ColorPalette.xml b/doc/classes/ColorPalette.xml new file mode 100644 index 000000000000..045d01370b09 --- /dev/null +++ b/doc/classes/ColorPalette.xml @@ -0,0 +1,16 @@ + + + + A resource class for managing a palette of colors, which can be loaded and saved using [ColorPicker]. + + + The [ColorPalette] resource is designed to store and manage a collection of colors. This resource is useful in scenarios where a predefined set of colors is required, such as for creating themes, designing user interfaces, or managing game assets. The built-in [ColorPicker] control can also make use of [ColorPalette] without additional code. + + + + + + A [PackedColorArray] containing the colors in the palette. + + + diff --git a/doc/classes/ColorPicker.xml b/doc/classes/ColorPicker.xml index cf26f917e13e..a11284a8449f 100644 --- a/doc/classes/ColorPicker.xml +++ b/doc/classes/ColorPicker.xml @@ -177,6 +177,9 @@ The icon for color preset drop down menu when folded. + + The icon for color preset option menu. + The indicator used to signalize that the color value is outside the 0-1 range. diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index 342e20759e77..451f399d2c49 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -6,13 +6,14 @@ Base class for all UI-related nodes. [Control] features a bounding rectangle that defines its extents, an anchor position relative to its parent control or the current viewport, and offsets relative to the anchor. The offsets update automatically when the node, any of its parents, or the screen size change. For more information on Godot's UI system, anchors, offsets, and containers, see the related tutorials in the manual. To build flexible UIs, you'll need a mix of UI elements that inherit from [Control] and [Container] nodes. + [b]Note:[/b] Since both [Node2D] and [Control] inherit from [CanvasItem], they share several concepts from the class such as the [member CanvasItem.z_index] and [member CanvasItem.visible] properties. [b]User Interface nodes and input[/b] Godot propagates input events via viewports. Each [Viewport] is responsible for propagating [InputEvent]s to their child nodes. As the [member SceneTree.root] is a [Window], this already happens automatically for all UI elements in your game. Input events are propagated through the [SceneTree] from the root node to all child nodes by calling [method Node._input]. For UI elements specifically, it makes more sense to override the virtual method [method _gui_input], which filters out unrelated input events, such as by checking z-order, [member mouse_filter], focus, or if the event was inside of the control's bounding box. Call [method accept_event] so no other node receives the event. Once you accept an input, it becomes handled so [method Node._unhandled_input] will not process it. Only one [Control] node can be in focus. Only the node in focus will receive events. To get the focus, call [method grab_focus]. [Control] nodes lose focus when another node grabs it, or if you hide the node in focus. Sets [member mouse_filter] to [constant MOUSE_FILTER_IGNORE] to tell a [Control] node to ignore mouse or touch events. You'll need it if you place an icon on top of a button. - [Theme] resources change the Control's appearance. If you change the [Theme] on a [Control] node, it affects all of its children. To override some of the theme's parameters, call one of the [code]add_theme_*_override[/code] methods, like [method add_theme_font_override]. You can override the theme with the Inspector. + [Theme] resources change the control's appearance. The [member theme] of a [Control] node affects all of its direct and indirect children (as long as a chain of controls is uninterrupted). To override some of the theme items, call one of the [code]add_theme_*_override[/code] methods, like [method add_theme_font_override]. You can also override theme items in the Inspector. [b]Note:[/b] Theme items are [i]not[/i] [Object] properties. This means you can't access their values using [method Object.get] and [method Object.set]. Instead, use the [code]get_theme_*[/code] and [code]add_theme_*_override[/code] methods provided by this class. @@ -113,7 +114,7 @@ Virtual method to be implemented by the user. Returns the tooltip text for the position [param at_position] in control's local coordinates, which will typically appear when the cursor is resting over this control. See [method get_tooltip]. - [b]Note:[/b] If this method returns an empty [String], no tooltip is displayed. + [b]Note:[/b] If this method returns an empty [String] and [method _make_custom_tooltip] is not overridden, no tooltip is displayed. @@ -164,11 +165,12 @@ - Virtual method to be implemented by the user. Returns a [Control] node that should be used as a tooltip instead of the default one. The [param for_text] includes the contents of the [member tooltip_text] property. + Virtual method to be implemented by the user. Returns a [Control] node that should be used as a tooltip instead of the default one. [param for_text] is the return value of [method get_tooltip]. The returned node must be of type [Control] or Control-derived. It can have child nodes of any type. It is freed when the tooltip disappears, so make sure you always provide a new instance (if you want to use a pre-existing node from your scene tree, you can duplicate it and pass the duplicated instance). When [code]null[/code] or a non-Control node is returned, the default tooltip will be used instead. The returned node will be added as child to a [PopupPanel], so you should only provide the contents of that panel. That [PopupPanel] can be themed using [method Theme.set_stylebox] for the type [code]"TooltipPanel"[/code] (see [member tooltip_text] for an example). [b]Note:[/b] The tooltip is shrunk to minimal size. If you want to ensure it's fully visible, you might want to set its [member custom_minimum_size] to some non-zero value. [b]Note:[/b] The node (and any relevant children) should have their [member CanvasItem.visible] set to [code]true[/code] when returned, otherwise, the viewport that instantiates it will not be able to calculate its minimum size reliably. + [b]Note:[/b] If overridden, this method is called even if [method get_tooltip] returns an empty string. When this happens with the default tooltip, it is not displayed. To copy this behavior, return [code]null[/code] in this method when [param for_text] is empty. [b]Example:[/b] Use a constructed node as a tooltip: [codeblocks] [gdscript] @@ -553,7 +555,7 @@ Returns the tooltip text for the position [param at_position] in control's local coordinates, which will typically appear when the cursor is resting over this control. By default, it returns [member tooltip_text]. This method can be overridden to customize its behavior. See [method _get_tooltip]. - [b]Note:[/b] If this method returns an empty [String], no tooltip is displayed. + [b]Note:[/b] If this method returns an empty [String] and [method _make_custom_tooltip] is not overridden, no tooltip is displayed. @@ -1065,7 +1067,8 @@ [b]Note:[/b] Tooltips customized using [method _make_custom_tooltip] do not use this auto translate mode automatically. - The default tooltip text. The tooltip appears when the user's mouse cursor stays idle over this control for a few moments, provided that the [member mouse_filter] property is not [constant MOUSE_FILTER_IGNORE]. The time required for the tooltip to appear can be changed with the [member ProjectSettings.gui/timers/tooltip_delay_sec] option. See also [method get_tooltip]. + The default tooltip text. The tooltip appears when the user's mouse cursor stays idle over this control for a few moments, provided that the [member mouse_filter] property is not [constant MOUSE_FILTER_IGNORE]. The time required for the tooltip to appear can be changed with the [member ProjectSettings.gui/timers/tooltip_delay_sec] setting. + This string is the default return value of [method get_tooltip]. Override [method _get_tooltip] to generate tooltip text dynamically. Override [method _make_custom_tooltip] to customize the tooltip interface and behavior. The tooltip popup will use either a default implementation, or a custom one that you can provide by overriding [method _make_custom_tooltip]. The default tooltip includes a [PopupPanel] and [Label] whose theme properties can be customized using [Theme] methods with the [code]"TooltipPanel"[/code] and [code]"TooltipLabel"[/code] respectively. For example: [codeblocks] [gdscript] diff --git a/doc/classes/CubemapArray.xml b/doc/classes/CubemapArray.xml index 6e5e466fcf98..eae391edacb3 100644 --- a/doc/classes/CubemapArray.xml +++ b/doc/classes/CubemapArray.xml @@ -7,7 +7,7 @@ [CubemapArray]s are made of an array of [Cubemap]s. Like [Cubemap]s, they are made of multiple textures, the amount of which must be divisible by 6 (one for each face of the cube). The primary benefit of [CubemapArray]s is that they can be accessed in shader code using a single texture reference. In other words, you can pass multiple [Cubemap]s into a shader using a single [CubemapArray]. [Cubemap]s are allocated in adjacent cache regions on the GPU, which makes [CubemapArray]s the most efficient way to store multiple [Cubemap]s. [b]Note:[/b] Godot uses [CubemapArray]s internally for many effects, including the [Sky] if you set [member ProjectSettings.rendering/reflections/sky_reflections/texture_array_reflections] to [code]true[/code]. To create such a texture file yourself, reimport your image files using the import presets of the File System dock. - [b]Note:[/b] [CubemapArray] is not supported in the OpenGL 3 rendering backend. + [b]Note:[/b] [CubemapArray] is not supported in the Compatibility renderer. diff --git a/doc/classes/Curve.xml b/doc/classes/Curve.xml index 25b06f106381..5246e0ba6707 100644 --- a/doc/classes/Curve.xml +++ b/doc/classes/Curve.xml @@ -4,8 +4,8 @@ A mathematical curve. - This resource describes a mathematical curve by defining a set of points and tangents at each point. By default, it ranges between [code]0[/code] and [code]1[/code] on the Y axis and positions points relative to the [code]0.5[/code] Y position. - See also [Gradient] which is designed for color interpolation. See also [Curve2D] and [Curve3D]. + This resource describes a mathematical curve by defining a set of points and tangents at each point. By default, it ranges between [code]0[/code] and [code]1[/code] on the X and Y axes, but these ranges can be changed. + Please note that many resources and nodes assume they are given [i]unit curves[/i]. A unit curve is a curve whose domain (the X axis) is between [code]0[/code] and [code]1[/code]. Some examples of unit curve usage are [member CPUParticles2D.angle_curve] and [member Line2D.width_curve]. @@ -39,6 +39,12 @@ Removes all points from the curve. + + + + Returns the difference between [member min_domain] and [member max_domain]. + + @@ -74,6 +80,12 @@ Returns the right tangent angle (in degrees) for the point at [param index]. + + + + Returns the difference between [member min_value] and [member max_value]. + + @@ -148,17 +160,28 @@ The number of points to include in the baked (i.e. cached) curve data. + + The maximum domain (x-coordinate) that points can have. + - The maximum value the curve can reach. + The maximum value (y-coordinate) that points can have. Tangents can cause higher values between points. + + + The minimum domain (x-coordinate) that points can have. - The minimum value the curve can reach. + The minimum value (y-coordinate) that points can have. Tangents can cause lower values between points. The number of points describing the curve. + + + Emitted when [member max_domain] or [member min_domain] is changed. + + Emitted when [member max_value] or [member min_value] is changed. diff --git a/doc/classes/CurveTexture.xml b/doc/classes/CurveTexture.xml index 8cb2384da3b4..ed4a2f2d3570 100644 --- a/doc/classes/CurveTexture.xml +++ b/doc/classes/CurveTexture.xml @@ -4,14 +4,14 @@ A 1D texture where pixel brightness corresponds to points on a curve. - A 1D texture where pixel brightness corresponds to points on a [Curve] resource, either in grayscale or in red. This visual representation simplifies the task of saving curves as image files. + A 1D texture where pixel brightness corresponds to points on a unit [Curve] resource, either in grayscale or in red. This visual representation simplifies the task of saving curves as image files. If you need to store up to 3 curves within a single texture, use [CurveXYZTexture] instead. See also [GradientTexture1D] and [GradientTexture2D]. - The [Curve] that is rendered onto the texture. + The [Curve] that is rendered onto the texture. Should be a unit [Curve]. diff --git a/doc/classes/CurveXYZTexture.xml b/doc/classes/CurveXYZTexture.xml index 8353ed909200..472ce7bb99ad 100644 --- a/doc/classes/CurveXYZTexture.xml +++ b/doc/classes/CurveXYZTexture.xml @@ -4,20 +4,20 @@ A 1D texture where the red, green, and blue color channels correspond to points on 3 curves. - A 1D texture where the red, green, and blue color channels correspond to points on 3 [Curve] resources. Compared to using separate [CurveTexture]s, this further simplifies the task of saving curves as image files. + A 1D texture where the red, green, and blue color channels correspond to points on 3 unit [Curve] resources. Compared to using separate [CurveTexture]s, this further simplifies the task of saving curves as image files. If you only need to store one curve within a single texture, use [CurveTexture] instead. See also [GradientTexture1D] and [GradientTexture2D]. - The [Curve] that is rendered onto the texture's red channel. + The [Curve] that is rendered onto the texture's red channel. Should be a unit [Curve]. - The [Curve] that is rendered onto the texture's green channel. + The [Curve] that is rendered onto the texture's green channel. Should be a unit [Curve]. - The [Curve] that is rendered onto the texture's blue channel. + The [Curve] that is rendered onto the texture's blue channel. Should be a unit [Curve]. diff --git a/doc/classes/DTLSServer.xml b/doc/classes/DTLSServer.xml index 41e241779a9b..5b6264671818 100644 --- a/doc/classes/DTLSServer.xml +++ b/doc/classes/DTLSServer.xml @@ -11,8 +11,8 @@ # server_node.gd extends Node - var dtls := DTLSServer.new() - var server := UDPServer.new() + var dtls = DTLSServer.new() + var server = UDPServer.new() var peers = [] func _ready(): @@ -90,8 +90,8 @@ # client_node.gd extends Node - var dtls := PacketPeerDTLS.new() - var udp := PacketPeerUDP.new() + var dtls = PacketPeerDTLS.new() + var udp = PacketPeerUDP.new() var connected = false func _ready(): diff --git a/doc/classes/DirAccess.xml b/doc/classes/DirAccess.xml index 0f5844fd6356..cee4d1fe7ac6 100644 --- a/doc/classes/DirAccess.xml +++ b/doc/classes/DirAccess.xml @@ -105,6 +105,17 @@ [b]Note:[/b] This method is implemented on macOS, Linux, and Windows. + + + + + + Creates a temporary directory. This directory will be freed when the returned [DirAccess] is freed. + If [param prefix] is not empty, it will be prefixed to the directory name, separated by a [code]-[/code]. + If [param keep] is [code]true[/code], the directory is not deleted when the returned [DirAccess] is freed. + Returns [code]null[/code] if opening the directory failed. You can use [method get_open_error] to check the error that occurred. + + @@ -221,6 +232,14 @@ Returns the available space on the current directory's disk, in bytes. Returns [code]0[/code] if the platform-specific method to query the available space fails. + + + + + Returns [code]true[/code] if the directory is a macOS bundle. + [b]Note:[/b] This method is implemented on macOS. + + diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml index e2a352de9ac4..fea38aad55c8 100644 --- a/doc/classes/DisplayServer.xml +++ b/doc/classes/DisplayServer.xml @@ -10,6 +10,13 @@ + + + + Plays the beep sound from the operative system, if possible. Because it comes from the OS, the beep sound will be audible even if the application is muted. It may also be disabled for the entire OS by the user. + [b]Note:[/b] This method is implemented on macOS, Linux (X11/Wayland), and Windows. + + @@ -1135,7 +1142,7 @@ Returns the scale factor of the specified screen by index. [b]Note:[/b] On macOS, the returned value is [code]2.0[/code] for hiDPI (Retina) screens, and [code]1.0[/code] for all other cases. [b]Note:[/b] On Linux (Wayland), the returned value is accurate only when [param screen] is [constant SCREEN_OF_MAIN_WINDOW]. Due to API limitations, passing a direct index will return a rounded-up integer, if the screen has a fractional scale (e.g. [code]1.25[/code] would get rounded up to [code]2.0[/code]). - [b]Note:[/b] This method is implemented only on macOS and Linux (Wayland). + [b]Note:[/b] This method is implemented on Android, iOS, Web, macOS, and Linux (Wayland). @@ -1815,6 +1822,14 @@ [b]Warning:[/b] Advanced users only! Adding such a callback to a [Window] node will override its default implementation, which can introduce bugs. + + + + + Starts a drag operation on the window with the given [param window_id], using the current mouse position. Call this method when handling a mouse button being pressed to simulate a pressed event on the window's title bar. Using this method allows the window to participate in space switching, tiling, and other system features. + [b]Note:[/b] This method is implemented only on macOS. + + @@ -1895,6 +1910,9 @@ The display server supports all features of [constant FEATURE_NATIVE_DIALOG_FILE], with the added functionality of Options and native dialog file access to [code]res://[/code] and [code]user://[/code] paths. See [method file_dialog_show] and [method file_dialog_with_options_show]. [b]Windows, macOS, Linux (X11/Wayland)[/b] + + The display server supports initiating window drag operation on demand. See [method window_start_drag]. + Makes the mouse cursor visible if it is hidden. @@ -2170,12 +2188,12 @@ Window view: - - Windows: [code]HDC[/code] for the window (only with the GL Compatibility renderer). + - Windows: [code]HDC[/code] for the window (only with the Compatibility renderer). - macOS: [code]NSView*[/code] for the window main view. - iOS: [code]UIView*[/code] for the window main view. - OpenGL context (only with the GL Compatibility renderer): + OpenGL context (only with the Compatibility renderer): - Windows: [code]HGLRC[/code] for the window (native GL), or [code]EGLContext[/code] for the window (ANGLE). - Linux (X11): [code]GLXContext*[/code] for the window. - Linux (Wayland): [code]EGLContext[/code] for the window. diff --git a/doc/classes/EditorExportPlatform.xml b/doc/classes/EditorExportPlatform.xml index 8792bbedc34d..250a03f895f9 100644 --- a/doc/classes/EditorExportPlatform.xml +++ b/doc/classes/EditorExportPlatform.xml @@ -125,6 +125,12 @@ Returns array of core file names that always should be exported regardless of preset config. + + + + Returns additional files that should always be exported regardless of preset configuration, and are not part of the project source. The returned [Dictionary] contains filename keys ([String]) and their corresponding raw data ([PackedByteArray]). + + diff --git a/doc/classes/EditorFileDialog.xml b/doc/classes/EditorFileDialog.xml index d5c2ed55d755..f2a87a03169f 100644 --- a/doc/classes/EditorFileDialog.xml +++ b/doc/classes/EditorFileDialog.xml @@ -37,10 +37,22 @@ Adds the given [param menu] to the side of the file dialog with the given [param title] text on top. Only one side menu is allowed. + + + + Clear the filter for file names. + + - Removes all filters except for "All Files (*)". + Removes all filters except for "All Files (*.*)". + + + + + + Returns the value of the filter for file names. @@ -96,6 +108,13 @@ Shows the [EditorFileDialog] at the default size and position for file dialogs in the editor, and selects the file name if there is a current file. + + + + + Sets the value of the filter for file names. + + @@ -168,6 +187,12 @@ Emitted when a file is selected. + + + + Emitted when the filter for file names changes. + + diff --git a/doc/classes/EditorInspector.xml b/doc/classes/EditorInspector.xml index 6b25be490eda..8c7e935dd23b 100644 --- a/doc/classes/EditorInspector.xml +++ b/doc/classes/EditorInspector.xml @@ -26,8 +26,23 @@ Gets the path of the currently selected property. + + + + + + + + + + + Creates a property editor that can be used by plugin UI to edit the specified property of an [param object]. + + + + diff --git a/doc/classes/EditorProperty.xml b/doc/classes/EditorProperty.xml index 4ff541f72dfa..2a9e4088a6b5 100644 --- a/doc/classes/EditorProperty.xml +++ b/doc/classes/EditorProperty.xml @@ -29,6 +29,12 @@ If any of the controls added can gain keyboard focus, add it here. This ensures that focus will be restored if the inspector is refreshed. + + + + Draw property as not selected. Used by the inspector. + + @@ -51,6 +57,19 @@ Gets the edited property. If your editor is for a single property (added via [method EditorInspectorPlugin._parse_property]), then this will return the property. + + + + Returns [code]true[/code] if property is drawn as selected. Used by the inspector. + + + + + + + Draw property as selected. Used by the inspector. + + @@ -58,6 +77,21 @@ Puts the [param editor] control below the property label. The control must be previously added using [method Node.add_child]. + + + + + Used by the inspector, set to a control that will be used as a reference to calculate the size of the label. + + + + + + + + Assigns object and property to edit. + + @@ -84,9 +118,18 @@ Set this property to change the label (if you want to show one). + + Space distribution ratio between the label and the editing field. + Used by the inspector, set to [code]true[/code] when the property is read-only. + + Used by the inspector, set to [code]true[/code] when the property is selectable. + + + Used by the inspector, set to [code]true[/code] when the property is using folding. + diff --git a/doc/classes/EditorSettings.xml b/doc/classes/EditorSettings.xml index ea987da6f5fc..7a17df2c9e2b 100644 --- a/doc/classes/EditorSettings.xml +++ b/doc/classes/EditorSettings.xml @@ -188,6 +188,9 @@ If [code]true[/code], automatically switches to the [b]Remote[/b] scene tree when running the project from the editor. If [code]false[/code], stays on the [b]Local[/b] scene tree when running the project from the editor. [b]Warning:[/b] Enabling this setting can cause stuttering when running a project with a large amount of nodes (typically a few thousands of nodes or more), even if the editor window isn't focused. This is due to the remote scene tree being updated every second regardless of whether the editor is focused. + + If [code]true[/code], automatically switches to the [b]Stack Trace[/b] panel when the debugger hits a breakpoint or steps. + If [code]true[/code], enables collection of profiling data from non-GDScript Godot functions, such as engine class methods. Enabling this slows execution while profiling further. @@ -395,6 +398,9 @@ The inertia to use when panning in the 3D editor. Higher values make the camera start and stop slower, which looks smoother but adds latency. + + The mouse sensitivity to use when panning in the 3D editor. + The inertia to use when zooming in the 3D editor. Higher values make the camera start and stop slower, which looks smoother but adds latency. @@ -1031,7 +1037,7 @@ If [code]true[/code], set accent color based on system settings. - [b]Note:[/b] This setting is only effective on Windows and MacOS. + [b]Note:[/b] This setting is only effective on Windows, MacOS, and Android. If [code]true[/code], long press on touchscreen is treated as right click. diff --git a/doc/classes/Engine.xml b/doc/classes/Engine.xml index bba515705384..3ae375393077 100644 --- a/doc/classes/Engine.xml +++ b/doc/classes/Engine.xml @@ -13,21 +13,7 @@ Returns the name of the CPU architecture the Godot binary was built for. Possible return values include [code]"x86_64"[/code], [code]"x86_32"[/code], [code]"arm64"[/code], [code]"arm32"[/code], [code]"rv64"[/code], [code]"riscv"[/code], [code]"ppc64"[/code], [code]"ppc"[/code], [code]"wasm64"[/code], and [code]"wasm32"[/code]. - To detect whether the current build is 64-bit, you can use the fact that all 64-bit architecture names contain [code]64[/code] in their name: - [codeblocks] - [gdscript] - if "64" in Engine.get_architecture_name(): - print("Running a 64-bit build of Godot.") - else: - print("Running a 32-bit build of Godot.") - [/gdscript] - [csharp] - if (Engine.GetArchitectureName().Contains("64")) - GD.Print("Running a 64-bit build of Godot."); - else - GD.Print("Running a 32-bit build of Godot."); - [/csharp] - [/codeblocks] + To detect whether the current build is 64-bit, or the type of architecture, don't use the architecture name. Instead, use [method OS.has_feature] to check for the [code]"64"[/code] feature tag, or tags such as [code]"x86"[/code] or [code]"arm"[/code]. See the [url=$DOCS_URL/tutorials/export/feature_tags.html]Feature Tags[/url] documentation for more details. [b]Note:[/b] This method does [i]not[/i] return the name of the system's CPU architecture (like [method OS.get_processor_name]). For example, when running an [code]x86_32[/code] Godot binary on an [code]x86_64[/code] system, the returned value will still be [code]"x86_32"[/code]. diff --git a/doc/classes/FileAccess.xml b/doc/classes/FileAccess.xml index d7ca8afc2cef..a2ee5a132304 100644 --- a/doc/classes/FileAccess.xml +++ b/doc/classes/FileAccess.xml @@ -50,6 +50,20 @@ [b]Note:[/b] [FileAccess] will automatically close when it's freed, which happens when it goes out of scope or when it gets assigned with [code]null[/code]. In C# the reference must be disposed after we are done using it, this can be done with the [code]using[/code] statement or calling the [code]Dispose[/code] method directly. + + + + + + + + Creates a temporary file. This file will be freed when the returned [FileAccess] is freed. + If [param prefix] is not empty, it will be prefixed to the file name, separated by a [code]-[/code]. + If [param extension] is not empty, it will be appended to the temporary file name. + If [param keep] is [code]true[/code], the file is not deleted when the returned [FileAccess] is freed. + Returns [code]null[/code] if opening the file failed. You can use [method get_open_error] to check the error that occurred. + + @@ -173,6 +187,12 @@ Returns the next 32 bits from the file as a floating-point number. + + + + Returns the next 16 bits from the file as a half-precision floating-point number. + + @@ -375,20 +395,22 @@ - + Stores an integer as 8 bits in the file. [b]Note:[/b] The [param value] should lie in the interval [code][0, 255][/code]. Any other value will overflow and wrap around. + [b]Note:[/b] If an error occurs, the resulting value of the file position indicator is indeterminate. To store a signed integer, use [method store_64], or convert it manually (see [method store_16] for an example). - + Stores an integer as 16 bits in the file. [b]Note:[/b] The [param value] should lie in the interval [code][0, 2^16 - 1][/code]. Any other value will overflow and wrap around. + [b]Note:[/b] If an error occurs, the resulting value of the file position indicator is indeterminate. To store a signed integer, use [method store_64] or store a signed integer from the interval [code][-2^15, 2^15 - 1][/code] (i.e. keeping one bit for the signedness) and compute its sign manually when reading. For example: [codeblocks] [gdscript] @@ -425,90 +447,108 @@ - + Stores an integer as 32 bits in the file. [b]Note:[/b] The [param value] should lie in the interval [code][0, 2^32 - 1][/code]. Any other value will overflow and wrap around. + [b]Note:[/b] If an error occurs, the resulting value of the file position indicator is indeterminate. To store a signed integer, use [method store_64], or convert it manually (see [method store_16] for an example). - + Stores an integer as 64 bits in the file. [b]Note:[/b] The [param value] must lie in the interval [code][-2^63, 2^63 - 1][/code] (i.e. be a valid [int] value). + [b]Note:[/b] If an error occurs, the resulting value of the file position indicator is indeterminate. - + Stores the given array of bytes in the file. + [b]Note:[/b] If an error occurs, the resulting value of the file position indicator is indeterminate. - + Store the given [PackedStringArray] in the file as a line formatted in the CSV (Comma-Separated Values) format. You can pass a different delimiter [param delim] to use other than the default [code]","[/code] (comma). This delimiter must be one-character long. Text will be encoded as UTF-8. + [b]Note:[/b] If an error occurs, the resulting value of the file position indicator is indeterminate. - + Stores a floating-point number as 64 bits in the file. + [b]Note:[/b] If an error occurs, the resulting value of the file position indicator is indeterminate. - + Stores a floating-point number as 32 bits in the file. + [b]Note:[/b] If an error occurs, the resulting value of the file position indicator is indeterminate. + + + + + + + Stores a half-precision floating-point number as 16 bits in the file. - + Stores [param line] in the file followed by a newline character ([code]\n[/code]), encoding the text as UTF-8. + [b]Note:[/b] If an error occurs, the resulting value of the file position indicator is indeterminate. - + Stores the given [String] as a line in the file in Pascal format (i.e. also store the length of the string). Text will be encoded as UTF-8. + [b]Note:[/b] If an error occurs, the resulting value of the file position indicator is indeterminate. - + Stores a floating-point number in the file. + [b]Note:[/b] If an error occurs, the resulting value of the file position indicator is indeterminate. - + Stores [param string] in the file without a newline character ([code]\n[/code]), encoding the text as UTF-8. [b]Note:[/b] This method is intended to be used to write text files. The string is stored as a UTF-8 encoded buffer without string length or terminating zero, which means that it can't be loaded back easily. If you want to store a retrievable string in a binary file, consider using [method store_pascal_string] instead. For retrieving strings from a text file, you can use [code]get_buffer(length).get_string_from_utf8()[/code] (if you know the length) or [method get_as_text]. + [b]Note:[/b] If an error occurs, the resulting value of the file position indicator is indeterminate. - + Stores any Variant value in the file. If [param full_objects] is [code]true[/code], encoding objects is allowed (and can potentially include code). Internally, this uses the same encoding mechanism as the [method @GlobalScope.var_to_bytes] method. [b]Note:[/b] Not all properties are included. Only properties that are configured with the [constant PROPERTY_USAGE_STORAGE] flag set will be serialized. You can add a new usage flag to a property by overriding the [method Object._get_property_list] method in your class. You can also check how property usage is configured by calling [method Object._get_property_list]. See [enum PropertyUsageFlags] for the possible usage flags. + [b]Note:[/b] If an error occurs, the resulting value of the file position indicator is indeterminate. diff --git a/doc/classes/FontFile.xml b/doc/classes/FontFile.xml index c230bf5ad281..e7a724cecd46 100644 --- a/doc/classes/FontFile.xml +++ b/doc/classes/FontFile.xml @@ -631,6 +631,9 @@ Font hinting mode. Used by dynamic fonts only. + + If set to [code]true[/code], when aligning glyphs to the pixel boundaries rounding remainders are accumulated to ensure more uniform glyph distribution. This setting has no effect if subpixel positioning is enabled. + The width of the range around the shape between the minimum and maximum representable signed distance. If using font outlines, [member msdf_pixel_range] must be set to at least [i]twice[/i] the size of the largest font outline. The default [member msdf_pixel_range] value of [code]16[/code] allows outline sizes up to [code]8[/code] to look correct. diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml index 3451e427f342..bd0ea02eeb00 100644 --- a/doc/classes/GraphEdit.xml +++ b/doc/classes/GraphEdit.xml @@ -181,6 +181,14 @@ [/codeblocks] + + + + + + Returns the number of connections from [param from_port] of [param from_node]. + + diff --git a/doc/classes/Label.xml b/doc/classes/Label.xml index ae5a62753f19..7657cf312146 100644 --- a/doc/classes/Label.xml +++ b/doc/classes/Label.xml @@ -74,6 +74,9 @@ Limits the lines of text the node shows on screen. + + String used as a paragraph separator. Each paragraph is processed independently, in its own BiDi context. + Set BiDi algorithm override for the structured text. @@ -129,6 +132,9 @@ [b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended. [b]Note:[/b] Using a value that is larger than half the font size is not recommended, as the font outline may fail to be fully closed in this case. + + Vertical space between paragraphs. Added on top of [theme_item line_spacing]. + The horizontal offset of the text's shadow. diff --git a/doc/classes/LabelSettings.xml b/doc/classes/LabelSettings.xml index ff7b8e7b0e43..610f10574b5a 100644 --- a/doc/classes/LabelSettings.xml +++ b/doc/classes/LabelSettings.xml @@ -27,6 +27,9 @@ Text outline size. + + Vertical space between paragraphs. Added on top of [member line_spacing]. + Color of the shadow effect. If alpha is [code]0[/code], no shadow will be drawn. diff --git a/doc/classes/LightmapGI.xml b/doc/classes/LightmapGI.xml index 0a492364eca0..837da1794fd1 100644 --- a/doc/classes/LightmapGI.xml +++ b/doc/classes/LightmapGI.xml @@ -9,7 +9,8 @@ [b]Performance:[/b] [LightmapGI] provides the best possible run-time performance for global illumination. It is suitable for low-end hardware including integrated graphics and mobile devices. [b]Note:[/b] Due to how lightmaps work, most properties only have a visible effect once lightmaps are baked again. [b]Note:[/b] Lightmap baking on [CSGShape3D]s and [PrimitiveMesh]es is not supported, as these cannot store UV2 data required for baking. - [b]Note:[/b] If no custom lightmappers are installed, [LightmapGI] can only be baked from devices that support the Forward+ or Mobile rendering backends. + [b]Note:[/b] If no custom lightmappers are installed, [LightmapGI] can only be baked from devices that support the Forward+ or Mobile renderers. + [b]Note:[/b] The [LightmapGI] node only bakes light data for child nodes of its parent. Nodes further up the hierarchy of the scene will not be baked. $DOCS_URL/tutorials/3d/global_illumination/using_lightmap_gi.html diff --git a/doc/classes/LightmapperRD.xml b/doc/classes/LightmapperRD.xml index 8fe42ad9cd9b..c533311b9e2b 100644 --- a/doc/classes/LightmapperRD.xml +++ b/doc/classes/LightmapperRD.xml @@ -5,7 +5,7 @@ LightmapperRD ("RD" stands for [RenderingDevice]) is the built-in GPU-based lightmapper for use with [LightmapGI]. On most dedicated GPUs, it can bake lightmaps much faster than most CPU-based lightmappers. LightmapperRD uses compute shaders to bake lightmaps, so it does not require CUDA or OpenCL libraries to be installed to be usable. - [b]Note:[/b] Only usable when using the Vulkan backend (Forward+ or Mobile), not OpenGL. + [b]Note:[/b] Only usable when using the RenderingDevice backend (Forward+ or Mobile renderers), not Compatibility. diff --git a/doc/classes/Line2D.xml b/doc/classes/Line2D.xml index a553e79746e0..825462d21a7e 100644 --- a/doc/classes/Line2D.xml +++ b/doc/classes/Line2D.xml @@ -101,7 +101,7 @@ The polyline's width. - The polyline's width curve. The width of the polyline over its length will be equivalent to the value of the width curve over its domain. + The polyline's width curve. The width of the polyline over its length will be equivalent to the value of the width curve over its domain. The width curve should be a unit [Curve]. diff --git a/doc/classes/LookAtModifier3D.xml b/doc/classes/LookAtModifier3D.xml index e85da06c3af9..2475de186882 100644 --- a/doc/classes/LookAtModifier3D.xml +++ b/doc/classes/LookAtModifier3D.xml @@ -1,10 +1,10 @@ - The [SkeletonModifier3D] rotates a bone to look a target. + The [LookAtModifier3D] rotates a bone to look at a target. - This [SkeletonModifier3D] rotates a bone to look a target. This is helpful for moving character's head to look at the player, rotating a turret to look at a target, or any other case where you want to make a bone rotate towards something quickly and easily. + This [SkeletonModifier3D] rotates a bone to look at a target. This is helpful for moving a character's head to look at the player, rotating a turret to look at a target, or any other case where you want to make a bone rotate towards something quickly and easily. When applying multiple [LookAtModifier3D]s, the [LookAtModifier3D] assigned to the parent bone must be put above the [LookAtModifier3D] assigned to the child bone in the list in order for the child bone results to be correct. @@ -32,8 +32,11 @@ - - The bone index of the [Skeleton3D] that the modification will operate on. + + Index of the [member bone_name] in the parent [Skeleton3D]. + + + The bone name of the [Skeleton3D] that the modification will operate on. The duration of the time-based interpolation. Interpolation is triggered at the following cases: @@ -48,6 +51,9 @@ The forward axis of the bone. This [SkeletonModifier3D] modifies the bone so that this axis points toward the [member target_node]. + Index of the [member origin_bone_name] in the parent [Skeleton3D]. + + If [member origin_from] is [constant ORIGIN_FROM_SPECIFIC_BONE], the bone global pose position specified for this is used as origin. diff --git a/doc/classes/MeshLibrary.xml b/doc/classes/MeshLibrary.xml index f65e29af8e52..5f51d18e4e08 100644 --- a/doc/classes/MeshLibrary.xml +++ b/doc/classes/MeshLibrary.xml @@ -45,6 +45,13 @@ Returns the item's mesh. + + + + + Returns the item's shadow casting mode. See [enum RenderingServer.ShadowCastingSetting] for possible values. + + @@ -116,6 +123,14 @@ Sets the item's mesh. + + + + + + Sets the item's shadow casting mode. See [enum RenderingServer.ShadowCastingSetting] for possible values. + + diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index 3cb76e2926a6..1e12d619e22f 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -1316,7 +1316,7 @@ Duplicate the node's script (also overriding the duplicated children's scripts, if combined with [constant DUPLICATE_USE_INSTANTIATION]). - Duplicate using [method PackedScene.instantiate]. If the node comes from a scene saved on disk, re-uses [method PackedScene.instantiate] as the base for the duplicated node and its children. + Duplicate using [method PackedScene.instantiate]. If the node comes from a scene saved on disk, reuses [method PackedScene.instantiate] as the base for the duplicated node and its children. The node will not be internal. diff --git a/doc/classes/Node2D.xml b/doc/classes/Node2D.xml index 0b2dfcea031f..2a8e26af5315 100644 --- a/doc/classes/Node2D.xml +++ b/doc/classes/Node2D.xml @@ -1,10 +1,11 @@ - A 2D game object, inherited by all 2D-related nodes. Has a position, rotation, scale, and Z index. + A 2D game object, inherited by all 2D-related nodes. Has a position, rotation, scale, and skew. A 2D game object, with a transform (position, rotation, and scale). All 2D nodes, including physics objects and sprites, inherit from Node2D. Use Node2D as a parent node to move, scale and rotate children in a 2D project. Also gives control of the node's render order. + [b]Note:[/b] Since both [Node2D] and [Control] inherit from [CanvasItem], they share several concepts from the class such as the [member CanvasItem.z_index] and [member CanvasItem.visible] properties. $DOCS_URL/tutorials/2d/custom_drawing_in_2d.html diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index 5ab7c27f4f4c..69d613b7cccb 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -537,6 +537,12 @@ [b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS and Windows. + + + + Returns the [i]global[/i] temporary data directory according to the operating system's standards. + + @@ -721,6 +727,7 @@ - If standard input is console, this method will block until the program receives a line break in standard input (usually by the user pressing [kbd]Enter[/kbd]). - If standard input is pipe, this method will block until a specific amount of data is read or pipe is closed. - If standard input is a file, this method will read a specific amount of data (or less if end-of-file is reached) and return immediately. + [b]Note:[/b] This method automatically replaces [code]\r\n[/code] line breaks with [code]\n[/code] and removes them from the end of the string. Use [method read_buffer_from_stdin] to read the unprocessed data. [b]Note:[/b] This method is implemented on Linux, macOS, and Windows. [b]Note:[/b] On exported Windows builds, run the console wrapper executable to access the terminal. If standard input is console, calling this method without console wrapped will freeze permanently. If standard input is pipe or file, it can be used without console wrapper. If you need a single executable with full console support, use a custom build compiled with the [code]windows_subsystem=console[/code] flag. diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml index d0c193ea31da..73fd7e19439a 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -22,6 +22,7 @@ Lastly, every object can also contain metadata (data about data). [method set_meta] can be useful to store information that the object itself does not depend on. To keep your code clean, making excessive use of metadata is discouraged. [b]Note:[/b] Unlike references to a [RefCounted], references to an object stored in a variable can become invalid without being set to [code]null[/code]. To check if an object has been deleted, do [i]not[/i] compare it against [code]null[/code]. Instead, use [method @GlobalScope.is_instance_valid]. It's also recommended to inherit from [RefCounted] for classes storing data instead of [Object]. [b]Note:[/b] The [code]script[/code] is not exposed like most properties. To set or get an object's [Script] in code, use [method set_script] and [method get_script], respectively. + [b]Note:[/b] In a boolean context, an [Object] will evaluate to [code]false[/code] if it is equal to [code]null[/code] or it has been freed. Otherwise, an [Object] will always evaluate to [code]true[/code]. See also [method @GlobalScope.is_instance_valid]. $DOCS_URL/contributing/development/core_and_modules/object_class.html diff --git a/doc/classes/PCKPacker.xml b/doc/classes/PCKPacker.xml index f8f7dbee01be..dbb978865c60 100644 --- a/doc/classes/PCKPacker.xml +++ b/doc/classes/PCKPacker.xml @@ -20,6 +20,7 @@ [/csharp] [/codeblocks] The above [PCKPacker] creates package [code]test.pck[/code], then adds a file named [code]text.txt[/code] at the root of the package. + [b]Note:[/b] PCK is Godot's own pack file format. To create ZIP archives that can be read by any program, use [ZIPPacker] instead. diff --git a/doc/classes/PackedFloat32Array.xml b/doc/classes/PackedFloat32Array.xml index d421993b8fd9..237b659a5225 100644 --- a/doc/classes/PackedFloat32Array.xml +++ b/doc/classes/PackedFloat32Array.xml @@ -192,7 +192,7 @@ - Returns a copy of the data converted to a [PackedByteArray], where each element have been encoded as 4 bytes. + Returns a copy of the data converted to a [PackedByteArray], where each element has been encoded as 4 bytes. The size of the new array will be [code]float32_array.size() * 4[/code]. diff --git a/doc/classes/PackedFloat64Array.xml b/doc/classes/PackedFloat64Array.xml index 4622d632586c..56cc08d8c409 100644 --- a/doc/classes/PackedFloat64Array.xml +++ b/doc/classes/PackedFloat64Array.xml @@ -193,7 +193,7 @@ - Returns a copy of the data converted to a [PackedByteArray], where each element have been encoded as 8 bytes. + Returns a copy of the data converted to a [PackedByteArray], where each element has been encoded as 8 bytes. The size of the new array will be [code]float64_array.size() * 8[/code]. diff --git a/doc/classes/PackedInt32Array.xml b/doc/classes/PackedInt32Array.xml index 3a3596b2d02b..5bb2ea97ef95 100644 --- a/doc/classes/PackedInt32Array.xml +++ b/doc/classes/PackedInt32Array.xml @@ -186,7 +186,7 @@ - Returns a copy of the data converted to a [PackedByteArray], where each element have been encoded as 4 bytes. + Returns a copy of the data converted to a [PackedByteArray], where each element has been encoded as 4 bytes. The size of the new array will be [code]int32_array.size() * 4[/code]. diff --git a/doc/classes/PackedInt64Array.xml b/doc/classes/PackedInt64Array.xml index cfaf012a55be..2ed854895881 100644 --- a/doc/classes/PackedInt64Array.xml +++ b/doc/classes/PackedInt64Array.xml @@ -6,7 +6,7 @@ An array specifically designed to hold 64-bit integer values. Packs data tightly, so it saves memory for large array sizes. [b]Note:[/b] This type stores signed 64-bit integers, which means it can take values in the interval [code][-2^63, 2^63 - 1][/code], i.e. [code][-9223372036854775808, 9223372036854775807][/code]. Exceeding those bounds will wrap around. If you only need to pack 32-bit integers tightly, see [PackedInt32Array] for a more memory-friendly alternative. - [b]Differences between packed arrays, typed arrays, and untyped arrays:[/b] Packed arrays are generally faster to iterate on and modify compared to a typed array of the same type (e.g. [PackedInt32Array] versus [code]Array[int][/code]). Also, packed arrays consume less memory. As a downside, packed arrays are less flexible as they don't offer as many convenience methods such as [method Array.map]. Typed arrays are in turn faster to iterate on and modify than untyped arrays. + [b]Differences between packed arrays, typed arrays, and untyped arrays:[/b] Packed arrays are generally faster to iterate on and modify compared to a typed array of the same type (e.g. [PackedInt64Array] versus [code]Array[int][/code]). Also, packed arrays consume less memory. As a downside, packed arrays are less flexible as they don't offer as many convenience methods such as [method Array.map]. Typed arrays are in turn faster to iterate on and modify than untyped arrays. [b]Note:[/b] Packed arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use [method duplicate]. This is [i]not[/i] the case for built-in properties and methods. The returned packed array of these are a copies, and changing it will [i]not[/i] affect the original value. To update a built-in property you need to modify the returned array, and then assign it to the property again. @@ -187,7 +187,7 @@ - Returns a copy of the data converted to a [PackedByteArray], where each element have been encoded as 8 bytes. + Returns a copy of the data converted to a [PackedByteArray], where each element has been encoded as 8 bytes. The size of the new array will be [code]int64_array.size() * 8[/code]. diff --git a/doc/classes/PackedVector4Array.xml b/doc/classes/PackedVector4Array.xml index 6dbfc7413d47..7bebee79c71d 100644 --- a/doc/classes/PackedVector4Array.xml +++ b/doc/classes/PackedVector4Array.xml @@ -5,6 +5,7 @@ An array specifically designed to hold [Vector4]. Packs data tightly, so it saves memory for large array sizes. + [b]Differences between packed arrays, typed arrays, and untyped arrays:[/b] Packed arrays are generally faster to iterate on and modify compared to a typed array of the same type (e.g. [PackedVector4Array] versus [code]Array[Vector4][/code]). Also, packed arrays consume less memory. As a downside, packed arrays are less flexible as they don't offer as many convenience methods such as [method Array.map]. Typed arrays are in turn faster to iterate on and modify than untyped arrays. [b]Note:[/b] Packed arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use [method duplicate]. This is [i]not[/i] the case for built-in properties and methods. The returned packed array of these are a copies, and changing it will [i]not[/i] affect the original value. To update a built-in property you need to modify the returned array, and then assign it to the property again. diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 91961fcf02b6..1da578167cf4 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -2702,7 +2702,7 @@ The maximum number of uniforms that can be used by the global shader uniform buffer. Each item takes up one slot. In other words, a single uniform float and a uniform vec4 will take the same amount of space in the buffer. - [b]Note:[/b] When using the Compatibility backend, most mobile devices (and all web exports) will be limited to a maximum size of 1024 due to hardware constraints. + [b]Note:[/b] When using the Compatibility renderer, most mobile devices (and all web exports) will be limited to a maximum size of 1024 due to hardware constraints. Max number of omnilights and spotlights renderable per object. At the default value of 8, this means that each surface can be affected by up to 8 omnilights and 8 spotlights. This is further limited by hardware support and [member rendering/limits/opengl/max_renderable_lights]. Setting this low will slightly reduce memory usage, may decrease shader compile times, and may result in faster rendering on low-end, mobile, or web devices. @@ -2775,9 +2775,9 @@ Sets the renderer that will be used by the project. Options are: - [b]Forward Plus[/b]: High-end renderer designed for Desktop devices. Has a higher base overhead, but scales well with complex scenes. Not suitable for older devices or mobile. - [b]Mobile[/b]: Modern renderer designed for mobile devices. Has a lower base overhead than Forward Plus, but does not scale as well to large scenes with many elements. - [b]GL Compatibility[/b]: Low-end renderer designed for older devices. Based on the limitations of the OpenGL 3.3/ OpenGL ES 3.0 / WebGL 2 APIs. + [b]forward_plus[/b] (Forward+): High-end renderer designed for desktop devices. Has a higher base overhead, but scales well with complex scenes. Not suitable for older devices or mobile. + [b]mobile[/b] (Mobile): Modern renderer designed for mobile devices. Has a lower base overhead than Forward+, but does not scale as well to large scenes with many elements. + [b]gl_compatibility[/b] (Compatibility): Low-end renderer designed for older devices. Based on the limitations of the OpenGL 3.3 / OpenGL ES 3.0 / WebGL 2 APIs. This can be overridden using the [code]--rendering-method <method>[/code] command line argument. [b]Note:[/b] The actual rendering method may be automatically changed by the engine as a result of a fallback, or a user-specified command line argument. To get the actual rendering method that is used at runtime, use [method RenderingServer.get_current_rendering_method] instead of reading this project setting's value. @@ -2803,7 +2803,7 @@ Depending on the complexity of scenes, this value may be lowered or may need to be raised. - Sets the driver to be used by the renderer when using a RenderingDevice-based renderer like the clustered renderer or the mobile renderer. This property can't be edited directly. Instead, set the driver using the platform-specific overrides. This can be overridden using the [code]--rendering-driver <driver>[/code] command line argument. + Sets the driver to be used by the renderer when using a RenderingDevice-based renderer like the Forward+ or Mobile renderers. This property can't be edited directly. Instead, set the driver using the platform-specific overrides. This can be overridden using the [code]--rendering-driver <driver>[/code] command line argument. [b]Note:[/b] The actual rendering driver may be automatically changed by the engine as a result of a fallback, or a user-specified command line argument. To get the actual rendering driver that is used at runtime, use [method RenderingServer.get_current_rendering_driver_name] instead of reading this project setting's value. @@ -2928,8 +2928,8 @@ If [code]true[/code], the texture importer will utilize the GPU for compressing textures, improving the import time of large images. - [b]Note:[/b] This only functions on a device which supports either Vulkan, D3D12, or Metal available as a rendering backend. - [b]Note:[/b] Currently this only affects certain compressed formats (BC1, BC4, and BC6), all of which are exclusive to desktop platforms and consoles. + [b]Note:[/b] This only functions on a device which supports either Vulkan, Direct3D 12, or Metal as a rendering driver. + [b]Note:[/b] Currently this only affects certain compressed formats (BC1, BC3, BC4, BC5, and BC6), all of which are exclusive to desktop platforms and consoles. If [code]true[/code], the texture importer will import VRAM-compressed textures using the Ericsson Texture Compression 2 algorithm for lower quality textures and normal maps and Adaptable Scalable Texture Compression algorithm for high quality textures (in 4×4 block size). @@ -2949,7 +2949,7 @@ If [code]true[/code], enables [member Viewport.use_hdr_2d] on the root viewport. 2D rendering will use an high dynamic range (HDR) format framebuffer matching the bit depth of the 3D framebuffer. When using the Forward+ renderer this will be an [code]RGBA16[/code] framebuffer, while when using the Mobile renderer it will be an [code]RGB10_A2[/code] framebuffer. Additionally, 2D rendering will take place in linear color space and will be converted to sRGB space immediately before blitting to the screen. Practically speaking, this means that the end result of the Viewport will not be clamped into the [code]0-1[/code] range and can be used in 3D rendering without color space adjustments. This allows 2D rendering to take advantage of effects requiring high dynamic range (e.g. 2D glow) as well as substantially improves the appearance of effects requiring highly detailed gradients. - [b]Note:[/b] This setting will have no effect when using the GL Compatibility renderer as the GL Compatibility renderer always renders in low dynamic range for performance reasons. + [b]Note:[/b] This setting will have no effect when using the Compatibility renderer, which always renders in low dynamic range for performance reasons. [b]Note:[/b] This property is only read when the project starts. To toggle HDR 2D at runtime, set [member Viewport.use_hdr_2d] on the root [Viewport]. diff --git a/doc/classes/Projection.xml b/doc/classes/Projection.xml index f781083abfc7..091e0bf54f46 100644 --- a/doc/classes/Projection.xml +++ b/doc/classes/Projection.xml @@ -278,22 +278,22 @@ - + The index value of the projection's near clipping plane. - + The index value of the projection's far clipping plane. - + The index value of the projection's left clipping plane. - + The index value of the projection's top clipping plane. - + The index value of the projection's right clipping plane. - + The index value of the projection bottom clipping plane. diff --git a/doc/classes/PropertyTweener.xml b/doc/classes/PropertyTweener.xml index 76cf4cbfeb5e..08ce876e9181 100644 --- a/doc/classes/PropertyTweener.xml +++ b/doc/classes/PropertyTweener.xml @@ -16,10 +16,16 @@ When called, the final value will be used as a relative value instead. [b]Example:[/b] Move the node by [code]100[/code] pixels to the right. - [codeblock] + [codeblocks] + [gdscript] var tween = get_tree().create_tween() tween.tween_property(self, "position", Vector2.RIGHT * 100, 1).as_relative() - [/codeblock] + [/gdscript] + [csharp] + Tween tween = GetTree().CreateTween(); + tween.TweenProperty(this, "position", Vector2.Right * 100.0f, 1.0f).AsRelative(); + [/csharp] + [/codeblocks] @@ -28,20 +34,32 @@ Sets a custom initial value to the [PropertyTweener]. [b]Example:[/b] Move the node from position [code](100, 100)[/code] to [code](200, 100)[/code]. - [codeblock] + [codeblocks] + [gdscript] var tween = get_tree().create_tween() tween.tween_property(self, "position", Vector2(200, 100), 1).from(Vector2(100, 100)) - [/codeblock] + [/gdscript] + [csharp] + Tween tween = GetTree().CreateTween(); + tween.TweenProperty(this, "position", new Vector2(200.0f, 100.0f), 1.0f).From(new Vector2(100.0f, 100.0f)); + [/csharp] + [/codeblocks] Makes the [PropertyTweener] use the current property value (i.e. at the time of creating this [PropertyTweener]) as a starting point. This is equivalent of using [method from] with the current value. These two calls will do the same: - [codeblock] + [codeblocks] + [gdscript] tween.tween_property(self, "position", Vector2(200, 100), 1).from(position) tween.tween_property(self, "position", Vector2(200, 100), 1).from_current() - [/codeblock] + [/gdscript] + [csharp] + tween.TweenProperty(this, "position", new Vector2(200.0f, 100.0f), 1.0f).From(Position); + tween.TweenProperty(this, "position", new Vector2(200.0f, 100.0f), 1.0f).FromCurrent(); + [/csharp] + [/codeblocks] @@ -49,7 +67,8 @@ Allows interpolating the value with a custom easing function. The provided [param interpolator_method] will be called with a value ranging from [code]0.0[/code] to [code]1.0[/code] and is expected to return a value within the same range (values outside the range can be used for overshoot). The return value of the method is then used for interpolation between initial and final value. Note that the parameter passed to the method is still subject to the tweener's own easing. - [codeblock] + [codeblocks] + [gdscript] @export var curve: Curve func _ready(): @@ -59,7 +78,25 @@ func tween_curve(v): return curve.sample_baked(v) - [/codeblock] + [/gdscript] + [csharp] + [Export] + public Curve Curve { get; set; } + + public override void _Ready() + { + Tween tween = CreateTween(); + // Interpolate the value using a custom curve. + Callable tweenCurveCallable = Callable.From<float, float>(TweenCurve); + tween.TweenProperty(this, "position:x", 300.0f, 1.0f).AsRelative().SetCustomInterpolator(tweenCurveCallable); + } + + private float TweenCurve(float value) + { + return Curve.SampleBaked(value); + } + [/csharp] + [/codeblocks] diff --git a/doc/classes/Quaternion.xml b/doc/classes/Quaternion.xml index c74a6453e08b..88262fd4047d 100644 --- a/doc/classes/Quaternion.xml +++ b/doc/classes/Quaternion.xml @@ -21,7 +21,7 @@ - Constructs a [Quaternion] identical to the [constant IDENTITY]. + Constructs a [Quaternion] identical to [constant IDENTITY]. [b]Note:[/b] In C#, this constructs a [Quaternion] with all of its components set to [code]0.0[/code]. @@ -129,7 +129,7 @@ - Returns [code]true[/code] if this quaternion and [param to] are approximately equal, by running [method @GlobalScope.is_equal_approx] on each component. + Returns [code]true[/code] if this quaternion and [param to] are approximately equal, by calling [method @GlobalScope.is_equal_approx] on each component. @@ -232,6 +232,7 @@ The identity quaternion, representing no rotation. This has the same rotation as [constant Basis.IDENTITY]. If a [Vector3] is rotated (multiplied) by this quaternion, it does not change. + [b]Note:[/b] In GDScript, this constant is equivalent to creating a [constructor Quaternion] without any arguments. It can be used to make your code clearer, and for consistency with C#. diff --git a/doc/classes/RDTextureFormat.xml b/doc/classes/RDTextureFormat.xml index ac875ab7c107..617ed954347e 100644 --- a/doc/classes/RDTextureFormat.xml +++ b/doc/classes/RDTextureFormat.xml @@ -37,6 +37,13 @@ The texture's height (in pixels). + + If a texture is discardable, its contents do not need to be preserved between frames. This flag is only relevant when the texture is used as target in a draw list. + This information is used by [RenderingDevice] to figure out if a texture's contents can be discarded, eliminating unnecessary writes to memory and boosting performance. + + + The texture will be used as the destination of a resolve operation. + The number of mipmaps available in the texture. diff --git a/doc/classes/RDVertexAttribute.xml b/doc/classes/RDVertexAttribute.xml index 31605f5471f3..364b82526b6c 100644 --- a/doc/classes/RDVertexAttribute.xml +++ b/doc/classes/RDVertexAttribute.xml @@ -10,14 +10,19 @@ + The way that this attribute's data is interpreted when sent to a shader. + The rate at which this attribute is pulled from its vertex buffer. + The location in the shader that this attribute is bound to. + The number of bytes between the start of the vertex buffer and the first instance of this attribute. + The number of bytes between the starts of consecutive instances of this attribute. diff --git a/doc/classes/RenderSceneBuffersRD.xml b/doc/classes/RenderSceneBuffersRD.xml index 6a5aba1dbc28..6a9445a25edf 100644 --- a/doc/classes/RenderSceneBuffersRD.xml +++ b/doc/classes/RenderSceneBuffersRD.xml @@ -30,6 +30,7 @@ + Create a new texture with the given definition and cache this under the given name. Will return the existing texture if it already exists. diff --git a/doc/classes/RenderingDevice.xml b/doc/classes/RenderingDevice.xml index fe23f7911924..59ca06085f2f 100644 --- a/doc/classes/RenderingDevice.xml +++ b/doc/classes/RenderingDevice.xml @@ -210,15 +210,12 @@ - - - - - - - - - + + + + + + Starts a list of raster drawing commands created with the [code]draw_*[/code] methods. The returned value should be passed to other [code]draw_list_*[/code] functions. Multiple draw lists cannot be created at the same time; you must finish the previous draw list first using [method draw_list_end]. @@ -226,7 +223,7 @@ [codeblock] var rd = RenderingDevice.new() var clear_colors = PackedColorArray([Color(0, 0, 0, 0), Color(0, 0, 0, 0), Color(0, 0, 0, 0)]) - var draw_list = rd.draw_list_begin(framebuffers[i], RenderingDevice.INITIAL_ACTION_CLEAR, RenderingDevice.FINAL_ACTION_READ, RenderingDevice.INITIAL_ACTION_CLEAR, RenderingDevice.FINAL_ACTION_DISCARD, clear_colors, RenderingDevice.OPAQUE_PASS) + var draw_list = rd.draw_list_begin(framebuffers[i], RenderingDevice.CLEAR_COLOR_ALL, clear_colors, true, 1.0f, true, 0, Rect2(), RenderingDevice.OPAQUE_PASS) # Draw opaque. rd.draw_list_bind_render_pipeline(draw_list, raster_pipeline) @@ -241,10 +238,11 @@ rd.draw_list_end() [/codeblock] + The [param draw_flags] indicates if the texture attachments of the framebuffer should be cleared or ignored. Only one of the two flags can be used for each individual attachment. Ignoring an attachment means that any contents that existed before the draw list will be completely discarded, reducing the memory bandwidth used by the render pass but producing garbage results if the pixels aren't replaced. The default behavior allows the engine to figure out the right operation to use if the texture is discardable, which can result in increased performance. See [RDTextureFormat] or [method texture_set_discardable]. The [param breadcrumb] parameter can be an arbitrary 32-bit integer that is useful to diagnose GPU crashes. If Godot is built in dev or debug mode; when the GPU crashes Godot will dump all shaders that were being executed at the time of the crash and the breadcrumb is useful to diagnose what passes did those shaders belong to. It does not affect rendering behavior and can be set to 0. It is recommended to use [enum BreadcrumbMarker] enumerations for consistency but it's not required. It is also possible to use bitwise operations to add extra data. e.g. [codeblock] - rd.draw_list_begin(fb[i], RenderingDevice.INITIAL_ACTION_CLEAR, RenderingDevice.FINAL_ACTION_READ, RenderingDevice.INITIAL_ACTION_CLEAR, RenderingDevice.FINAL_ACTION_DISCARD, clear_colors, RenderingDevice.OPAQUE_PASS | 5) + rd.draw_list_begin(fb[i], RenderingDevice.CLEAR_COLOR_ALL, clear_colors, true, 1.0f, true, 0, Rect2(), RenderingDevice.OPAQUE_PASS | 5) [/codeblock] @@ -947,6 +945,13 @@ [b]Note:[/b] This function returns a [code]uint64_t[/code] which internally maps to a [code]GLuint[/code] (OpenGL) or [code]VkImage[/code] (Vulkan). + + + + + Returns [code]true[/code] if the [param texture] is discardable, [code]false[/code] otherwise. See [RDTextureFormat] or [method texture_set_discardable]. + + @@ -984,6 +989,16 @@ [b]Note:[/b] [param to_texture] texture must [b]not[/b] be multisampled and must also be 2D (or a slice of a 3D/cubemap texture). + + + + + + Updates the discardable property of [param texture]. + If a texture is discardable, its contents do not need to be preserved between frames. This flag is only relevant when the texture is used as target in a draw list. + This information is used by [RenderingDevice] to figure out if a texture's contents can be discarded, eliminating unnecessary writes to memory and boosting performance. + + @@ -2279,40 +2294,40 @@ - + Load the previous contents of the framebuffer. - + Clear the whole framebuffer or its specified region. - + Ignore the previous contents of the framebuffer. This is the fastest option if you'll overwrite all of the pixels and don't need to read any of them. - + Represents the size of the [enum InitialAction] enum. - + - + - + - + - + - + Store the result of the draw list in the framebuffer. This is generally what you want to do. - + Discard the contents of the framebuffer. This is the fastest option if you don't need to use the results of the draw list. - + Represents the size of the [enum FinalAction] enum. - + - + Vertex shader stage. This can be used to manipulate vertices from a shader (but not create new vertices). @@ -2514,5 +2529,86 @@ + + Do not clear or ignore any attachments. + + + Clear the first color attachment. + + + Clear the second color attachment. + + + Clear the third color attachment. + + + Clear the fourth color attachment. + + + Clear the fifth color attachment. + + + Clear the sixth color attachment. + + + Clear the seventh color attachment. + + + Clear the eighth color attachment. + + + Mask for clearing all color attachments. + + + Clear all color attachments. + + + Ignore the previous contents of the first color attachment. + + + Ignore the previous contents of the second color attachment. + + + Ignore the previous contents of the third color attachment. + + + Ignore the previous contents of the fourth color attachment. + + + Ignore the previous contents of the fifth color attachment. + + + Ignore the previous contents of the sixth color attachment. + + + Ignore the previous contents of the seventh color attachment. + + + Ignore the previous contents of the eighth color attachment. + + + Mask for ignoring all the previous contents of the color attachments. + + + Ignore the previous contents of all color attachments. + + + Clear the depth attachment. + + + Ignore the previous contents of the depth attachment. + + + Clear the stencil attachment. + + + Ignore the previous contents of the stencil attachment. + + + Clear all attachments. + + + Ignore the previous contents of all attachments. + diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index 6be53b336b42..c245ac77af2c 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -1075,7 +1075,7 @@ Creates a RenderingDevice that can be used to do draw and compute operations on a separate thread. Cannot draw to the screen nor share data with the global RenderingDevice. - [b]Note:[/b] When using the OpenGL backend or when running in headless mode, this function always returns [code]null[/code]. + [b]Note:[/b] When using the OpenGL rendering driver or when running in headless mode, this function always returns [code]null[/code]. @@ -1578,7 +1578,7 @@ Returns the global RenderingDevice. - [b]Note:[/b] When using the OpenGL backend or when running in headless mode, this function always returns [code]null[/code]. + [b]Note:[/b] When using the OpenGL rendering driver or when running in headless mode, this function always returns [code]null[/code]. @@ -1641,7 +1641,7 @@ Returns the type of the video adapter. Since dedicated graphics cards from a given generation will [i]usually[/i] be significantly faster than integrated graphics made in the same generation, the device type can be used as a basis for automatic graphics settings adjustment. However, this is not always true, so make sure to provide users with a way to manually override graphics settings. - [b]Note:[/b] When using the OpenGL backend or when running in headless mode, this function always returns [constant RenderingDevice.DEVICE_TYPE_OTHER]. + [b]Note:[/b] When using the OpenGL rendering driver or when running in headless mode, this function always returns [constant RenderingDevice.DEVICE_TYPE_OTHER]. @@ -4121,7 +4121,7 @@ If [code]true[/code], 2D rendering will use a high dynamic range (HDR) format framebuffer matching the bit depth of the 3D framebuffer. When using the Forward+ renderer this will be an [code]RGBA16[/code] framebuffer, while when using the Mobile renderer it will be an [code]RGB10_A2[/code] framebuffer. Additionally, 2D rendering will take place in linear color space and will be converted to sRGB space immediately before blitting to the screen (if the Viewport is attached to the screen). Practically speaking, this means that the end result of the Viewport will not be clamped into the [code]0-1[/code] range and can be used in 3D rendering without color space adjustments. This allows 2D rendering to take advantage of effects requiring high dynamic range (e.g. 2D glow) as well as substantially improves the appearance of effects requiring highly detailed gradients. This setting has the same effect as [member Viewport.use_hdr_2d]. - [b]Note:[/b] This setting will have no effect when using the GL Compatibility renderer as the GL Compatibility renderer always renders in low dynamic range for performance reasons. + [b]Note:[/b] This setting will have no effect when using the Compatibility renderer, which always renders in low dynamic range for performance reasons. @@ -5724,7 +5724,7 @@ Buffer memory used (in bytes). This includes vertex data, uniform buffers, and many miscellaneous buffer types used internally. - Video memory used (in bytes). When using the Forward+ or mobile rendering backends, this is always greater than the sum of [constant RENDERING_INFO_TEXTURE_MEM_USED] and [constant RENDERING_INFO_BUFFER_MEM_USED], since there is miscellaneous data not accounted for by those two metrics. When using the GL Compatibility backend, this is equal to the sum of [constant RENDERING_INFO_TEXTURE_MEM_USED] and [constant RENDERING_INFO_BUFFER_MEM_USED]. + Video memory used (in bytes). When using the Forward+ or Mobile renderers, this is always greater than the sum of [constant RENDERING_INFO_TEXTURE_MEM_USED] and [constant RENDERING_INFO_BUFFER_MEM_USED], since there is miscellaneous data not accounted for by those two metrics. When using the Compatibility renderer, this is equal to the sum of [constant RENDERING_INFO_TEXTURE_MEM_USED] and [constant RENDERING_INFO_BUFFER_MEM_USED]. Number of pipeline compilations that were triggered by the 2D canvas renderer. diff --git a/doc/classes/ResourceImporterDynamicFont.xml b/doc/classes/ResourceImporterDynamicFont.xml index 3727bed8e5f1..ee7504aed894 100644 --- a/doc/classes/ResourceImporterDynamicFont.xml +++ b/doc/classes/ResourceImporterDynamicFont.xml @@ -44,6 +44,9 @@ [b]Light:[/b] Sharp result by snapping glyph edges to pixels on the Y axis only. [b]Full:[/b] Sharpest by snapping glyph edges to pixels on both X and Y axes. + + If set to [code]true[/code], when aligning glyphs to the pixel boundaries rounding remainders are accumulated to ensure more uniform glyph distribution. This setting has no effect if subpixel positioning is enabled. + Override the list of languages supported by this font. If left empty, this is supplied by the font metadata. There is usually no need to change this. See also [member script_support]. diff --git a/doc/classes/RetargetModifier3D.xml b/doc/classes/RetargetModifier3D.xml new file mode 100644 index 000000000000..522b954aba32 --- /dev/null +++ b/doc/classes/RetargetModifier3D.xml @@ -0,0 +1,34 @@ + + + + A modifier to transfer parent skeleton poses (or global poses) to child skeletons in model space with different rests. + + + Retrieves the pose (or global pose) relative to the parent Skeleton's rest in model space and transfers it to the child Skeleton. + This modifier rewrites the pose of the child skeleton directly in the parent skeleton's update process. This means that it overwrites the mapped bone pose set in the normal process on the target skeleton. If you want to set the target skeleton bone pose after retargeting, you will need to add a [SkeletonModifier3D] child to the target skeleton and thereby modify the pose. + [b]Note:[/b] When the [member use_global_pose] is enabled, even if it is an unmapped bone, it can cause visual problems because the global pose is applied ignoring the parent bone's pose [b]if it has mapped bone children[/b]. See also [member use_global_pose]. + + + + + + If [code]true[/code], allows to retarget the position. + + + [SkeletonProfile] for retargeting bones with names matching the bone list. + + + If [code]true[/code], allows to retarget the rotation. + + + If [code]true[/code], allows to retarget the scale. + + + If [code]false[/code], in case the target skeleton has fewer bones than the source skeleton, the source bone parent's transform will be ignored. + Instead, it is possible to retarget between models with different body shapes, and position, rotation, and scale can be retargeted separately. + If [code]true[/code], retargeting is performed taking into account global pose. + In case the target skeleton has fewer bones than the source skeleton, the source bone parent's transform is taken into account. However, bone length between skeletons must match exactly, if not, the bones will be forced to expand or shrink. + This is useful for using dummy bone with length [code]0[/code] to match postures when retargeting between models with different number of bones. + + + diff --git a/doc/classes/RibbonTrailMesh.xml b/doc/classes/RibbonTrailMesh.xml index 74523f3c390a..113787d3a4e8 100644 --- a/doc/classes/RibbonTrailMesh.xml +++ b/doc/classes/RibbonTrailMesh.xml @@ -13,7 +13,7 @@ - Determines the size of the ribbon along its length. The size of a particular section segment is obtained by multiplying the baseline [member size] by the value of this curve at the given distance. For values smaller than [code]0[/code], the faces will be inverted. + Determines the size of the ribbon along its length. The size of a particular section segment is obtained by multiplying the baseline [member size] by the value of this curve at the given distance. For values smaller than [code]0[/code], the faces will be inverted. Should be a unit [Curve]. The length of a section of the ribbon. diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index 8472e578401d..d75d3043e029 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -5,6 +5,7 @@ A control for displaying text that can contain custom fonts, images, and basic formatting. [RichTextLabel] manages these as an internal tag stack. It also adapts itself to given width/heights. + [b]Note:[/b] [method newline], [method push_paragraph], [code]"\n"[/code], [code]"\r\n"[/code], [code]p[/code] tag, and alignment tags start a new paragraph. Each paragraph is processed independently, in its own BiDi context. If you want to force line wrapping within paragraph, any other line breaking character can be used, for example, Form Feed (U+000C), Next Line (U+0085), Line Separator (U+2028). [b]Note:[/b] Assignments to [member text] clear the tag stack and reconstruct it from the property's contents. Any edits made to [member text] will erase previous edits made from other manual sources such as [method append_text] and the [code]push_*[/code] / [method pop] methods. [b]Note:[/b] RichTextLabel doesn't support entangled BBCode tags. For example, instead of using [code skip-lint][b]bold[i]bold italic[/b]italic[/i][/code], use [code skip-lint][b]bold[i]bold italic[/i][/b][i]italic[/i][/code]. [b]Note:[/b] [code]push_*/pop_*[/code] functions won't affect BBCode. @@ -99,6 +100,7 @@ Returns the total number of lines in the text. Wrapped text is counted as multiple lines. + [b]Note:[/b] If [member visible_characters_behavior] is set to [constant TextServer.VC_CHARS_BEFORE_SHAPING] only visible wrapped lines are counted. [b]Note:[/b] If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded. @@ -442,6 +444,7 @@ + Adds a meta tag to the tag stack. Similar to the BBCode [code skip-lint][url=something]{text}[/url][/code], but supports non-[String] metadata types. If [member meta_underlined] is [code]true[/code], meta tags display an underline. This behavior can be customized with [param underline_mode]. @@ -681,6 +684,9 @@ If [code]true[/code], text processing is done in a background thread. + + Controls the text's vertical alignment. Supports top, center, bottom, and fill. Set it to one of the [enum VerticalAlignment] constants. + The number of characters to display. If set to [code]-1[/code], all characters are displayed. This can be useful when animating the text appearing in a dialog box. [b]Note:[/b] Setting this property updates [member visible_ratio] accordingly. diff --git a/doc/classes/ScrollContainer.xml b/doc/classes/ScrollContainer.xml index 405bba356434..959721b115d3 100644 --- a/doc/classes/ScrollContainer.xml +++ b/doc/classes/ScrollContainer.xml @@ -40,6 +40,9 @@ + + If [code]true[/code], [theme_item focus] is drawn when the ScrollContainer or one of its descendant nodes is focused. + If [code]true[/code], the ScrollContainer will automatically scroll to focused children (including indirect children) to make sure they are fully visible. @@ -107,6 +110,9 @@ + + The focus border [StyleBox] of the [ScrollContainer]. Only used if [member draw_focus_border] is [code]true[/code]. + The background [StyleBox] of the [ScrollContainer]. diff --git a/doc/classes/ShaderIncludeDB.xml b/doc/classes/ShaderIncludeDB.xml new file mode 100644 index 000000000000..a431eabf4e85 --- /dev/null +++ b/doc/classes/ShaderIncludeDB.xml @@ -0,0 +1,33 @@ + + + + Internal database of built in shader include files. + + + This object contains shader fragments from Godot's internal shaders. These can be used when access to internal uniform buffers and/or internal functions is required for instance when composing compositor effects or compute shaders. Only fragments for the current rendering device are loaded. + + + + + + + + + Returns the code for the built-in shader fragment. You can also access this in your shader code through [code]#include "filename"[/code]. + + + + + + + Returns [code]true[/code] if an include file with this name exists. + + + + + + Returns a list of built-in include files that are currently registered. + + + + diff --git a/doc/classes/Skeleton3D.xml b/doc/classes/Skeleton3D.xml index f5b808be8e24..aa751de5f24a 100644 --- a/doc/classes/Skeleton3D.xml +++ b/doc/classes/Skeleton3D.xml @@ -393,6 +393,11 @@ [b]Note:[/b] During the update process, this signal is not fired, so modification by [SkeletonModifier3D] is not detected. + + + Emitted when the rest is updated. + + Emitted when the value of [member show_rest_only] changes. diff --git a/doc/classes/StreamPeer.xml b/doc/classes/StreamPeer.xml index ad5c5472b895..acff5cf60493 100644 --- a/doc/classes/StreamPeer.xml +++ b/doc/classes/StreamPeer.xml @@ -59,6 +59,12 @@ Gets a single-precision float from the stream. + + + + Gets a half-precision float from the stream. + + @@ -162,6 +168,13 @@ Puts a single-precision float into the stream. + + + + + Puts a half-precision float into the stream. + + diff --git a/doc/classes/String.xml b/doc/classes/String.xml index d0512b8e1cbc..69441e0010c6 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -6,7 +6,7 @@ This is the built-in string Variant type (and the one used by GDScript). Strings may contain any number of Unicode characters, and expose methods useful for manipulating and generating strings. Strings are reference-counted and use a copy-on-write approach (every modification to a string returns a new [String]), so passing them around is cheap in resources. Some string methods have corresponding variations. Variations suffixed with [code]n[/code] ([method countn], [method findn], [method replacen], etc.) are [b]case-insensitive[/b] (they make no distinction between uppercase and lowercase letters). Method variations prefixed with [code]r[/code] ([method rfind], [method rsplit], etc.) are reversed, and start from the end of the string, instead of the beginning. - To convert any Variant to or from a string, see [method @GlobalScope.str], [method @GlobalScope.str_to_var], and [method @GlobalScope.var_to_str]. + To convert any [Variant] to or from a string, see [method @GlobalScope.str], [method @GlobalScope.str_to_var], and [method @GlobalScope.var_to_str]. [b]Note:[/b] In a boolean context, a string will evaluate to [code]false[/code] if it is empty ([code]""[/code]). Otherwise, a string will always evaluate to [code]true[/code]. diff --git a/doc/classes/SubViewportContainer.xml b/doc/classes/SubViewportContainer.xml index b7d097cc9192..b01a81a61f06 100644 --- a/doc/classes/SubViewportContainer.xml +++ b/doc/classes/SubViewportContainer.xml @@ -21,6 +21,11 @@ + + Configure, if either the [SubViewportContainer] or alternatively the [Control] nodes of its [SubViewport] children should be available as targets of mouse-related functionalities, like identifying the drop target in drag-and-drop operations or cursor shape of hovered [Control] node. + If [code]false[/code], the [Control] nodes inside its [SubViewport] children are considered as targets. + If [code]true[/code], the [SubViewportContainer] itself will be considered as a target. + If [code]true[/code], the sub-viewport will be automatically resized to the control's size. [b]Note:[/b] If [code]true[/code], this will prohibit changing [member SubViewport.size] of its children manually. diff --git a/doc/classes/SurfaceTool.xml b/doc/classes/SurfaceTool.xml index 9265e6b3459c..258d68752ea6 100644 --- a/doc/classes/SurfaceTool.xml +++ b/doc/classes/SurfaceTool.xml @@ -147,7 +147,7 @@ - Generates a tangent vector for each vertex. Requires that each vertex have UVs and normals set already (see [method generate_normals]). + Generates a tangent vector for each vertex. Requires that each vertex already has UVs and normals set (see [method generate_normals]). diff --git a/doc/classes/SystemFont.xml b/doc/classes/SystemFont.xml index 38d6e27c8565..b91ae74eae8c 100644 --- a/doc/classes/SystemFont.xml +++ b/doc/classes/SystemFont.xml @@ -43,6 +43,9 @@ Font hinting mode. + + If set to [code]true[/code], when aligning glyphs to the pixel boundaries rounding remainders are accumulated to ensure more uniform glyph distribution. This setting has no effect if subpixel positioning is enabled. + The width of the range around the shape between the minimum and maximum representable signed distance. If using font outlines, [member msdf_pixel_range] must be set to at least [i]twice[/i] the size of the largest font outline. The default [member msdf_pixel_range] value of [code]16[/code] allows outline sizes up to [code]8[/code] to look correct. diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml index d76e65b61840..730b88eb5798 100644 --- a/doc/classes/TextServer.xml +++ b/doc/classes/TextServer.xml @@ -317,6 +317,13 @@ Returns the font hinting mode. Used by dynamic fonts only. + + + + + Returns glyph position rounding behavior. If set to [code]true[/code], when aligning glyphs to the pixel boundaries rounding remainders are accumulated to ensure more uniform glyph distribution. This setting has no effect if subpixel positioning is enabled. + + @@ -824,6 +831,14 @@ Sets font hinting mode. Used by dynamic fonts only. + + + + + + Sets glyph position rounding behavior. If set to [code]true[/code], when aligning glyphs to the pixel boundaries rounding remainders are accumulated to ensure more uniform glyph distribution. This setting has no effect if subpixel positioning is enabled. + + @@ -1067,6 +1082,12 @@ Returns the name of the server interface. + + + + Returns default TextServer database (e.g. ICU break iterators and dictionaries). + + @@ -1914,6 +1935,7 @@ Trims text before the shaping. e.g, increasing [member Label.visible_characters] or [member RichTextLabel.visible_characters] value is visually identical to typing the text. + [b]Note:[/b] In this mode, trimmed text is not processed at all. It is not accounted for in line breaking and size calculations. Displays glyphs that are mapped to the first [member Label.visible_characters] or [member RichTextLabel.visible_characters] characters from the beginning of the text. diff --git a/doc/classes/TextServerExtension.xml b/doc/classes/TextServerExtension.xml index 3c27404f8e38..1df451705c3d 100644 --- a/doc/classes/TextServerExtension.xml +++ b/doc/classes/TextServerExtension.xml @@ -329,6 +329,14 @@ Returns the font hinting mode. Used by dynamic fonts only. + + + + + [b]Optional.[/b] + Returns glyph position rounding behavior. If set to [code]true[/code], when aligning glyphs to the pixel boundaries rounding remainders are accumulated to ensure more uniform glyph distribution. This setting has no effect if subpixel positioning is enabled. + + @@ -904,6 +912,15 @@ Sets font hinting mode. Used by dynamic fonts only. + + + + + + [b]Optional.[/b] + Sets glyph position rounding behavior. If set to [code]true[/code], when aligning glyphs to the pixel boundaries rounding remainders are accumulated to ensure more uniform glyph distribution. This setting has no effect if subpixel positioning is enabled. + + @@ -1170,6 +1187,13 @@ Returns the name of the server interface. + + + + [b]Optional.[/b] + Returns default TextServer database (e.g. ICU break iterators and dictionaries). + + diff --git a/doc/classes/TextureProgressBar.xml b/doc/classes/TextureProgressBar.xml index c68b521da961..5e2b55d6aebb 100644 --- a/doc/classes/TextureProgressBar.xml +++ b/doc/classes/TextureProgressBar.xml @@ -35,6 +35,7 @@ Offsets [member texture_progress] if [member fill_mode] is [constant FILL_CLOCKWISE], [constant FILL_COUNTER_CLOCKWISE], or [constant FILL_CLOCKWISE_AND_COUNTER_CLOCKWISE]. + [b]Note:[/b] The effective radial center always stays within the [member texture_progress] bounds. If you need to move it outside the texture's bounds, modify the [member texture_progress] to contain additional empty space where needed. Upper limit for the fill of [member texture_progress] if [member fill_mode] is [constant FILL_CLOCKWISE], [constant FILL_COUNTER_CLOCKWISE], or [constant FILL_CLOCKWISE_AND_COUNTER_CLOCKWISE]. When the node's [code]value[/code] is equal to its [code]max_value[/code], the texture fills up to this angle. diff --git a/doc/classes/TileSetAtlasSource.xml b/doc/classes/TileSetAtlasSource.xml index a34ca0ce91bf..684c05f32838 100644 --- a/doc/classes/TileSetAtlasSource.xml +++ b/doc/classes/TileSetAtlasSource.xml @@ -270,7 +270,7 @@ The atlas texture. - The base tile size in the texture (in pixel). This size must be bigger than the TileSet's [code]tile_size[/code] value. + The base tile size in the texture (in pixel). This size must be bigger than or equal to the TileSet's [code]tile_size[/code] value. If [code]true[/code], generates an internal texture with an additional one pixel padding around each tile. Texture padding avoids a common artifact where lines appear between tiles. diff --git a/doc/classes/Transform2D.xml b/doc/classes/Transform2D.xml index 665e5e9d6753..bdc908d3877f 100644 --- a/doc/classes/Transform2D.xml +++ b/doc/classes/Transform2D.xml @@ -62,8 +62,8 @@ - Returns the inverted version of this transform. Unlike [method inverse], this method works with almost any basis, including non-uniform ones, but is slower. See also [method inverse]. - [b]Note:[/b] For this method to return correctly, the transform's basis needs to have a determinant that is not exactly [code]0[/code] (see [method determinant]). + Returns the inverted version of this transform. Unlike [method inverse], this method works with almost any basis, including non-uniform ones, but is slower. + [b]Note:[/b] For this method to return correctly, the transform's basis needs to have a determinant that is not exactly [code]0.0[/code] (see [method determinant]). @@ -85,7 +85,7 @@ Returns the [url=https://en.wikipedia.org/wiki/Determinant]determinant[/url] of this transform basis's matrix. For advanced math, this number can be used to determine a few attributes: - - If the determinant is exactly [code]0[/code], the basis is not invertible (see [method inverse]). + - If the determinant is exactly [code]0.0[/code], the basis is not invertible (see [method inverse]). - If the determinant is a negative number, the basis represents a negative scale. [b]Note:[/b] If the basis's scale is the same for every axis, its determinant is always that scale by the power of 2. @@ -116,7 +116,7 @@ # Rotating the Transform2D in any way preserves its scale. my_transform = my_transform.rotated(TAU / 2) - print(my_transform.get_scale()) # Prints (2, 4). + print(my_transform.get_scale()) # Prints (2, 4) [/gdscript] [csharp] var myTransform = new Transform2D( @@ -127,7 +127,7 @@ // Rotating the Transform2D in any way preserves its scale. myTransform = myTransform.Rotated(Mathf.Tau / 2.0f); - GD.Print(myTransform.GetScale()); // Prints (2, 4, 8). + GD.Print(myTransform.GetScale()); // Prints (2, 4) [/csharp] [/codeblocks] [b]Note:[/b] If the value returned by [method determinant] is negative, the scale is also negative. @@ -152,7 +152,7 @@ Returns the [url=https://en.wikipedia.org/wiki/Invertible_matrix]inverted version of this transform[/url]. - [b]Note:[/b] For this method to return correctly, the transform's basis needs to be [i]orthonormal[/i] (see [method orthonormalized]). That means, the basis should only represent a rotation. If it does not, use [method affine_inverse] instead. + [b]Note:[/b] For this method to return correctly, the transform's basis needs to be [i]orthonormal[/i] (see [method orthonormalized]). That means the basis should only represent a rotation. If it does not, use [method affine_inverse] instead. @@ -184,14 +184,15 @@ - Returns a copy of this transform with its basis orthonormalized. An orthonormal basis is both [i]orthogonal[/i] (the axes are perpendicular to each other) and [i]normalized[/i] (the axes have a length of [code]1[/code]), which also means it can only represent rotation. + Returns a copy of this transform with its basis orthonormalized. An orthonormal basis is both [i]orthogonal[/i] (the axes are perpendicular to each other) and [i]normalized[/i] (the axes have a length of [code]1.0[/code]), which also means it can only represent a rotation. - Returns a copy of the transform rotated by the given [param angle] (in radians). + Returns a copy of this transform rotated by the given [param angle] (in radians). + If [param angle] is positive, the transform is rotated clockwise. This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding rotation transform [code]R[/code] from the left, i.e., [code]R * X[/code]. This can be seen as transforming with respect to the global/parent frame. @@ -257,28 +258,29 @@ - The identity [Transform2D]. A transform with no translation, no rotation, and its scale being [code]1[/code]. When multiplied by another [Variant] such as [Rect2] or another [Transform2D], no transformation occurs. This means that: + The identity [Transform2D]. This is a transform with no translation, no rotation, and a scale of [constant Vector2.ONE]. This also means that: - The [member x] points right ([constant Vector2.RIGHT]); - The [member y] points down ([constant Vector2.DOWN]). [codeblock] var transform = Transform2D.IDENTITY print("| X | Y | Origin") - print("| %s | %s | %s" % [transform.x.x, transform.y.x, transform.origin.x]) - print("| %s | %s | %s" % [transform.x.y, transform.y.y, transform.origin.y]) + print("| %.f | %.f | %.f" % [transform.x.x, transform.y.x, transform.origin.x]) + print("| %.f | %.f | %.f" % [transform.x.y, transform.y.y, transform.origin.y]) # Prints: # | X | Y | Origin # | 1 | 0 | 0 # | 0 | 1 | 0 [/codeblock] - This is identical to creating [constructor Transform2D] without any parameters. This constant can be used to make your code clearer, and for consistency with C#. + If a [Vector2], a [Rect2], a [PackedVector2Array], or another [Transform2D] is transformed (multiplied) by this constant, no transformation occurs. + [b]Note:[/b] In GDScript, this constant is equivalent to creating a [constructor Transform2D] without any arguments. It can be used to make your code clearer, and for consistency with C#. When any transform is multiplied by [constant FLIP_X], it negates all components of the [member x] axis (the X column). - When [constant FLIP_X] is multiplied by any basis, it negates the [member Vector2.x] component of all axes (the X row). + When [constant FLIP_X] is multiplied by any transform, it negates the [member Vector2.x] component of all axes (the X row). When any transform is multiplied by [constant FLIP_Y], it negates all components of the [member y] axis (the Y column). - When [constant FLIP_Y] is multiplied by any basis, it negates the [member Vector2.y] component of all axes (the Y row). + When [constant FLIP_Y] is multiplied by any transform, it negates the [member Vector2.y] component of all axes (the Y row). diff --git a/doc/classes/Transform3D.xml b/doc/classes/Transform3D.xml index 98e9d56adbd2..702509b054af 100644 --- a/doc/classes/Transform3D.xml +++ b/doc/classes/Transform3D.xml @@ -20,7 +20,7 @@ - Constructs a [Transform3D] identical to the [constant IDENTITY]. + Constructs a [Transform3D] identical to [constant IDENTITY]. [b]Note:[/b] In C#, this constructs a [Transform3D] with its [member origin] and the components of its [member basis] set to [constant Vector3.ZERO]. @@ -63,7 +63,7 @@ Returns the inverted version of this transform. Unlike [method inverse], this method works with almost any [member basis], including non-uniform ones, but is slower. See also [method Basis.inverse]. - [b]Note:[/b] For this method to return correctly, the transform's [member basis] needs to have a determinant that is not exactly [code]0[/code] (see [method Basis.determinant]). + [b]Note:[/b] For this method to return correctly, the transform's [member basis] needs to have a determinant that is not exactly [code]0.0[/code] (see [method Basis.determinant]). @@ -78,8 +78,8 @@ - Returns the inverted version of this transform. See also [method Basis.inverse]. - [b]Note:[/b] For this method to return correctly, the transform's [member basis] needs to be [i]orthonormal[/i] (see [method Basis.orthonormalized]). That means, the basis should only represent a rotation. If it does not, use [method affine_inverse] instead. + Returns the [url=https://en.wikipedia.org/wiki/Invertible_matrix]inverted version of this transform[/url]. See also [method Basis.inverse]. + [b]Note:[/b] For this method to return correctly, the transform's [member basis] needs to be [i]orthonormal[/i] (see [method orthonormalized]). That means the basis should only represent a rotation. If it does not, use [method affine_inverse] instead. @@ -109,7 +109,7 @@ - Returns a copy of this transform with its [member basis] orthonormalized. An orthonormal basis is both [i]orthogonal[/i] (the axes are perpendicular to each other) and [i]normalized[/i] (the axes have a length of [code]1[/code]), which also means it can only represent rotation. See also [method Basis.orthonormalized]. + Returns a copy of this transform with its [member basis] orthonormalized. An orthonormal basis is both [i]orthogonal[/i] (the axes are perpendicular to each other) and [i]normalized[/i] (the axes have a length of [code]1.0[/code]), which also means it can only represent a rotation. See also [method Basis.orthonormalized]. @@ -118,7 +118,7 @@ Returns a copy of this transform rotated around the given [param axis] by the given [param angle] (in radians). - The [param axis] must be a normalized vector. + The [param axis] must be a normalized vector (see [method Vector3.normalized]). If [param angle] is positive, the basis is rotated counter-clockwise around the axis. This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding rotation transform [code]R[/code] from the left, i.e., [code]R * X[/code]. This can be seen as transforming with respect to the global/parent frame. @@ -181,8 +181,25 @@ - A transform with no translation, no rotation, and its scale being [code]1[/code]. Its [member basis] is equal to [constant Basis.IDENTITY]. - When multiplied by another [Variant] such as [AABB] or another [Transform3D], no transformation occurs. + The identity [Transform3D]. This is a transform with no translation, no rotation, and a scale of [constant Vector3.ONE]. Its [member basis] is equal to [constant Basis.IDENTITY]. This also means that: + - Its [member Basis.x] points right ([constant Vector3.RIGHT]); + - Its [member Basis.y] points up ([constant Vector3.UP]); + - Its [member Basis.z] points back ([constant Vector3.BACK]). + [codeblock] + var transform = Transform3D.IDENTITY + var basis = transform.basis + print("| X | Y | Z | Origin") + print("| %.f | %.f | %.f | %.f" % [basis.x.x, basis.y.x, basis.z.x, transform.origin.x]) + print("| %.f | %.f | %.f | %.f" % [basis.x.y, basis.y.y, basis.z.y, transform.origin.y]) + print("| %.f | %.f | %.f | %.f" % [basis.x.z, basis.y.z, basis.z.z, transform.origin.z]) + # Prints: + # | X | Y | Z | Origin + # | 1 | 0 | 0 | 0 + # | 0 | 1 | 0 | 0 + # | 0 | 0 | 1 | 0 + [/codeblock] + If a [Vector3], an [AABB], a [Plane], a [PackedVector3Array], or another [Transform3D] is transformed (multiplied) by this constant, no transformation occurs. + [b]Note:[/b] In GDScript, this constant is equivalent to creating a [constructor Transform3D] without any arguments. It can be used to make your code clearer, and for consistency with C#. [Transform3D] with mirroring applied perpendicular to the YZ plane. Its [member basis] is equal to [constant Basis.FLIP_X]. diff --git a/doc/classes/TranslationServer.xml b/doc/classes/TranslationServer.xml index 69ca984f67d5..f30a1da014ce 100644 --- a/doc/classes/TranslationServer.xml +++ b/doc/classes/TranslationServer.xml @@ -160,8 +160,9 @@ + - Returns a [param locale] string standardized to match known locales (e.g. [code]en-US[/code] would be matched to [code]en_US[/code]). + Returns a [param locale] string standardized to match known locales (e.g. [code]en-US[/code] would be matched to [code]en_US[/code]). If [param add_defaults] is [code]true[/code], the locale may have a default script or country added. diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index 9510d237da93..9fad1ca9a856 100644 --- a/doc/classes/Tree.xml +++ b/doc/classes/Tree.xml @@ -341,6 +341,9 @@ If [code]true[/code], allows navigating the [Tree] with letter keys through incremental search. + + If [code]true[/code], tree items with no tooltip assigned display their text as their tooltip. See also [method TreeItem.get_tooltip_text] and [method TreeItem.get_button_tooltip_text]. + If [code]true[/code], column titles are visible. diff --git a/doc/classes/TubeTrailMesh.xml b/doc/classes/TubeTrailMesh.xml index bf16b3d16aff..4408280f42a3 100644 --- a/doc/classes/TubeTrailMesh.xml +++ b/doc/classes/TubeTrailMesh.xml @@ -19,7 +19,7 @@ If [code]true[/code], generates a cap at the top of the tube. This can be set to [code]false[/code] to speed up generation and rendering when the cap is never seen by the camera. - Determines the radius of the tube along its length. The radius of a particular section ring is obtained by multiplying the baseline [member radius] by the value of this curve at the given distance. For values smaller than [code]0[/code], the faces will be inverted. + Determines the radius of the tube along its length. The radius of a particular section ring is obtained by multiplying the baseline [member radius] by the value of this curve at the given distance. For values smaller than [code]0[/code], the faces will be inverted. Should be a unit [Curve]. The number of sides on the tube. For example, a value of [code]5[/code] means the tube will be pentagonal. Higher values result in a more detailed tube at the cost of performance. diff --git a/doc/classes/Tween.xml b/doc/classes/Tween.xml index 147d9fa4bd53..1c4dcc890d96 100644 --- a/doc/classes/Tween.xml +++ b/doc/classes/Tween.xml @@ -89,7 +89,7 @@ [/codeblocks] Some [Tweener]s use transitions and eases. The first accepts a [enum TransitionType] constant, and refers to the way the timing of the animation is handled (see [url=https://easings.net/]easings.net[/url] for some examples). The second accepts an [enum EaseType] constant, and controls where the [code]trans_type[/code] is applied to the interpolation (in the beginning, the end, or both). If you don't know which transition and easing to pick, you can try different [enum TransitionType] constants with [constant EASE_IN_OUT], and use the one that looks best. [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/tween_cheatsheet.webp]Tween easing and transition types cheatsheet[/url] - [b]Note:[/b] Tweens are not designed to be re-used and trying to do so results in an undefined behavior. Create a new Tween for each animation and every time you replay an animation from start. Keep in mind that Tweens start immediately, so only create a Tween when you want to start animating. + [b]Note:[/b] Tweens are not designed to be reused and trying to do so results in an undefined behavior. Create a new Tween for each animation and every time you replay an animation from start. Keep in mind that Tweens start immediately, so only create a Tween when you want to start animating. [b]Note:[/b] The tween is processed after all of the nodes in the current frame, i.e. node's [method Node._process] method would be called before the tween (or [method Node._physics_process] depending on the value passed to [method set_process_mode]). diff --git a/doc/classes/UDPServer.xml b/doc/classes/UDPServer.xml index 123ae399b331..59a12a1dafb6 100644 --- a/doc/classes/UDPServer.xml +++ b/doc/classes/UDPServer.xml @@ -13,7 +13,7 @@ class_name ServerNode extends Node - var server := UDPServer.new() + var server = UDPServer.new() var peers = [] func _ready(): @@ -22,7 +22,7 @@ func _process(delta): server.poll() # Important! if server.is_connection_available(): - var peer: PacketPeerUDP = server.take_connection() + var peer = server.take_connection() var packet = peer.get_packet() print("Accepted peer: %s:%s" % [peer.get_packet_ip(), peer.get_packet_port()]) print("Received data: %s" % [packet.get_string_from_utf8()]) @@ -77,7 +77,7 @@ class_name ClientNode extends Node - var udp := PacketPeerUDP.new() + var udp = PacketPeerUDP.new() var connected = false func _ready(): diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml index 78183ae36ce4..c03262bb33b1 100644 --- a/doc/classes/Vector2.xml +++ b/doc/classes/Vector2.xml @@ -424,10 +424,10 @@ - + Enumerated value for the X axis. Returned by [method max_axis_index] and [method min_axis_index]. - + Enumerated value for the Y axis. Returned by [method max_axis_index] and [method min_axis_index]. diff --git a/doc/classes/Vector2i.xml b/doc/classes/Vector2i.xml index 4afc62e03878..53c7c92ca38a 100644 --- a/doc/classes/Vector2i.xml +++ b/doc/classes/Vector2i.xml @@ -170,10 +170,10 @@ - + Enumerated value for the X axis. Returned by [method max_axis_index] and [method min_axis_index]. - + Enumerated value for the Y axis. Returned by [method max_axis_index] and [method min_axis_index]. diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml index c04fcd0b24d1..4ab3140eb633 100644 --- a/doc/classes/Vector3.xml +++ b/doc/classes/Vector3.xml @@ -421,13 +421,13 @@ - + Enumerated value for the X axis. Returned by [method max_axis_index] and [method min_axis_index]. - + Enumerated value for the Y axis. Returned by [method max_axis_index] and [method min_axis_index]. - + Enumerated value for the Z axis. Returned by [method max_axis_index] and [method min_axis_index]. diff --git a/doc/classes/Vector3i.xml b/doc/classes/Vector3i.xml index df4624dbb100..7fe469aec075 100644 --- a/doc/classes/Vector3i.xml +++ b/doc/classes/Vector3i.xml @@ -168,13 +168,13 @@ - + Enumerated value for the X axis. Returned by [method max_axis_index] and [method min_axis_index]. - + Enumerated value for the Y axis. Returned by [method max_axis_index] and [method min_axis_index]. - + Enumerated value for the Z axis. Returned by [method max_axis_index] and [method min_axis_index]. diff --git a/doc/classes/Vector4.xml b/doc/classes/Vector4.xml index f70c59fbeffd..8fa17b57e6cc 100644 --- a/doc/classes/Vector4.xml +++ b/doc/classes/Vector4.xml @@ -287,16 +287,16 @@ - + Enumerated value for the X axis. Returned by [method max_axis_index] and [method min_axis_index]. - + Enumerated value for the Y axis. Returned by [method max_axis_index] and [method min_axis_index]. - + Enumerated value for the Z axis. Returned by [method max_axis_index] and [method min_axis_index]. - + Enumerated value for the W axis. Returned by [method max_axis_index] and [method min_axis_index]. diff --git a/doc/classes/Vector4i.xml b/doc/classes/Vector4i.xml index b351f2ccb611..e1d65eb1b557 100644 --- a/doc/classes/Vector4i.xml +++ b/doc/classes/Vector4i.xml @@ -169,16 +169,16 @@ - + Enumerated value for the X axis. Returned by [method max_axis_index] and [method min_axis_index]. - + Enumerated value for the Y axis. Returned by [method max_axis_index] and [method min_axis_index]. - + Enumerated value for the Z axis. Returned by [method max_axis_index] and [method min_axis_index]. - + Enumerated value for the W axis. Returned by [method max_axis_index] and [method min_axis_index]. diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index 678b7690d973..73d22873cabb 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -104,6 +104,13 @@ Returns the transform from the Viewport's coordinates to the screen coordinates of the containing window manager window. + + + + Returns the automatically computed 2D stretch transform, taking the [Viewport]'s stretch settings into account. The final value is multiplied by [member Window.content_scale_factor], but only for the root viewport. If this method is called on a [SubViewport] (e.g., in a scene tree with [SubViewportContainer] and [SubViewport]), the scale factor of the root window will not be applied. Using [method Transform2D.get_scale] on the returned value, this can be used to compensate for scaling when zooming a [Camera2D] node, or to scale down a [TextureRect] to be pixel-perfect regardless of the automatically computed scale factor. + [b]Note:[/b] Due to how pixel scaling works, the transform's X scale value may differ slightly from the Y scale, even when [member Window.content_scale_aspect] is set to a mode that preserves pixel aspect ratio. If [member Window.content_scale_aspect] is [constant Window.CONTENT_SCALE_ASPECT_IGNORE], the X value may differ [i]significantly[/i] from Y due to differences between the original aspect ratio and the window aspect ratio. + + @@ -398,7 +405,7 @@ If [code]true[/code], 2D rendering will use an high dynamic range (HDR) format framebuffer matching the bit depth of the 3D framebuffer. When using the Forward+ renderer this will be an [code]RGBA16[/code] framebuffer, while when using the Mobile renderer it will be an [code]RGB10_A2[/code] framebuffer. Additionally, 2D rendering will take place in linear color space and will be converted to sRGB space immediately before blitting to the screen (if the Viewport is attached to the screen). Practically speaking, this means that the end result of the Viewport will not be clamped into the [code]0-1[/code] range and can be used in 3D rendering without color space adjustments. This allows 2D rendering to take advantage of effects requiring high dynamic range (e.g. 2D glow) as well as substantially improves the appearance of effects requiring highly detailed gradients. - [b]Note:[/b] This setting will have no effect when using the GL Compatibility renderer as the GL Compatibility renderer always renders in low dynamic range for performance reasons. + [b]Note:[/b] This setting will have no effect when using the Compatibility renderer, which always renders in low dynamic range for performance reasons. If [code]true[/code], [OccluderInstance3D] nodes will be usable for occlusion culling in 3D for this viewport. For the root viewport, [member ProjectSettings.rendering/occlusion_culling/use_occlusion_culling] must be set to [code]true[/code] instead. diff --git a/doc/classes/VisualShaderNodeColorFunc.xml b/doc/classes/VisualShaderNodeColorFunc.xml index edb523832585..aa2dcca1d580 100644 --- a/doc/classes/VisualShaderNodeColorFunc.xml +++ b/doc/classes/VisualShaderNodeColorFunc.xml @@ -40,7 +40,32 @@ return vec3(r, g, b); [/codeblock] - + + Converts color from linear color space to sRGB color space using the following formula: + [codeblock] + vec3 c = clamp(c, vec3(0.0), vec3(1.0)); + const vec3 a = vec3(0.055f); + return mix((vec3(1.0f) + a) * pow(c.rgb, vec3(1.0f / 2.4f)) - a, 12.92f * c.rgb, lessThan(c.rgb, vec3(0.0031308f))); + [/codeblock] + The Compatibility renderer uses a simpler formula: + [codeblock] + vec3 c = input; + return max(vec3(1.055) * pow(c, vec3(0.416666667)) - vec3(0.055), vec3(0.0)); + [/codeblock] + + + Converts color from sRGB color space to linear color space using the following formula: + [codeblock] + vec3 c = input; + return mix(pow((c.rgb + vec3(0.055)) * (1.0 / (1.0 + 0.055)), vec3(2.4)), c.rgb * (1.0 / 12.92), lessThan(c.rgb, vec3(0.04045))); + [/codeblock] + The Compatibility renderer uses a simpler formula: + [codeblock] + vec3 c = input; + return c * (c * (c * 0.305306011 + 0.682171111) + 0.012522878); + [/codeblock] + + Represents the size of the [enum Function] enum. diff --git a/doc/classes/VisualShaderNodeDerivativeFunc.xml b/doc/classes/VisualShaderNodeDerivativeFunc.xml index 6dc38a00ac87..c9bed5ead9bd 100644 --- a/doc/classes/VisualShaderNodeDerivativeFunc.xml +++ b/doc/classes/VisualShaderNodeDerivativeFunc.xml @@ -16,7 +16,7 @@ A type of operands and returned value. See [enum OpType] for options. - Sets the level of precision to use for the derivative function. See [enum Precision] for options. When using the GL Compatibility renderer, this setting has no effect. + Sets the level of precision to use for the derivative function. See [enum Precision] for options. When using the Compatibility renderer, this setting has no effect. diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml index 424941b84228..6d3294cc2754 100644 --- a/doc/classes/Window.xml +++ b/doc/classes/Window.xml @@ -572,7 +572,7 @@ Specifies how the content's aspect behaves when the [Window] is resized. The base aspect is determined by [member content_scale_size]. - Specifies the base scale of [Window]'s content when its [member size] is equal to [member content_scale_size]. + Specifies the base scale of [Window]'s content when its [member size] is equal to [member content_scale_size]. See also [method Viewport.get_stretch_transform]. Specifies how the content is scaled when the [Window] is resized. @@ -727,7 +727,7 @@ Emitted when files are dragged from the OS file manager and dropped in the game window. The argument is a list of file paths. [codeblock] func _ready(): - get_viewport().files_dropped.connect(on_files_dropped) + get_window().files_dropped.connect(on_files_dropped) func on_files_dropped(files): print(files) @@ -805,6 +805,7 @@ Full screen mode with full multi-window support. Full screen window covers the entire display area of a screen and has no decorations. The display's video mode is not changed. + [b]On Android:[/b] This enables immersive mode. [b]On Windows:[/b] Multi-window full-screen mode has a 1px border of the [member ProjectSettings.rendering/environment/defaults/default_clear_color] color. [b]On macOS:[/b] A new desktop is used to display the running project. [b]Note:[/b] Regardless of the platform, enabling full screen 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 full screen mode. @@ -812,6 +813,7 @@ A single window full screen mode. This mode has less overhead, but only one window can be open on a given screen at a time (opening a child window or application switching will trigger a full screen transition). Full screen window covers the entire display area of a screen and has no border or decorations. The display's video mode is not changed. + [b]On Android:[/b] This enables immersive mode. [b]On Windows:[/b] Depending on video driver, full screen transition might cause screens to go black for a moment. [b]On macOS:[/b] A new desktop is used to display the running project. Exclusive full screen mode prevents Dock and Menu from showing up when the mouse pointer is hovering the edge of the screen. [b]On Linux (X11):[/b] Exclusive full screen mode bypasses compositor. diff --git a/doc/tools/make_rst.py b/doc/tools/make_rst.py index e1a6aa4a98a6..51b6b9befccc 100755 --- a/doc/tools/make_rst.py +++ b/doc/tools/make_rst.py @@ -911,7 +911,7 @@ def get_git_branch() -> str: def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: str) -> None: class_name = class_def.name with open( - os.devnull if dry_run else os.path.join(output_dir, f"class_{class_name.lower()}.rst"), + os.devnull if dry_run else os.path.join(output_dir, f"class_{sanitize_class_name(class_name, True)}.rst"), "w", encoding="utf-8", newline="\n", @@ -937,7 +937,7 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: f.write(f".. XML source: {source_github_url}.\n\n") # Document reference id and header. - f.write(f".. _class_{class_name}:\n\n") + f.write(f".. _class_{sanitize_class_name(class_name)}:\n\n") f.write(make_heading(class_name, "=", False)) f.write(make_deprecated_experimental(class_def, state)) @@ -1041,13 +1041,11 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: type_rst = property_def.type_name.to_rst(state) default = property_def.default_value if default is not None and property_def.overrides: - ref = ( - f":ref:`{property_def.overrides}`" - ) + ref = f":ref:`{property_def.overrides}`" # Not using translate() for now as it breaks table formatting. ml.append((type_rst, property_def.name, f"{default} (overrides {ref})")) else: - ref = f":ref:`{property_def.name}`" + ref = f":ref:`{property_def.name}`" ml.append((type_rst, ref, default)) format_table(f, ml, True) @@ -1093,7 +1091,7 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: ml = [] for theme_item_def in class_def.theme_items.values(): - ref = f":ref:`{theme_item_def.name}`" + ref = f":ref:`{theme_item_def.name}`" ml.append((theme_item_def.type_name.to_rst(state), ref, theme_item_def.default_value)) format_table(f, ml, True) @@ -1114,7 +1112,7 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: # Create signal signature and anchor point. - signal_anchor = f"class_{class_name}_signal_{signal.name}" + signal_anchor = f"class_{sanitize_class_name(class_name)}_signal_{signal.name}" f.write(f".. _{signal_anchor}:\n\n") self_link = f":ref:`🔗<{signal_anchor}>`" f.write(".. rst-class:: classref-signal\n\n") @@ -1153,7 +1151,7 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: # Create enumeration signature and anchor point. - enum_anchor = f"enum_{class_name}_{e.name}" + enum_anchor = f"enum_{sanitize_class_name(class_name)}_{e.name}" f.write(f".. _{enum_anchor}:\n\n") self_link = f":ref:`🔗<{enum_anchor}>`" f.write(".. rst-class:: classref-enumeration\n\n") @@ -1166,7 +1164,7 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: for value in e.values.values(): # Also create signature and anchor point for each enum constant. - f.write(f".. _class_{class_name}_constant_{value.name}:\n\n") + f.write(f".. _class_{sanitize_class_name(class_name)}_constant_{value.name}:\n\n") f.write(".. rst-class:: classref-enumeration-constant\n\n") f.write(f"{e.type_name.to_rst(state)} **{value.name}** = ``{value.value}``\n\n") @@ -1199,7 +1197,7 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: for constant in class_def.constants.values(): # Create constant signature and anchor point. - constant_anchor = f"class_{class_name}_constant_{constant.name}" + constant_anchor = f"class_{sanitize_class_name(class_name)}_constant_{constant.name}" f.write(f".. _{constant_anchor}:\n\n") self_link = f":ref:`🔗<{constant_anchor}>`" f.write(".. rst-class:: classref-constant\n\n") @@ -1239,7 +1237,7 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: self_link = "" if i == 0: - annotation_anchor = f"class_{class_name}_annotation_{m.name}" + annotation_anchor = f"class_{sanitize_class_name(class_name)}_annotation_{m.name}" f.write(f".. _{annotation_anchor}:\n\n") self_link = f" :ref:`🔗<{annotation_anchor}>`" @@ -1280,7 +1278,7 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: # Create property signature and anchor point. - property_anchor = f"class_{class_name}_property_{property_def.name}" + property_anchor = f"class_{sanitize_class_name(class_name)}_property_{property_def.name}" f.write(f".. _{property_anchor}:\n\n") self_link = f":ref:`🔗<{property_anchor}>`" f.write(".. rst-class:: classref-property\n\n") @@ -1348,7 +1346,7 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: self_link = "" if i == 0: - constructor_anchor = f"class_{class_name}_constructor_{m.name}" + constructor_anchor = f"class_{sanitize_class_name(class_name)}_constructor_{m.name}" f.write(f".. _{constructor_anchor}:\n\n") self_link = f" :ref:`🔗<{constructor_anchor}>`" @@ -1394,7 +1392,7 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: method_qualifier = "" if m.name.startswith("_"): method_qualifier = "private_" - method_anchor = f"class_{class_name}_{method_qualifier}method_{m.name}" + method_anchor = f"class_{sanitize_class_name(class_name)}_{method_qualifier}method_{m.name}" f.write(f".. _{method_anchor}:\n\n") self_link = f" :ref:`🔗<{method_anchor}>`" @@ -1435,7 +1433,9 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: # Create operator signature and anchor point. - operator_anchor = f"class_{class_name}_operator_{sanitize_operator_name(m.name, state)}" + operator_anchor = ( + f"class_{sanitize_class_name(class_name)}_operator_{sanitize_operator_name(m.name, state)}" + ) for parameter in m.parameters: operator_anchor += f"_{parameter.type_name.type_name}" f.write(f".. _{operator_anchor}:\n\n") @@ -1477,7 +1477,9 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: # Create theme property signature and anchor point. - theme_item_anchor = f"class_{class_name}_theme_{theme_item_def.data_name}_{theme_item_def.name}" + theme_item_anchor = ( + f"class_{sanitize_class_name(class_name)}_theme_{theme_item_def.data_name}_{theme_item_def.name}" + ) f.write(f".. _{theme_item_anchor}:\n\n") self_link = f":ref:`🔗<{theme_item_anchor}>`" f.write(".. rst-class:: classref-themeproperty\n\n") @@ -1515,7 +1517,7 @@ def make_type(klass: str, state: State) -> str: def resolve_type(link_type: str) -> str: if link_type in state.classes: - return f":ref:`{link_type}`" + return f":ref:`{link_type}`" else: print_error(f'{state.current_class}.xml: Unresolved type "{link_type}".', state) return f"``{link_type}``" @@ -1533,7 +1535,7 @@ def resolve_type(link_type: str) -> str: def make_enum(t: str, is_bitfield: bool, state: State) -> str: - p = t.find(".") + p = t.rfind(".") if p >= 0: c = t[0:p] e = t[p + 1 :] @@ -1551,13 +1553,11 @@ def make_enum(t: str, is_bitfield: bool, state: State) -> str: if is_bitfield: if not state.classes[c].enums[e].is_bitfield: print_error(f'{state.current_class}.xml: Enum "{t}" is not bitfield.', state) - return f"|bitfield|\\[:ref:`{e}`\\]" + return f"|bitfield|\\[:ref:`{e}`\\]" else: - return f":ref:`{e}`" + return f":ref:`{e}`" - # Don't fail for `Vector3.Axis`, as this enum is a special case which is expected not to be resolved. - if f"{c}.{e}" != "Vector3.Axis": - print_error(f'{state.current_class}.xml: Unresolved enum "{t}".', state) + print_error(f'{state.current_class}.xml: Unresolved enum "{t}".', state) return t @@ -1578,7 +1578,7 @@ def make_method_signature( if isinstance(definition, MethodDef) and ref_type != "": if ref_type == "operator": op_name = definition.name.replace("<", "\\<") # So operator "<" gets correctly displayed. - out += f":ref:`{op_name}`" + out += f":ref:`{definition.name}`" else: - out += f":ref:`{definition.name}`" + out += f":ref:`{definition.name}`" else: out += f"**{definition.name}**" @@ -1776,13 +1776,15 @@ def make_rst_index(grouped_classes: Dict[str, List[str]], dry_run: bool, output_ f.write("\n") if group_name in CLASS_GROUPS_BASE: - f.write(f" class_{CLASS_GROUPS_BASE[group_name].lower()}\n") + f.write(f" class_{sanitize_class_name(CLASS_GROUPS_BASE[group_name], True)}\n") for class_name in grouped_classes[group_name]: - if group_name in CLASS_GROUPS_BASE and CLASS_GROUPS_BASE[group_name].lower() == class_name.lower(): + if group_name in CLASS_GROUPS_BASE and sanitize_class_name( + CLASS_GROUPS_BASE[group_name], True + ) == sanitize_class_name(class_name, True): continue - f.write(f" class_{class_name.lower()}\n") + f.write(f" class_{sanitize_class_name(class_name, True)}\n") f.write("\n") @@ -2263,7 +2265,7 @@ def format_text_block( repl_text = target_name if target_class_name != state.current_class: repl_text = f"{target_class_name}.{target_name}" - tag_text = f":ref:`{repl_text}`" + tag_text = f":ref:`{repl_text}`" escape_pre = True escape_post = True @@ -2576,6 +2578,13 @@ def format_table(f: TextIO, data: List[Tuple[Optional[str], ...]], remove_empty_ f.write("\n") +def sanitize_class_name(dirty_name: str, is_file_name=False) -> str: + if is_file_name: + return dirty_name.lower().replace('"', "").replace("/", "--") + else: + return dirty_name.replace('"', "").replace("/", "_").replace(".", "_") + + def sanitize_operator_name(dirty_name: str, state: State) -> str: clear_name = dirty_name.replace("operator ", "") diff --git a/drivers/d3d12/rendering_context_driver_d3d12.cpp b/drivers/d3d12/rendering_context_driver_d3d12.cpp index 8fa495f5c4f3..7cd36f90d23b 100644 --- a/drivers/d3d12/rendering_context_driver_d3d12.cpp +++ b/drivers/d3d12/rendering_context_driver_d3d12.cpp @@ -96,6 +96,9 @@ RenderingContextDriverD3D12::~RenderingContextDriverD3D12() { if (lib_dxgi) { FreeLibrary(lib_dxgi); } + if (lib_dcomp) { + FreeLibrary(lib_dcomp); + } } Error RenderingContextDriverD3D12::_init_device_factory() { @@ -108,6 +111,9 @@ Error RenderingContextDriverD3D12::_init_device_factory() { lib_dxgi = LoadLibraryW(L"DXGI.dll"); ERR_FAIL_NULL_V(lib_dxgi, ERR_CANT_CREATE); + lib_dcomp = LoadLibraryW(L"Dcomp.dll"); + ERR_FAIL_NULL_V(lib_dcomp, ERR_CANT_CREATE); + // Note: symbol is not available in MinGW import library. PFN_D3D12_GET_INTERFACE d3d_D3D12GetInterface = (PFN_D3D12_GET_INTERFACE)(void *)GetProcAddress(lib_d3d12, "D3D12GetInterface"); if (!d3d_D3D12GetInterface) { diff --git a/drivers/d3d12/rendering_context_driver_d3d12.h b/drivers/d3d12/rendering_context_driver_d3d12.h index a2d828ded1ac..3eed64448151 100644 --- a/drivers/d3d12/rendering_context_driver_d3d12.h +++ b/drivers/d3d12/rendering_context_driver_d3d12.h @@ -59,6 +59,20 @@ #undef AS #endif +#if (WINVER < _WIN32_WINNT_WIN8) && defined(_MSC_VER) +#pragma push_macro("NTDDI_VERSION") +#pragma push_macro("WINVER") +#undef NTDDI_VERSION +#undef WINVER +#define NTDDI_VERSION NTDDI_WIN8 +#define WINVER _WIN32_WINNT_WIN8 +#include +#pragma pop_macro("WINVER") +#pragma pop_macro("NTDDI_VERSION") +#else +#include +#endif + #include "d3dx12.h" #include @@ -114,10 +128,14 @@ class RenderingContextDriverD3D12 : public RenderingContextDriver { uint32_t height = 0; DisplayServer::VSyncMode vsync_mode = DisplayServer::VSYNC_ENABLED; bool needs_resize = false; + ComPtr composition_device; + ComPtr composition_target; + ComPtr composition_visual; }; HMODULE lib_d3d12 = nullptr; HMODULE lib_dxgi = nullptr; + HMODULE lib_dcomp = nullptr; IDXGIAdapter1 *create_adapter(uint32_t p_adapter_index) const; ID3D12DeviceFactory *device_factory_get() const; diff --git a/drivers/d3d12/rendering_device_driver_d3d12.cpp b/drivers/d3d12/rendering_device_driver_d3d12.cpp index 0b1b0651c8c6..f78233b9b33f 100644 --- a/drivers/d3d12/rendering_device_driver_d3d12.cpp +++ b/drivers/d3d12/rendering_device_driver_d3d12.cpp @@ -2469,7 +2469,7 @@ Error RenderingDeviceDriverD3D12::swap_chain_resize(CommandQueueID p_cmd_queue, DXGI_SWAP_CHAIN_DESC1 swap_chain_desc = {}; if (swap_chain->d3d_swap_chain != nullptr) { _swap_chain_release_buffers(swap_chain); - res = swap_chain->d3d_swap_chain->ResizeBuffers(p_desired_framebuffer_count, 0, 0, DXGI_FORMAT_UNKNOWN, creation_flags); + res = swap_chain->d3d_swap_chain->ResizeBuffers(p_desired_framebuffer_count, surface->width, surface->height, DXGI_FORMAT_UNKNOWN, creation_flags); ERR_FAIL_COND_V(!SUCCEEDED(res), ERR_UNAVAILABLE); } else { swap_chain_desc.BufferCount = p_desired_framebuffer_count; @@ -2478,7 +2478,7 @@ Error RenderingDeviceDriverD3D12::swap_chain_resize(CommandQueueID p_cmd_queue, swap_chain_desc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD; swap_chain_desc.SampleDesc.Count = 1; swap_chain_desc.Flags = creation_flags; - swap_chain_desc.Scaling = DXGI_SCALING_NONE; + swap_chain_desc.Scaling = DXGI_SCALING_STRETCH; if (OS::get_singleton()->is_layered_allowed()) { swap_chain_desc.AlphaMode = DXGI_ALPHA_MODE_PREMULTIPLIED; has_comp_alpha[(uint64_t)p_cmd_queue.id] = true; @@ -2486,14 +2486,11 @@ Error RenderingDeviceDriverD3D12::swap_chain_resize(CommandQueueID p_cmd_queue, swap_chain_desc.AlphaMode = DXGI_ALPHA_MODE_IGNORE; has_comp_alpha[(uint64_t)p_cmd_queue.id] = false; } + swap_chain_desc.Width = surface->width; + swap_chain_desc.Height = surface->height; ComPtr swap_chain_1; - res = context_driver->dxgi_factory_get()->CreateSwapChainForHwnd(command_queue->d3d_queue.Get(), surface->hwnd, &swap_chain_desc, nullptr, nullptr, swap_chain_1.GetAddressOf()); - if (!SUCCEEDED(res) && swap_chain_desc.AlphaMode != DXGI_ALPHA_MODE_IGNORE) { - swap_chain_desc.AlphaMode = DXGI_ALPHA_MODE_IGNORE; - has_comp_alpha[(uint64_t)p_cmd_queue.id] = false; - res = context_driver->dxgi_factory_get()->CreateSwapChainForHwnd(command_queue->d3d_queue.Get(), surface->hwnd, &swap_chain_desc, nullptr, nullptr, swap_chain_1.GetAddressOf()); - } + res = context_driver->dxgi_factory_get()->CreateSwapChainForComposition(command_queue->d3d_queue.Get(), &swap_chain_desc, nullptr, swap_chain_1.GetAddressOf()); ERR_FAIL_COND_V(!SUCCEEDED(res), ERR_CANT_CREATE); swap_chain_1.As(&swap_chain->d3d_swap_chain); @@ -2503,6 +2500,36 @@ Error RenderingDeviceDriverD3D12::swap_chain_resize(CommandQueueID p_cmd_queue, ERR_FAIL_COND_V(!SUCCEEDED(res), ERR_CANT_CREATE); } + if (surface->composition_device.Get() == nullptr) { + using PFN_DCompositionCreateDevice = HRESULT(WINAPI *)(IDXGIDevice *, REFIID, void **); + PFN_DCompositionCreateDevice pfn_DCompositionCreateDevice = (PFN_DCompositionCreateDevice)(void *)GetProcAddress(context_driver->lib_dcomp, "DCompositionCreateDevice"); + ERR_FAIL_NULL_V(pfn_DCompositionCreateDevice, ERR_CANT_CREATE); + + res = pfn_DCompositionCreateDevice(nullptr, IID_PPV_ARGS(surface->composition_device.GetAddressOf())); + ERR_FAIL_COND_V(!SUCCEEDED(res), ERR_CANT_CREATE); + + res = surface->composition_device->CreateTargetForHwnd(surface->hwnd, TRUE, surface->composition_target.GetAddressOf()); + ERR_FAIL_COND_V(!SUCCEEDED(res), ERR_CANT_CREATE); + + res = surface->composition_device->CreateVisual(surface->composition_visual.GetAddressOf()); + ERR_FAIL_COND_V(!SUCCEEDED(res), ERR_CANT_CREATE); + + res = surface->composition_visual->SetContent(swap_chain->d3d_swap_chain.Get()); + ERR_FAIL_COND_V(!SUCCEEDED(res), ERR_CANT_CREATE); + + res = surface->composition_target->SetRoot(surface->composition_visual.Get()); + ERR_FAIL_COND_V(!SUCCEEDED(res), ERR_CANT_CREATE); + + res = surface->composition_device->Commit(); + ERR_FAIL_COND_V(!SUCCEEDED(res), ERR_CANT_CREATE); + } else { + res = surface->composition_visual->SetContent(swap_chain->d3d_swap_chain.Get()); + ERR_FAIL_COND_V(!SUCCEEDED(res), ERR_CANT_CREATE); + + res = surface->composition_device->Commit(); + ERR_FAIL_COND_V(!SUCCEEDED(res), ERR_CANT_CREATE); + } + res = swap_chain->d3d_swap_chain->GetDesc1(&swap_chain_desc); ERR_FAIL_COND_V(!SUCCEEDED(res), ERR_CANT_CREATE); ERR_FAIL_COND_V(swap_chain_desc.BufferCount == 0, ERR_CANT_CREATE); @@ -6117,6 +6144,16 @@ uint64_t RenderingDeviceDriverD3D12::limit_get(Limit p_limit) { switch (p_limit) { case LIMIT_MAX_BOUND_UNIFORM_SETS: return safe_unbounded; + case LIMIT_MAX_TEXTURE_ARRAY_LAYERS: + return D3D12_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION; + case LIMIT_MAX_TEXTURE_SIZE_1D: + return D3D12_REQ_TEXTURE1D_U_DIMENSION; + case LIMIT_MAX_TEXTURE_SIZE_2D: + return D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION; + case LIMIT_MAX_TEXTURE_SIZE_3D: + return D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION; + case LIMIT_MAX_TEXTURE_SIZE_CUBE: + return D3D12_REQ_TEXTURECUBE_DIMENSION; case LIMIT_MAX_TEXTURES_PER_SHADER_STAGE: return device_limits.max_srvs_per_shader_stage; case LIMIT_MAX_UNIFORM_BUFFER_SIZE: diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp index 2fd3f7d7e27b..5fd90744a428 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.cpp +++ b/drivers/gles3/rasterizer_canvas_gles3.cpp @@ -720,11 +720,14 @@ void RasterizerCanvasGLES3::_render_items(RID p_to_render_target, int p_item_cou } } - bool success = GLES3::MaterialStorage::get_singleton()->shaders.canvas_shader.version_bind_shader(shader_version, variant, specialization); + bool success = material_storage->shaders.canvas_shader.version_bind_shader(shader_version, variant, specialization); if (!success) { continue; } + // Bind per-batch uniforms. + material_storage->shaders.canvas_shader.version_set_uniform(CanvasShaderGLES3::BATCH_FLAGS, state.canvas_instance_batches[i].flags, shader_version, variant, specialization); + GLES3::CanvasShaderData::BlendMode blend_mode = state.canvas_instance_batches[i].blend_mode; Color blend_color = state.canvas_instance_batches[i].blend_color; @@ -847,6 +850,7 @@ void RasterizerCanvasGLES3::_record_item_commands(const Item *p_item, RID p_rend uint32_t lights[4] = { 0, 0, 0, 0 }; uint16_t light_count = 0; + uint16_t shadow_mask = 0; { Light *light = p_lights; @@ -856,6 +860,10 @@ void RasterizerCanvasGLES3::_record_item_commands(const Item *p_item, RID p_rend uint32_t light_index = light->render_index_cache; lights[light_count >> 2] |= light_index << ((light_count & 3) * 8); + if (p_item->light_mask & light->item_shadow_mask) { + shadow_mask |= 1 << light_count; + } + light_count++; if (light_count == data.max_lights_per_item - 1) { @@ -865,7 +873,8 @@ void RasterizerCanvasGLES3::_record_item_commands(const Item *p_item, RID p_rend light = light->next_ptr; } - base_flags |= light_count << FLAGS_LIGHT_COUNT_SHIFT; + base_flags |= light_count << INSTANCE_FLAGS_LIGHT_COUNT_SHIFT; + base_flags |= shadow_mask << INSTANCE_FLAGS_SHADOW_MASKED_SHIFT; } bool lights_disabled = light_count == 0 && !state.using_directional_lights; @@ -906,7 +915,7 @@ void RasterizerCanvasGLES3::_record_item_commands(const Item *p_item, RID p_rend state.instance_data_array[r_index].lights[2] = lights[2]; state.instance_data_array[r_index].lights[3] = lights[3]; - state.instance_data_array[r_index].flags = base_flags | (state.instance_data_array[r_index == 0 ? 0 : r_index - 1].flags & (FLAGS_DEFAULT_NORMAL_MAP_USED | FLAGS_DEFAULT_SPECULAR_MAP_USED)); // Reset on each command for safety, keep canvastexture binding config. + state.instance_data_array[r_index].flags = base_flags; Color blend_color = base_color; GLES3::CanvasShaderData::BlendMode blend_mode = p_blend_mode; @@ -939,6 +948,7 @@ void RasterizerCanvasGLES3::_record_item_commands(const Item *p_item, RID p_rend state.canvas_instance_batches[state.current_batch_index].command_type = Item::Command::TYPE_RECT; state.canvas_instance_batches[state.current_batch_index].command = c; state.canvas_instance_batches[state.current_batch_index].specialization &= specialization_command_mask; + state.canvas_instance_batches[state.current_batch_index].flags = 0; } _prepare_canvas_texture(rect->texture, state.canvas_instance_batches[state.current_batch_index].filter, state.canvas_instance_batches[state.current_batch_index].repeat, r_index, texpixel_size); @@ -961,20 +971,18 @@ void RasterizerCanvasGLES3::_record_item_commands(const Item *p_item, RID p_rend if (rect->flags & CANVAS_RECT_FLIP_H) { src_rect.size.x *= -1; - state.instance_data_array[r_index].flags |= FLAGS_FLIP_H; } if (rect->flags & CANVAS_RECT_FLIP_V) { src_rect.size.y *= -1; - state.instance_data_array[r_index].flags |= FLAGS_FLIP_V; } if (rect->flags & CANVAS_RECT_TRANSPOSE) { - state.instance_data_array[r_index].flags |= FLAGS_TRANSPOSE_RECT; + state.instance_data_array[r_index].flags |= INSTANCE_FLAGS_TRANSPOSE_RECT; } if (rect->flags & CANVAS_RECT_CLIP_UV) { - state.instance_data_array[r_index].flags |= FLAGS_CLIP_RECT_UV; + state.instance_data_array[r_index].flags |= INSTANCE_FLAGS_CLIP_RECT_UV; } } else { @@ -993,13 +1001,13 @@ void RasterizerCanvasGLES3::_record_item_commands(const Item *p_item, RID p_rend } if (rect->flags & CANVAS_RECT_MSDF) { - state.instance_data_array[r_index].flags |= FLAGS_USE_MSDF; + state.instance_data_array[r_index].flags |= INSTANCE_FLAGS_USE_MSDF; state.instance_data_array[r_index].msdf[0] = rect->px_range; // Pixel range. state.instance_data_array[r_index].msdf[1] = rect->outline; // Outline size. state.instance_data_array[r_index].msdf[2] = 0.f; // Reserved. state.instance_data_array[r_index].msdf[3] = 0.f; // Reserved. } else if (rect->flags & CANVAS_RECT_LCD) { - state.instance_data_array[r_index].flags |= FLAGS_USE_LCD; + state.instance_data_array[r_index].flags |= INSTANCE_FLAGS_USE_LCD; } state.instance_data_array[r_index].modulation[0] = rect->modulate.r * base_color.r; @@ -1030,6 +1038,7 @@ void RasterizerCanvasGLES3::_record_item_commands(const Item *p_item, RID p_rend state.canvas_instance_batches[state.current_batch_index].command = c; state.canvas_instance_batches[state.current_batch_index].specialization &= specialization_command_mask; state.canvas_instance_batches[state.current_batch_index].specialization |= CanvasShaderGLES3::USE_NINEPATCH; + state.canvas_instance_batches[state.current_batch_index].flags = 0; } _prepare_canvas_texture(np->texture, state.canvas_instance_batches[state.current_batch_index].filter, state.canvas_instance_batches[state.current_batch_index].repeat, r_index, texpixel_size); @@ -1067,11 +1076,11 @@ void RasterizerCanvasGLES3::_record_item_commands(const Item *p_item, RID p_rend state.instance_data_array[r_index].dst_rect[2] = dst_rect.size.width; state.instance_data_array[r_index].dst_rect[3] = dst_rect.size.height; - state.instance_data_array[r_index].flags |= int(np->axis_x) << FLAGS_NINEPATCH_H_MODE_SHIFT; - state.instance_data_array[r_index].flags |= int(np->axis_y) << FLAGS_NINEPATCH_V_MODE_SHIFT; + state.instance_data_array[r_index].flags |= int(np->axis_x) << INSTANCE_FLAGS_NINEPATCH_H_MODE_SHIFT; + state.instance_data_array[r_index].flags |= int(np->axis_y) << INSTANCE_FLAGS_NINEPATCH_V_MODE_SHIFT; if (np->draw_center) { - state.instance_data_array[r_index].flags |= FLAGS_NINEPACH_DRAW_CENTER; + state.instance_data_array[r_index].flags |= INSTANCE_FLAGS_NINEPACH_DRAW_CENTER; } state.instance_data_array[r_index].ninepatch_margins[0] = np->margin[SIDE_LEFT]; @@ -1097,6 +1106,7 @@ void RasterizerCanvasGLES3::_record_item_commands(const Item *p_item, RID p_rend state.canvas_instance_batches[state.current_batch_index].command = c; state.canvas_instance_batches[state.current_batch_index].specialization &= specialization_command_mask; state.canvas_instance_batches[state.current_batch_index].specialization |= CanvasShaderGLES3::USE_ATTRIBUTES; + state.canvas_instance_batches[state.current_batch_index].flags = 0; _prepare_canvas_texture(polygon->texture, state.canvas_instance_batches[state.current_batch_index].filter, state.canvas_instance_batches[state.current_batch_index].repeat, r_index, texpixel_size); @@ -1125,6 +1135,7 @@ void RasterizerCanvasGLES3::_record_item_commands(const Item *p_item, RID p_rend state.canvas_instance_batches[state.current_batch_index].command = c; state.canvas_instance_batches[state.current_batch_index].specialization &= specialization_command_mask; state.canvas_instance_batches[state.current_batch_index].specialization |= CanvasShaderGLES3::USE_PRIMITIVE; + state.canvas_instance_batches[state.current_batch_index].flags = 0; } _prepare_canvas_texture(state.canvas_instance_batches[state.current_batch_index].tex, state.canvas_instance_batches[state.current_batch_index].filter, state.canvas_instance_batches[state.current_batch_index].repeat, r_index, texpixel_size); @@ -1165,12 +1176,13 @@ void RasterizerCanvasGLES3::_record_item_commands(const Item *p_item, RID p_rend case Item::Command::TYPE_MESH: case Item::Command::TYPE_MULTIMESH: case Item::Command::TYPE_PARTICLES: { - // Mesh's can't be batched, so always create a new batch + // Meshes can't be batched, so always create a new batch. _new_batch(r_batch_broken); Color modulate(1, 1, 1, 1); state.canvas_instance_batches[state.current_batch_index].specialization &= specialization_command_mask; state.canvas_instance_batches[state.current_batch_index].specialization |= CanvasShaderGLES3::USE_ATTRIBUTES; + state.canvas_instance_batches[state.current_batch_index].flags = 0; if (c->type == Item::Command::TYPE_MESH) { const Item::CommandMesh *m = static_cast(c); state.canvas_instance_batches[state.current_batch_index].tex = m->texture; @@ -1183,10 +1195,10 @@ void RasterizerCanvasGLES3::_record_item_commands(const Item *p_item, RID p_rend state.canvas_instance_batches[state.current_batch_index].specialization |= CanvasShaderGLES3::USE_INSTANCING; if (GLES3::MeshStorage::get_singleton()->multimesh_uses_colors(mm->multimesh)) { - state.instance_data_array[r_index].flags |= FLAGS_INSTANCING_HAS_COLORS; + state.canvas_instance_batches[state.current_batch_index].flags |= BATCH_FLAGS_INSTANCING_HAS_COLORS; } if (GLES3::MeshStorage::get_singleton()->multimesh_uses_custom_data(mm->multimesh)) { - state.instance_data_array[r_index].flags |= FLAGS_INSTANCING_HAS_CUSTOM_DATA; + state.canvas_instance_batches[state.current_batch_index].flags |= BATCH_FLAGS_INSTANCING_HAS_CUSTOM_DATA; } } else if (c->type == Item::Command::TYPE_PARTICLES) { GLES3::ParticlesStorage *particles_storage = GLES3::ParticlesStorage::get_singleton(); @@ -1196,8 +1208,8 @@ void RasterizerCanvasGLES3::_record_item_commands(const Item *p_item, RID p_rend RID particles = pt->particles; state.canvas_instance_batches[state.current_batch_index].tex = pt->texture; state.canvas_instance_batches[state.current_batch_index].specialization |= CanvasShaderGLES3::USE_INSTANCING; - state.instance_data_array[r_index].flags |= FLAGS_INSTANCING_HAS_COLORS; - state.instance_data_array[r_index].flags |= FLAGS_INSTANCING_HAS_CUSTOM_DATA; + state.canvas_instance_batches[state.current_batch_index].flags |= BATCH_FLAGS_INSTANCING_HAS_COLORS; + state.canvas_instance_batches[state.current_batch_index].flags |= BATCH_FLAGS_INSTANCING_HAS_CUSTOM_DATA; if (particles_storage->particles_has_collision(particles) && texture_storage->render_target_is_sdf_enabled(p_render_target)) { // Pass collision information. @@ -2364,15 +2376,15 @@ void RasterizerCanvasGLES3::_prepare_canvas_texture(RID p_texture, RS::CanvasIte GLES3::Texture *normal_map = texture_storage->get_texture(ct->normal_map); if (ct->specular_color.a < 0.999) { - state.instance_data_array[r_index].flags |= FLAGS_DEFAULT_SPECULAR_MAP_USED; + state.canvas_instance_batches[state.current_batch_index].flags |= BATCH_FLAGS_DEFAULT_SPECULAR_MAP_USED; } else { - state.instance_data_array[r_index].flags &= ~FLAGS_DEFAULT_SPECULAR_MAP_USED; + state.canvas_instance_batches[state.current_batch_index].flags &= ~BATCH_FLAGS_DEFAULT_SPECULAR_MAP_USED; } if (normal_map) { - state.instance_data_array[r_index].flags |= FLAGS_DEFAULT_NORMAL_MAP_USED; + state.canvas_instance_batches[state.current_batch_index].flags |= BATCH_FLAGS_DEFAULT_NORMAL_MAP_USED; } else { - state.instance_data_array[r_index].flags &= ~FLAGS_DEFAULT_NORMAL_MAP_USED; + state.canvas_instance_batches[state.current_batch_index].flags &= ~BATCH_FLAGS_DEFAULT_NORMAL_MAP_USED; } state.instance_data_array[r_index].specular_shininess = uint32_t(CLAMP(ct->specular_color.a * 255.0, 0, 255)) << 24; diff --git a/drivers/gles3/rasterizer_canvas_gles3.h b/drivers/gles3/rasterizer_canvas_gles3.h index b9d9a44e2aac..e099fd0cc020 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.h +++ b/drivers/gles3/rasterizer_canvas_gles3.h @@ -54,29 +54,27 @@ class RasterizerCanvasGLES3 : public RendererCanvasRender { _FORCE_INLINE_ void _update_transform_to_mat4(const Transform3D &p_transform, float *p_mat4); enum { + INSTANCE_FLAGS_LIGHT_COUNT_SHIFT = 0, // 4 bits for light count. - FLAGS_INSTANCING_MASK = 0x7F, - FLAGS_INSTANCING_HAS_COLORS = (1 << 7), - FLAGS_INSTANCING_HAS_CUSTOM_DATA = (1 << 8), + INSTANCE_FLAGS_CLIP_RECT_UV = (1 << 4), + INSTANCE_FLAGS_TRANSPOSE_RECT = (1 << 5), + INSTANCE_FLAGS_USE_MSDF = (1 << 6), + INSTANCE_FLAGS_USE_LCD = (1 << 7), - FLAGS_CLIP_RECT_UV = (1 << 9), - FLAGS_TRANSPOSE_RECT = (1 << 10), + INSTANCE_FLAGS_NINEPACH_DRAW_CENTER = (1 << 8), + INSTANCE_FLAGS_NINEPATCH_H_MODE_SHIFT = 9, + INSTANCE_FLAGS_NINEPATCH_V_MODE_SHIFT = 11, - FLAGS_NINEPACH_DRAW_CENTER = (1 << 12), - - FLAGS_USE_SKELETON = (1 << 15), - FLAGS_NINEPATCH_H_MODE_SHIFT = 16, - FLAGS_NINEPATCH_V_MODE_SHIFT = 18, - FLAGS_LIGHT_COUNT_SHIFT = 20, - - FLAGS_DEFAULT_NORMAL_MAP_USED = (1 << 26), - FLAGS_DEFAULT_SPECULAR_MAP_USED = (1 << 27), + INSTANCE_FLAGS_SHADOW_MASKED_SHIFT = 13, // 16 bits. + }; - FLAGS_USE_MSDF = (1 << 28), - FLAGS_USE_LCD = (1 << 29), + enum { + BATCH_FLAGS_INSTANCING_MASK = 0x7F, + BATCH_FLAGS_INSTANCING_HAS_COLORS = (1 << 7), + BATCH_FLAGS_INSTANCING_HAS_CUSTOM_DATA = (1 << 8), - FLAGS_FLIP_H = (1 << 30), - FLAGS_FLIP_V = (1 << 31), + BATCH_FLAGS_DEFAULT_NORMAL_MAP_USED = (1 << 9), + BATCH_FLAGS_DEFAULT_SPECULAR_MAP_USED = (1 << 10), }; enum { @@ -279,6 +277,8 @@ class RasterizerCanvasGLES3 : public RendererCanvasRender { const Item::Command *command = nullptr; Item::Command::Type command_type = Item::Command::TYPE_ANIMATION_SLICE; // Can default to any type that doesn't form a batch. uint32_t primitive_points = 0; + + uint32_t flags = 0; }; // DataBuffer contains our per-frame data. I.e. the resources that are updated each frame. diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index dfc7d02ac041..17bdcbcad34b 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -3314,10 +3314,6 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params, } material_storage->shaders.scene_shader.version_set_uniform(SceneShaderGLES3::OPAQUE_PREPASS_THRESHOLD, opaque_prepass_threshold, shader->version, instance_variant, spec_constants); - - prev_shader = shader; - prev_variant = instance_variant; - prev_spec_constants = spec_constants; } // Pass in lighting uniforms. @@ -3355,7 +3351,7 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params, } // Pass light count and array of light indices for base pass. - if ((prev_inst != inst || prev_shader != shader || prev_variant != instance_variant) && pass == 0) { + if ((prev_inst != inst || prev_shader != shader || prev_variant != instance_variant || prev_spec_constants != spec_constants) && pass == 0) { // Rebind the light indices. material_storage->shaders.scene_shader.version_set_uniform(SceneShaderGLES3::OMNI_LIGHT_COUNT, inst->omni_light_gl_cache.size(), shader->version, instance_variant, spec_constants); material_storage->shaders.scene_shader.version_set_uniform(SceneShaderGLES3::SPOT_LIGHT_COUNT, inst->spot_light_gl_cache.size(), shader->version, instance_variant, spec_constants); @@ -3412,11 +3408,14 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params, } else if (inst->lightmap_sh) { glUniform4fv(material_storage->shaders.scene_shader.version_get_uniform(SceneShaderGLES3::LIGHTMAP_CAPTURES, shader->version, instance_variant, spec_constants), 9, reinterpret_cast(inst->lightmap_sh->sh)); } - prev_inst = inst; } } + prev_shader = shader; + prev_variant = instance_variant; + prev_spec_constants = spec_constants; + // Pass in reflection probe data if constexpr (p_pass_mode == PASS_MODE_COLOR || p_pass_mode == PASS_MODE_COLOR_TRANSPARENT) { if (pass == 0 && inst->reflection_probe_rid_cache.size() > 0) { diff --git a/drivers/gles3/shaders/canvas.glsl b/drivers/gles3/shaders/canvas.glsl index 1ac289d5a244..3857aa8841a5 100644 --- a/drivers/gles3/shaders/canvas.glsl +++ b/drivers/gles3/shaders/canvas.glsl @@ -110,6 +110,9 @@ layout(std140) uniform MaterialUniforms{ //ubo:4 }; #endif + +uniform mediump uint batch_flags; + /* clang-format on */ #include "canvas_uniforms_inc.glsl" @@ -179,13 +182,13 @@ void main() { vec2 uv = uv_attrib; #ifdef USE_INSTANCING - if (bool(read_draw_data_flags & FLAGS_INSTANCING_HAS_COLORS)) { + if (bool(batch_flags & BATCH_FLAGS_INSTANCING_HAS_COLORS)) { vec4 instance_color; instance_color.xy = unpackHalf2x16(uint(instance_color_custom_data.x)); instance_color.zw = unpackHalf2x16(uint(instance_color_custom_data.y)); color *= instance_color; } - if (bool(read_draw_data_flags & FLAGS_INSTANCING_HAS_CUSTOM_DATA)) { + if (bool(batch_flags & BATCH_FLAGS_INSTANCING_HAS_CUSTOM_DATA)) { instance_custom.xy = unpackHalf2x16(instance_color_custom_data.z); instance_custom.zw = unpackHalf2x16(instance_color_custom_data.w); } @@ -218,7 +221,7 @@ void main() { else if (vertex_id == 5) vertex_base = vec2(1.0, 1.0); - vec2 uv = read_draw_data_src_rect.xy + abs(read_draw_data_src_rect.zw) * ((read_draw_data_flags & FLAGS_TRANSPOSE_RECT) != uint(0) ? vertex_base.yx : vertex_base.xy); + vec2 uv = read_draw_data_src_rect.xy + abs(read_draw_data_src_rect.zw) * ((read_draw_data_flags & INSTANCE_FLAGS_TRANSPOSE_RECT) != uint(0) ? vertex_base.yx : vertex_base.xy); vec4 color = read_draw_data_modulation; vec2 vertex = read_draw_data_dst_rect.xy + abs(read_draw_data_dst_rect.zw) * mix(vertex_base, vec2(1.0, 1.0) - vertex_base, lessThan(read_draw_data_src_rect.zw, vec2(0.0, 0.0))); @@ -336,6 +339,8 @@ uniform sampler2D specular_texture; //texunit:-7 uniform sampler2D color_texture; //texunit:0 +uniform mediump uint batch_flags; + layout(location = 0) out vec4 frag_color; /* clang-format off */ @@ -519,7 +524,7 @@ float map_ninepatch_axis(float pixel, float draw_size, float tex_pixel_size, flo } else if (pixel >= draw_size - margin_end) { return (tex_size - (draw_size - pixel)) * tex_pixel_size; } else { - if (!bool(read_draw_data_flags & FLAGS_NINEPACH_DRAW_CENTER)) { + if (!bool(read_draw_data_flags & INSTANCE_FLAGS_NINEPATCH_DRAW_CENTER)) { draw_center--; } @@ -567,8 +572,8 @@ void main() { int draw_center = 2; uv = vec2( - map_ninepatch_axis(pixel_size_interp.x, abs(read_draw_data_dst_rect_z), read_draw_data_color_texture_pixel_size.x, read_draw_data_ninepatch_margins.x, read_draw_data_ninepatch_margins.z, int(read_draw_data_flags >> FLAGS_NINEPATCH_H_MODE_SHIFT) & 0x3, draw_center), - map_ninepatch_axis(pixel_size_interp.y, abs(read_draw_data_dst_rect_w), read_draw_data_color_texture_pixel_size.y, read_draw_data_ninepatch_margins.y, read_draw_data_ninepatch_margins.w, int(read_draw_data_flags >> FLAGS_NINEPATCH_V_MODE_SHIFT) & 0x3, draw_center)); + map_ninepatch_axis(pixel_size_interp.x, abs(read_draw_data_dst_rect_z), read_draw_data_color_texture_pixel_size.x, read_draw_data_ninepatch_margins.x, read_draw_data_ninepatch_margins.z, int(read_draw_data_flags >> INSTANCE_FLAGS_NINEPATCH_H_MODE_SHIFT) & 0x3, draw_center), + map_ninepatch_axis(pixel_size_interp.y, abs(read_draw_data_dst_rect_w), read_draw_data_color_texture_pixel_size.y, read_draw_data_ninepatch_margins.y, read_draw_data_ninepatch_margins.w, int(read_draw_data_flags >> INSTANCE_FLAGS_NINEPATCH_V_MODE_SHIFT) & 0x3, draw_center)); if (draw_center == 0) { color.a = 0.0; @@ -577,7 +582,7 @@ void main() { uv = uv * read_draw_data_src_rect.zw + read_draw_data_src_rect.xy; //apply region if needed #endif - if (bool(read_draw_data_flags & FLAGS_CLIP_RECT_UV)) { + if (bool(read_draw_data_flags & INSTANCE_FLAGS_CLIP_RECT_UV)) { vec2 half_texpixel = read_draw_data_color_texture_pixel_size * 0.5; uv = clamp(uv, read_draw_data_src_rect.xy + half_texpixel, read_draw_data_src_rect.xy + abs(read_draw_data_src_rect.zw) - half_texpixel); } @@ -585,7 +590,7 @@ void main() { #endif #ifndef USE_PRIMITIVE - if (bool(read_draw_data_flags & FLAGS_USE_MSDF)) { + if (bool(read_draw_data_flags & INSTANCE_FLAGS_USE_MSDF)) { float px_range = read_draw_data_ninepatch_margins.x; float outline_thickness = read_draw_data_ninepatch_margins.y; @@ -603,7 +608,7 @@ void main() { float a = clamp(d * px_size + 0.5, 0.0, 1.0); color.a = a * color.a; } - } else if (bool(read_draw_data_flags & FLAGS_USE_LCD)) { + } else if (bool(read_draw_data_flags & INSTANCE_FLAGS_USE_LCD)) { vec4 lcd_sample = texture(color_texture, uv); if (lcd_sample.a == 1.0) { color.rgb = lcd_sample.rgb * color.a; @@ -617,7 +622,7 @@ void main() { color *= texture(color_texture, uv); } - uint light_count = (read_draw_data_flags >> uint(FLAGS_LIGHT_COUNT_SHIFT)) & uint(0xF); //max 16 lights + uint light_count = read_draw_data_flags & uint(0xF); // Max 16 lights. bool using_light = light_count > 0u || directional_light_count > 0u; vec3 normal; @@ -628,17 +633,16 @@ void main() { bool normal_used = false; #endif - if (normal_used || (using_light && bool(read_draw_data_flags & FLAGS_DEFAULT_NORMAL_MAP_USED))) { + if (normal_used || (using_light && bool(batch_flags & BATCH_FLAGS_DEFAULT_NORMAL_MAP_USED))) { normal.xy = texture(normal_texture, uv).xy * vec2(2.0, -2.0) - vec2(1.0, -1.0); - if (bool(read_draw_data_flags & FLAGS_TRANSPOSE_RECT)) { + +#if !defined(USE_ATTRIBUTES) && !defined(USE_PRIMITIVE) + if (bool(read_draw_data_flags & INSTANCE_FLAGS_TRANSPOSE_RECT)) { normal.xy = normal.yx; } - if (bool(read_draw_data_flags & FLAGS_FLIP_H)) { - normal.x = -normal.x; - } - if (bool(read_draw_data_flags & FLAGS_FLIP_V)) { - normal.y = -normal.y; - } + normal.xy *= sign(read_draw_data_src_rect.zw); +#endif + normal.z = sqrt(max(0.0, 1.0 - dot(normal.xy, normal.xy))); normal_used = true; } else { @@ -654,7 +658,7 @@ void main() { bool specular_shininess_used = false; #endif - if (specular_shininess_used || (using_light && normal_used && bool(read_draw_data_flags & FLAGS_DEFAULT_SPECULAR_MAP_USED))) { + if (specular_shininess_used || (using_light && normal_used && bool(batch_flags & BATCH_FLAGS_DEFAULT_SPECULAR_MAP_USED))) { specular_shininess = texture(specular_texture, uv); specular_shininess *= godot_unpackUnorm4x8(read_draw_data_specular_shininess); specular_shininess_used = true; @@ -727,7 +731,7 @@ void main() { } #endif - if (bool(light_array[light_base].flags & LIGHT_FLAGS_HAS_SHADOW)) { + if (bool(light_array[light_base].flags & LIGHT_FLAGS_HAS_SHADOW) && bool(read_draw_data_flags & uint(INSTANCE_FLAGS_SHADOW_MASKED << i))) { vec2 shadow_pos = (vec4(shadow_vertex, 0.0, 1.0) * mat4(light_array[light_base].shadow_matrix[0], light_array[light_base].shadow_matrix[1], vec4(0.0, 0.0, 1.0, 0.0), vec4(0.0, 0.0, 0.0, 1.0))).xy; //multiply inverse given its transposed. Optimizer removes useless operations. vec4 shadow_uv = vec4(shadow_pos.x, light_array[light_base].shadow_y_ofs, shadow_pos.y * light_array[light_base].shadow_zfar_inv, 1.0); @@ -802,7 +806,7 @@ void main() { } #endif - if (bool(light_array[light_base].flags & LIGHT_FLAGS_HAS_SHADOW)) { + if (bool(light_array[light_base].flags & LIGHT_FLAGS_HAS_SHADOW) && bool(read_draw_data_flags & uint(INSTANCE_FLAGS_SHADOW_MASKED << i))) { vec2 shadow_pos = (vec4(shadow_vertex, 0.0, 1.0) * mat4(light_array[light_base].shadow_matrix[0], light_array[light_base].shadow_matrix[1], vec4(0.0, 0.0, 1.0, 0.0), vec4(0.0, 0.0, 0.0, 1.0))).xy; //multiply inverse given its transposed. Optimizer removes useless operations. vec2 pos_norm = normalize(shadow_pos); diff --git a/drivers/gles3/shaders/canvas_uniforms_inc.glsl b/drivers/gles3/shaders/canvas_uniforms_inc.glsl index f6ad2b730ab8..94cbbdd8a7f5 100644 --- a/drivers/gles3/shaders/canvas_uniforms_inc.glsl +++ b/drivers/gles3/shaders/canvas_uniforms_inc.glsl @@ -1,33 +1,32 @@ - #define MAX_LIGHTS_PER_ITEM uint(16) #define M_PI 3.14159265359 #define SDF_MAX_LENGTH 16384.0 -//1 means enabled, 2+ means trails in use -#define FLAGS_INSTANCING_MASK uint(0x7F) -#define FLAGS_INSTANCING_HAS_COLORS uint(1 << 7) -#define FLAGS_INSTANCING_HAS_CUSTOM_DATA uint(1 << 8) - -#define FLAGS_CLIP_RECT_UV uint(1 << 9) -#define FLAGS_TRANSPOSE_RECT uint(1 << 10) -// (1 << 11) is for FLAGS_CONVERT_ATTRIBUTES_TO_LINEAR in RD backends, unused here. -#define FLAGS_NINEPACH_DRAW_CENTER uint(1 << 12) +#define INSTANCE_FLAGS_LIGHT_COUNT_SHIFT 0 // 4 bits. -#define FLAGS_NINEPATCH_H_MODE_SHIFT 16 -#define FLAGS_NINEPATCH_V_MODE_SHIFT 18 +#define INSTANCE_FLAGS_CLIP_RECT_UV uint(1 << 4) +#define INSTANCE_FLAGS_TRANSPOSE_RECT uint(1 << 5) +#define INSTANCE_FLAGS_USE_MSDF uint(1 << 6) +#define INSTANCE_FLAGS_USE_LCD uint(1 << 7) -#define FLAGS_LIGHT_COUNT_SHIFT 20 +#define INSTANCE_FLAGS_NINEPATCH_DRAW_CENTER uint(1 << 8) +#define INSTANCE_FLAGS_NINEPATCH_H_MODE_SHIFT 9 +#define INSTANCE_FLAGS_NINEPATCH_V_MODE_SHIFT 11 -#define FLAGS_DEFAULT_NORMAL_MAP_USED uint(1 << 26) -#define FLAGS_DEFAULT_SPECULAR_MAP_USED uint(1 << 27) +#define INSTANCE_FLAGS_SHADOW_MASKED_SHIFT 13u // 16 bits. +#define INSTANCE_FLAGS_SHADOW_MASKED uint(1 << INSTANCE_FLAGS_SHADOW_MASKED_SHIFT) -#define FLAGS_USE_MSDF uint(1 << 28) -#define FLAGS_USE_LCD uint(1 << 29) +// 1 means enabled, 2+ means trails in use +#define BATCH_FLAGS_INSTANCING_MASK uint(0x7F) +#define BATCH_FLAGS_INSTANCING_HAS_COLORS_SHIFT 7 +#define BATCH_FLAGS_INSTANCING_HAS_COLORS uint(1 << BATCH_FLAGS_INSTANCING_HAS_COLORS_SHIFT) +#define BATCH_FLAGS_INSTANCING_HAS_CUSTOM_DATA_SHIFT 8 +#define BATCH_FLAGS_INSTANCING_HAS_CUSTOM_DATA uint(1 << BATCH_FLAGS_INSTANCING_HAS_CUSTOM_DATA_SHIFT) -#define FLAGS_FLIP_H uint(1 << 30) -#define FLAGS_FLIP_V uint(1 << 31) +#define BATCH_FLAGS_DEFAULT_NORMAL_MAP_USED uint(1 << 9) +#define BATCH_FLAGS_DEFAULT_SPECULAR_MAP_USED uint(1 << 10) layout(std140) uniform GlobalShaderUniformData { //ubo:1 vec4 global_shader_uniforms[MAX_GLOBAL_SHADER_UNIFORMS]; diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index fcfbeddb9e4a..2022c8ee436f 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -1259,7 +1259,7 @@ float SchlickFresnel(float u) { return m2 * m2 * m; // pow(m,5) } -void light_compute(vec3 N, vec3 L, vec3 V, float A, vec3 light_color, bool is_directional, float attenuation, vec3 f0, float roughness, float metallic, float specular_amount, vec3 albedo, inout float alpha, +void light_compute(vec3 N, vec3 L, vec3 V, float A, vec3 light_color, bool is_directional, float attenuation, vec3 f0, float roughness, float metallic, float specular_amount, vec3 albedo, inout float alpha, vec2 screen_uv, #ifdef LIGHT_BACKLIGHT_USED vec3 backlight, #endif @@ -1423,7 +1423,7 @@ float get_omni_spot_attenuation(float distance, float inv_range, float decay) { } #if !defined(DISABLE_LIGHT_OMNI) || defined(ADDITIVE_OMNI) -void light_process_omni(uint idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 f0, float roughness, float metallic, float shadow, vec3 albedo, inout float alpha, +void light_process_omni(uint idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 f0, float roughness, float metallic, float shadow, vec3 albedo, inout float alpha, vec2 screen_uv, #ifdef LIGHT_BACKLIGHT_USED vec3 backlight, #endif @@ -1450,7 +1450,7 @@ void light_process_omni(uint idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 f omni_attenuation *= shadow; - light_compute(normal, normalize(light_rel_vec), eye_vec, size_A, color, false, omni_attenuation, f0, roughness, metallic, omni_lights[idx].specular_amount, albedo, alpha, + light_compute(normal, normalize(light_rel_vec), eye_vec, size_A, color, false, omni_attenuation, f0, roughness, metallic, omni_lights[idx].specular_amount, albedo, alpha, screen_uv, #ifdef LIGHT_BACKLIGHT_USED backlight, #endif @@ -1469,7 +1469,7 @@ void light_process_omni(uint idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 f #endif // !DISABLE_LIGHT_OMNI #if !defined(DISABLE_LIGHT_SPOT) || defined(ADDITIVE_SPOT) -void light_process_spot(uint idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 f0, float roughness, float metallic, float shadow, vec3 albedo, inout float alpha, +void light_process_spot(uint idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 f0, float roughness, float metallic, float shadow, vec3 albedo, inout float alpha, vec2 screen_uv, #ifdef LIGHT_BACKLIGHT_USED vec3 backlight, #endif @@ -1506,7 +1506,7 @@ void light_process_spot(uint idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 f spot_attenuation *= shadow; - light_compute(normal, normalize(light_rel_vec), eye_vec, size_A, color, false, spot_attenuation, f0, roughness, metallic, spot_lights[idx].specular_amount, albedo, alpha, + light_compute(normal, normalize(light_rel_vec), eye_vec, size_A, color, false, spot_attenuation, f0, roughness, metallic, spot_lights[idx].specular_amount, albedo, alpha, screen_uv, #ifdef LIGHT_BACKLIGHT_USED backlight, #endif @@ -2114,7 +2114,7 @@ void main() { continue; } #endif - light_compute(normal, normalize(directional_lights[i].direction), normalize(view), directional_lights[i].size, directional_lights[i].color * directional_lights[i].energy, true, 1.0, f0, roughness, metallic, 1.0, albedo, alpha, + light_compute(normal, normalize(directional_lights[i].direction), normalize(view), directional_lights[i].size, directional_lights[i].color * directional_lights[i].energy, true, 1.0, f0, roughness, metallic, 1.0, albedo, alpha, screen_uv, #ifdef LIGHT_BACKLIGHT_USED backlight, #endif @@ -2143,7 +2143,7 @@ void main() { continue; } #endif - light_process_omni(omni_light_indices[i], vertex, view, normal, f0, roughness, metallic, 1.0, albedo, alpha, + light_process_omni(omni_light_indices[i], vertex, view, normal, f0, roughness, metallic, 1.0, albedo, alpha, screen_uv, #ifdef LIGHT_BACKLIGHT_USED backlight, #endif @@ -2171,7 +2171,7 @@ void main() { continue; } #endif - light_process_spot(spot_light_indices[i], vertex, view, normal, f0, roughness, metallic, 1.0, albedo, alpha, + light_process_spot(spot_light_indices[i], vertex, view, normal, f0, roughness, metallic, 1.0, albedo, alpha, screen_uv, #ifdef LIGHT_BACKLIGHT_USED backlight, #endif @@ -2389,7 +2389,7 @@ void main() { #endif // SHADOWS_DISABLED #ifndef USE_VERTEX_LIGHTING - light_compute(normal, normalize(directional_lights[directional_shadow_index].direction), normalize(view), directional_lights[directional_shadow_index].size, directional_lights[directional_shadow_index].color * directional_lights[directional_shadow_index].energy, true, directional_shadow, f0, roughness, metallic, 1.0, albedo, alpha, + light_compute(normal, normalize(directional_lights[directional_shadow_index].direction), normalize(view), directional_lights[directional_shadow_index].size, directional_lights[directional_shadow_index].color * directional_lights[directional_shadow_index].energy, true, directional_shadow, f0, roughness, metallic, 1.0, albedo, alpha, screen_uv, #ifdef LIGHT_BACKLIGHT_USED backlight, #endif @@ -2421,7 +2421,7 @@ void main() { #endif // SHADOWS_DISABLED #ifndef USE_VERTEX_LIGHTING - light_process_omni(omni_light_index, vertex, view, normal, f0, roughness, metallic, omni_shadow, albedo, alpha, + light_process_omni(omni_light_index, vertex, view, normal, f0, roughness, metallic, omni_shadow, albedo, alpha, screen_uv, #ifdef LIGHT_BACKLIGHT_USED backlight, #endif @@ -2451,7 +2451,7 @@ void main() { #endif // SHADOWS_DISABLED #ifndef USE_VERTEX_LIGHTING - light_process_spot(spot_light_index, vertex, view, normal, f0, roughness, metallic, spot_shadow, albedo, alpha, + light_process_spot(spot_light_index, vertex, view, normal, f0, roughness, metallic, spot_shadow, albedo, alpha, screen_uv, #ifdef LIGHT_BACKLIGHT_USED backlight, #endif diff --git a/drivers/gles3/storage/light_storage.cpp b/drivers/gles3/storage/light_storage.cpp index 9b81430d45c0..886918a2f76e 100644 --- a/drivers/gles3/storage/light_storage.cpp +++ b/drivers/gles3/storage/light_storage.cpp @@ -1405,7 +1405,7 @@ bool LightStorage::shadow_atlas_update_light(RID p_atlas, RID p_light_instance, old_shadow = old_key & SHADOW_INDEX_MASK; // Only re-allocate if a better option is available, and enough time has passed. - should_realloc = shadow_atlas->quadrants[old_quadrant].subdivision != (uint32_t)best_subdiv && (shadow_atlas->quadrants[old_quadrant].shadows[old_shadow].alloc_tick - tick > shadow_atlas_realloc_tolerance_msec); + should_realloc = shadow_atlas->quadrants[old_quadrant].subdivision != (uint32_t)best_subdiv && (tick - shadow_atlas->quadrants[old_quadrant].shadows[old_shadow].alloc_tick > shadow_atlas_realloc_tolerance_msec); should_redraw = shadow_atlas->quadrants[old_quadrant].shadows[old_shadow].version != p_light_version; if (!should_realloc) { diff --git a/drivers/gles3/storage/mesh_storage.cpp b/drivers/gles3/storage/mesh_storage.cpp index 630bfdf1b7c2..e94054001e83 100644 --- a/drivers/gles3/storage/mesh_storage.cpp +++ b/drivers/gles3/storage/mesh_storage.cpp @@ -844,6 +844,7 @@ void MeshStorage::mesh_clear(RID p_mesh) { mesh->surface_count = 0; mesh->material_cache.clear(); mesh->has_bone_weights = false; + mesh->aabb = AABB(); mesh->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MESH); for (Mesh *E : mesh->shadow_owners) { diff --git a/drivers/metal/rendering_context_driver_metal.mm b/drivers/metal/rendering_context_driver_metal.mm index 199ec25d793b..ac53f7344707 100644 --- a/drivers/metal/rendering_context_driver_metal.mm +++ b/drivers/metal/rendering_context_driver_metal.mm @@ -172,7 +172,11 @@ void present(MDCommandBuffer *p_cmd_buffer) override final { count--; front = (front + 1) % frame_buffers.size(); - [p_cmd_buffer->get_command_buffer() presentDrawable:drawable afterMinimumDuration:present_minimum_duration]; + if (vsync_mode != DisplayServer::VSYNC_DISABLED) { + [p_cmd_buffer->get_command_buffer() presentDrawable:drawable afterMinimumDuration:present_minimum_duration]; + } else { + [p_cmd_buffer->get_command_buffer() presentDrawable:drawable]; + } } }; diff --git a/drivers/metal/rendering_device_driver_metal.mm b/drivers/metal/rendering_device_driver_metal.mm index 784c9d5ae8aa..976020abf1df 100644 --- a/drivers/metal/rendering_device_driver_metal.mm +++ b/drivers/metal/rendering_device_driver_metal.mm @@ -358,11 +358,25 @@ _FORCE_INLINE_ MTLSize mipmapLevelSizeFromSize(MTLSize p_size, NSUInteger p_leve } RDD::TextureID RenderingDeviceDriverMetal::texture_create_from_extension(uint64_t p_native_texture, TextureType p_type, DataFormat p_format, uint32_t p_array_layers, bool p_depth_stencil) { - id obj = (__bridge id)(void *)(uintptr_t)p_native_texture; - - // We only need to create a RDD::TextureID for an existing, natively-provided texture. - - return rid::make(obj); + id res = (__bridge id)(void *)(uintptr_t)p_native_texture; + + // If the requested format is different, we need to create a view. + MTLPixelFormat format = pixel_formats->getMTLPixelFormat(p_format); + if (res.pixelFormat != format) { + MTLTextureSwizzleChannels swizzle = MTLTextureSwizzleChannelsMake( + MTLTextureSwizzleRed, + MTLTextureSwizzleGreen, + MTLTextureSwizzleBlue, + MTLTextureSwizzleAlpha); + res = [res newTextureViewWithPixelFormat:format + textureType:res.textureType + levels:NSMakeRange(0, res.mipmapLevelCount) + slices:NSMakeRange(0, p_array_layers) + swizzle:swizzle]; + ERR_FAIL_NULL_V_MSG(res, TextureID(), "Unable to create texture view."); + } + + return rid::make(res); } RDD::TextureID RenderingDeviceDriverMetal::texture_create_shared(TextureID p_original_texture, const TextureView &p_view) { diff --git a/drivers/unix/file_access_unix.cpp b/drivers/unix/file_access_unix.cpp index 43ad0799babe..f2e4b3966be8 100644 --- a/drivers/unix/file_access_unix.cpp +++ b/drivers/unix/file_access_unix.cpp @@ -46,10 +46,18 @@ #include #endif -void FileAccessUnix::check_errors() const { +void FileAccessUnix::check_errors(bool p_write) const { ERR_FAIL_NULL_MSG(f, "File must be opened before use."); - if (feof(f)) { + last_error = OK; + if (ferror(f)) { + if (p_write) { + last_error = ERR_FILE_CANT_WRITE; + } else { + last_error = ERR_FILE_CANT_READ; + } + } + if (!p_write && feof(f)) { last_error = ERR_FILE_EOF; } } @@ -118,7 +126,7 @@ Error FileAccessUnix::open_internal(const String &p_path, int p_mode_flags) { last_error = ERR_FILE_CANT_OPEN; return last_error; } - fchmod(fd, 0666); + fchmod(fd, 0644); path = String::utf8(cs.ptr()); f = fdopen(fd, mode_string); @@ -217,7 +225,6 @@ String FileAccessUnix::get_real_path() const { void FileAccessUnix::seek(uint64_t p_position) { ERR_FAIL_NULL_MSG(f, "File must be opened before use."); - last_error = OK; if (fseeko(f, p_position, SEEK_SET)) { check_errors(); } @@ -256,7 +263,7 @@ uint64_t FileAccessUnix::get_length() const { } bool FileAccessUnix::eof_reached() const { - return last_error == ERR_FILE_EOF; + return feof(f); } uint64_t FileAccessUnix::get_buffer(uint8_t *p_dst, uint64_t p_length) const { @@ -295,10 +302,12 @@ void FileAccessUnix::flush() { fflush(f); } -void FileAccessUnix::store_buffer(const uint8_t *p_src, uint64_t p_length) { - ERR_FAIL_NULL_MSG(f, "File must be opened before use."); - ERR_FAIL_COND(!p_src && p_length > 0); - ERR_FAIL_COND(fwrite(p_src, 1, p_length, f) != p_length); +bool FileAccessUnix::store_buffer(const uint8_t *p_src, uint64_t p_length) { + ERR_FAIL_NULL_V_MSG(f, false, "File must be opened before use."); + ERR_FAIL_COND_V(!p_src && p_length > 0, false); + bool res = fwrite(p_src, 1, p_length, f) == p_length; + check_errors(true); + return res; } bool FileAccessUnix::file_exists(const String &p_path) { diff --git a/drivers/unix/file_access_unix.h b/drivers/unix/file_access_unix.h index 7caf8a14d7bf..66e4bccc2525 100644 --- a/drivers/unix/file_access_unix.h +++ b/drivers/unix/file_access_unix.h @@ -43,7 +43,7 @@ typedef void (*CloseNotificationFunc)(const String &p_file, int p_flags); class FileAccessUnix : public FileAccess { FILE *f = nullptr; int flags = 0; - void check_errors() const; + void check_errors(bool p_write = false) const; mutable Error last_error = OK; String save_path; String path; @@ -77,7 +77,7 @@ class FileAccessUnix : public FileAccess { virtual Error resize(int64_t p_length) override; virtual void flush() override; - virtual void store_buffer(const uint8_t *p_src, uint64_t p_length) override; ///< store an array of bytes + virtual bool store_buffer(const uint8_t *p_src, uint64_t p_length) override; ///< store an array of bytes virtual bool file_exists(const String &p_path) override; ///< return true if a file exists diff --git a/drivers/unix/file_access_unix_pipe.cpp b/drivers/unix/file_access_unix_pipe.cpp index 0a78429dec27..325cca08158f 100644 --- a/drivers/unix/file_access_unix_pipe.cpp +++ b/drivers/unix/file_access_unix_pipe.cpp @@ -70,7 +70,7 @@ Error FileAccessUnixPipe::open_internal(const String &p_path, int p_mode_flags) struct stat st = {}; int err = stat(path.utf8().get_data(), &st); if (err) { - if (mkfifo(path.utf8().get_data(), 0666) != 0) { + if (mkfifo(path.utf8().get_data(), 0600) != 0) { last_error = ERR_FILE_CANT_OPEN; return last_error; } @@ -150,14 +150,16 @@ Error FileAccessUnixPipe::get_error() const { return last_error; } -void FileAccessUnixPipe::store_buffer(const uint8_t *p_src, uint64_t p_length) { - ERR_FAIL_COND_MSG(fd[1] < 0, "Pipe must be opened before use."); - ERR_FAIL_COND(!p_src && p_length > 0); +bool FileAccessUnixPipe::store_buffer(const uint8_t *p_src, uint64_t p_length) { + ERR_FAIL_COND_V_MSG(fd[1] < 0, false, "Pipe must be opened before use."); + ERR_FAIL_COND_V(!p_src && p_length > 0, false); if (::write(fd[1], p_src, p_length) != (ssize_t)p_length) { last_error = ERR_FILE_CANT_WRITE; + return false; } else { last_error = OK; + return true; } } diff --git a/drivers/unix/file_access_unix_pipe.h b/drivers/unix/file_access_unix_pipe.h index 1a4199f23999..a95cbc8e614f 100644 --- a/drivers/unix/file_access_unix_pipe.h +++ b/drivers/unix/file_access_unix_pipe.h @@ -71,7 +71,7 @@ class FileAccessUnixPipe : public FileAccess { virtual Error resize(int64_t p_length) override { return ERR_UNAVAILABLE; } virtual void flush() override {} - virtual void store_buffer(const uint8_t *p_src, uint64_t p_length) override; ///< store an array of bytes + virtual bool store_buffer(const uint8_t *p_src, uint64_t p_length) override; ///< store an array of bytes virtual bool file_exists(const String &p_path) override { return false; } diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index ffc270cd36e1..1fc7816774cd 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -191,7 +191,7 @@ String OS_Unix::get_stdin_string(int64_t p_buffer_size) { Vector data; data.resize(p_buffer_size); if (fgets((char *)data.ptrw(), data.size(), stdin)) { - return String::utf8((char *)data.ptr()); + return String::utf8((char *)data.ptr()).replace("\r\n", "\n").rstrip("\n"); } return String(); } @@ -308,6 +308,10 @@ String OS_Unix::get_version() const { return ""; } +String OS_Unix::get_temp_path() const { + return "/tmp"; +} + double OS_Unix::get_unix_time() const { struct timeval tv_now; gettimeofday(&tv_now, nullptr); @@ -945,13 +949,13 @@ String OS_Unix::get_environment(const String &p_var) const { } void OS_Unix::set_environment(const String &p_var, const String &p_value) const { - ERR_FAIL_COND_MSG(p_var.is_empty() || p_var.contains("="), vformat("Invalid environment variable name '%s', cannot be empty or include '='.", p_var)); + ERR_FAIL_COND_MSG(p_var.is_empty() || p_var.contains_char('='), vformat("Invalid environment variable name '%s', cannot be empty or include '='.", p_var)); int err = setenv(p_var.utf8().get_data(), p_value.utf8().get_data(), /* overwrite: */ 1); ERR_FAIL_COND_MSG(err != 0, vformat("Failed setting environment variable '%s', the system is out of memory.", p_var)); } void OS_Unix::unset_environment(const String &p_var) const { - ERR_FAIL_COND_MSG(p_var.is_empty() || p_var.contains("="), vformat("Invalid environment variable name '%s', cannot be empty or include '='.", p_var)); + ERR_FAIL_COND_MSG(p_var.is_empty() || p_var.contains_char('='), vformat("Invalid environment variable name '%s', cannot be empty or include '='.", p_var)); unsetenv(p_var.utf8().get_data()); } diff --git a/drivers/unix/os_unix.h b/drivers/unix/os_unix.h index 2c7920c14262..d331b0fb8e82 100644 --- a/drivers/unix/os_unix.h +++ b/drivers/unix/os_unix.h @@ -76,6 +76,8 @@ class OS_Unix : public OS { virtual String get_distribution_name() const override; virtual String get_version() const override; + virtual String get_temp_path() const override; + virtual DateTime get_datetime(bool p_utc) const override; virtual TimeZoneInfo get_time_zone_info() const override; diff --git a/drivers/wasapi/audio_driver_wasapi.cpp b/drivers/wasapi/audio_driver_wasapi.cpp index b800e5f1f4bc..b5cb8da249af 100644 --- a/drivers/wasapi/audio_driver_wasapi.cpp +++ b/drivers/wasapi/audio_driver_wasapi.cpp @@ -92,7 +92,7 @@ __CRT_UUID_DECL(IAudioClient3, 0x7ED4EE07, 0x8E67, 0x4CD4, 0x8C, 0x1A, 0x2B, 0x7 #endif // __MINGW32__ || __MINGW64__ -#ifndef PKEY_Device_FriendlyName +#ifndef PKEY_Device_FriendlyNameGodot #undef DEFINE_PROPERTYKEY /* clang-format off */ @@ -100,7 +100,7 @@ __CRT_UUID_DECL(IAudioClient3, 0x7ED4EE07, 0x8E67, 0x4CD4, 0x8C, 0x1A, 0x2B, 0x7 const PROPERTYKEY id = { { a, b, c, { d, e, f, g, h, i, j, k, } }, l }; /* clang-format on */ -DEFINE_PROPERTYKEY(PKEY_Device_FriendlyName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14); +DEFINE_PROPERTYKEY(PKEY_Device_FriendlyNameGodot, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14); #endif const CLSID CLSID_MMDeviceEnumerator = __uuidof(MMDeviceEnumerator); @@ -234,7 +234,7 @@ Error AudioDriverWASAPI::audio_device_init(AudioDeviceWASAPI *p_device, bool p_i PROPVARIANT propvar; PropVariantInit(&propvar); - hr = props->GetValue(PKEY_Device_FriendlyName, &propvar); + hr = props->GetValue(PKEY_Device_FriendlyNameGodot, &propvar); ERR_BREAK(hr != S_OK); if (p_device->device_name == String(propvar.pwszVal)) { @@ -597,7 +597,7 @@ PackedStringArray AudioDriverWASAPI::audio_device_get_list(bool p_input) { PROPVARIANT propvar; PropVariantInit(&propvar); - hr = props->GetValue(PKEY_Device_FriendlyName, &propvar); + hr = props->GetValue(PKEY_Device_FriendlyNameGodot, &propvar); ERR_BREAK(hr != S_OK); list.push_back(String(propvar.pwszVal)); diff --git a/drivers/windows/file_access_windows.cpp b/drivers/windows/file_access_windows.cpp index 4a0e5e5f4994..062dd87aff81 100644 --- a/drivers/windows/file_access_windows.cpp +++ b/drivers/windows/file_access_windows.cpp @@ -52,10 +52,18 @@ #define S_ISREG(m) ((m) & _S_IFREG) #endif -void FileAccessWindows::check_errors() const { +void FileAccessWindows::check_errors(bool p_write) const { ERR_FAIL_NULL(f); - if (feof(f)) { + last_error = OK; + if (ferror(f)) { + if (p_write) { + last_error = ERR_FILE_CANT_WRITE; + } else { + last_error = ERR_FILE_CANT_READ; + } + } + if (!p_write && feof(f)) { last_error = ERR_FILE_EOF; } } @@ -284,7 +292,6 @@ bool FileAccessWindows::is_open() const { void FileAccessWindows::seek(uint64_t p_position) { ERR_FAIL_NULL(f); - last_error = OK; if (_fseeki64(f, p_position, SEEK_SET)) { check_errors(); } @@ -320,8 +327,7 @@ uint64_t FileAccessWindows::get_length() const { } bool FileAccessWindows::eof_reached() const { - check_errors(); - return last_error == ERR_FILE_EOF; + return feof(f); } uint64_t FileAccessWindows::get_buffer(uint8_t *p_dst, uint64_t p_length) const { @@ -372,9 +378,9 @@ void FileAccessWindows::flush() { } } -void FileAccessWindows::store_buffer(const uint8_t *p_src, uint64_t p_length) { - ERR_FAIL_NULL(f); - ERR_FAIL_COND(!p_src && p_length > 0); +bool FileAccessWindows::store_buffer(const uint8_t *p_src, uint64_t p_length) { + ERR_FAIL_NULL_V(f, false); + ERR_FAIL_COND_V(!p_src && p_length > 0, false); if (flags == READ_WRITE || flags == WRITE_READ) { if (prev_op == READ) { @@ -385,7 +391,9 @@ void FileAccessWindows::store_buffer(const uint8_t *p_src, uint64_t p_length) { prev_op = WRITE; } - ERR_FAIL_COND(fwrite(p_src, 1, p_length, f) != (size_t)p_length); + bool res = fwrite(p_src, 1, p_length, f) == (size_t)p_length; + check_errors(true); + return res; } bool FileAccessWindows::file_exists(const String &p_name) { @@ -525,6 +533,9 @@ void FileAccessWindows::initialize() { invalid_files.insert(reserved_files[reserved_file_index]); reserved_file_index++; } + + _setmaxstdio(8192); + print_verbose(vformat("Maximum number of file handles: %d", _getmaxstdio())); } void FileAccessWindows::finalize() { diff --git a/drivers/windows/file_access_windows.h b/drivers/windows/file_access_windows.h index f458ff9c6c60..bf848d631246 100644 --- a/drivers/windows/file_access_windows.h +++ b/drivers/windows/file_access_windows.h @@ -41,7 +41,7 @@ class FileAccessWindows : public FileAccess { FILE *f = nullptr; int flags = 0; - void check_errors() const; + void check_errors(bool p_write = false) const; mutable int prev_op = 0; mutable Error last_error = OK; String path; @@ -75,7 +75,7 @@ class FileAccessWindows : public FileAccess { virtual Error resize(int64_t p_length) override; virtual void flush() override; - virtual void store_buffer(const uint8_t *p_src, uint64_t p_length) override; ///< store an array of bytes + virtual bool store_buffer(const uint8_t *p_src, uint64_t p_length) override; ///< store an array of bytes virtual bool file_exists(const String &p_name) override; ///< return true if a file exists diff --git a/drivers/windows/file_access_windows_pipe.cpp b/drivers/windows/file_access_windows_pipe.cpp index 7348b29a92b7..88e76f67ef50 100644 --- a/drivers/windows/file_access_windows_pipe.cpp +++ b/drivers/windows/file_access_windows_pipe.cpp @@ -119,16 +119,18 @@ Error FileAccessWindowsPipe::get_error() const { return last_error; } -void FileAccessWindowsPipe::store_buffer(const uint8_t *p_src, uint64_t p_length) { - ERR_FAIL_COND_MSG(fd[1] == nullptr, "Pipe must be opened before use."); - ERR_FAIL_COND(!p_src && p_length > 0); +bool FileAccessWindowsPipe::store_buffer(const uint8_t *p_src, uint64_t p_length) { + ERR_FAIL_COND_V_MSG(fd[1] == nullptr, false, "Pipe must be opened before use."); + ERR_FAIL_COND_V(!p_src && p_length > 0, false); DWORD read = -1; bool ok = WriteFile(fd[1], p_src, p_length, &read, nullptr); if (!ok || read != p_length) { last_error = ERR_FILE_CANT_WRITE; + return false; } else { last_error = OK; + return true; } } diff --git a/drivers/windows/file_access_windows_pipe.h b/drivers/windows/file_access_windows_pipe.h index 5edf0500a59d..b01b48fe133e 100644 --- a/drivers/windows/file_access_windows_pipe.h +++ b/drivers/windows/file_access_windows_pipe.h @@ -70,7 +70,7 @@ class FileAccessWindowsPipe : public FileAccess { virtual Error resize(int64_t p_length) override { return ERR_UNAVAILABLE; } virtual void flush() override {} - virtual void store_buffer(const uint8_t *p_src, uint64_t p_length) override; ///< store an array of bytes + virtual bool store_buffer(const uint8_t *p_src, uint64_t p_length) override; ///< store an array of bytes virtual bool file_exists(const String &p_name) override { return false; } diff --git a/editor/action_map_editor.cpp b/editor/action_map_editor.cpp index cf5b18ce3cfb..a881f2e3bae7 100644 --- a/editor/action_map_editor.cpp +++ b/editor/action_map_editor.cpp @@ -571,7 +571,7 @@ ActionMapEditor::ActionMapEditor() { add_edit->set_placeholder(TTR("Add New Action")); add_edit->set_clear_button_enabled(true); add_edit->connect(SceneStringName(text_changed), callable_mp(this, &ActionMapEditor::_add_edit_text_changed)); - add_edit->connect("text_submitted", callable_mp(this, &ActionMapEditor::_add_action)); + add_edit->connect(SceneStringName(text_submitted), callable_mp(this, &ActionMapEditor::_add_action)); add_hbox->add_child(add_edit); add_button = memnew(Button); diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 19e0647fb7d1..17191197ff09 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -1298,12 +1298,12 @@ void AnimationTimelineEdit::_zoom_changed(double) { double timeline_right = timeline_left + timeline_width_seconds; double timeline_center = timeline_left + timeline_width_seconds / 2.0; - if (zoom_callback_occured) { // Zooming with scroll wheel will focus on the position of the mouse. + if (zoom_callback_occurred) { // Zooming with scroll wheel will focus on the position of the mouse. double zoom_scroll_origin_norm = (zoom_scroll_origin.x - get_name_limit()) / timeline_width_pixels; zoom_scroll_origin_norm = MAX(zoom_scroll_origin_norm, 0); zoom_pivot = timeline_left + timeline_width_seconds * zoom_scroll_origin_norm; zoom_pivot_delta = updated_timeline_width_seconds * zoom_scroll_origin_norm; - zoom_callback_occured = false; + zoom_callback_occurred = false; } else { // Zooming with slider will depend on the current play position. // If the play position is not in range, or exactly in the center, zoom in on the center. if (get_play_position() < timeline_left || get_play_position() > timeline_left + timeline_width_seconds || get_play_position() == timeline_center) { @@ -1400,12 +1400,26 @@ void AnimationTimelineEdit::_anim_loop_pressed() { undo_redo->add_undo_method(this, "update_values"); undo_redo->commit_action(); } else { - String base_path = animation->get_path(); - if (FileAccess::exists(base_path + ".import")) { - EditorNode::get_singleton()->show_warning(TTR("Can't change loop mode on animation instanced from imported scene.")); + String base = animation->get_path(); + int srpos = base.find("::"); + if (srpos != -1) { + base = animation->get_path().substr(0, srpos); + } + + if (FileAccess::exists(base + ".import")) { + if (ResourceLoader::get_resource_type(base) == "PackedScene") { + EditorNode::get_singleton()->show_warning(TTR("Can't change loop mode on animation instanced from an imported scene.\n\nTo change this animation's loop mode, navigate to the scene's Advanced Import settings and select the animation.\nYou can then change the loop mode from the inspector menu.")); + } else { + EditorNode::get_singleton()->show_warning(TTR("Can't change loop mode on animation instanced from an imported resource.")); + } } else { - EditorNode::get_singleton()->show_warning(TTR("Can't change loop mode on animation embedded in another scene.")); + if (ResourceLoader::get_resource_type(base) == "PackedScene") { + EditorNode::get_singleton()->show_warning(TTR("Can't change loop mode on animation embedded in another scene.\n\nYou must open this scene and change the animation's loop mode from there.")); + } else { + EditorNode::get_singleton()->show_warning(TTR("Can't change loop mode on animation embedded in another resource.")); + } } + update_values(); } } @@ -1938,7 +1952,7 @@ void AnimationTimelineEdit::_pan_callback(Vector2 p_scroll_vec, Ref void AnimationTimelineEdit::_zoom_callback(float p_zoom_factor, Vector2 p_origin, Ref p_event) { double current_zoom_value = get_zoom()->get_value(); zoom_scroll_origin = p_origin; - zoom_callback_occured = true; + zoom_callback_occurred = true; get_zoom()->set_value(MAX(0.01, current_zoom_value - (1.0 - p_zoom_factor))); } @@ -3110,7 +3124,7 @@ void AnimationTrackEdit::gui_input(const Ref &p_event) { path = memnew(LineEdit); path_popup->add_child(path); path->set_anchors_and_offsets_preset(PRESET_FULL_RECT); - path->connect("text_submitted", callable_mp(this, &AnimationTrackEdit::_path_submitted)); + path->connect(SceneStringName(text_submitted), callable_mp(this, &AnimationTrackEdit::_path_submitted)); } path->set_text(animation->track_get_path(track)); @@ -6628,6 +6642,7 @@ void AnimationTrackEditor::_edit_menu_pressed(int p_option) { case EDIT_SCALE_SELECTION: case EDIT_SCALE_FROM_CURSOR: { scale_dialog->popup_centered(Size2(200, 100) * EDSCALE); + scale->get_line_edit()->grab_focus(); } break; case EDIT_SCALE_CONFIRM: { if (selection.is_empty()) { @@ -7875,10 +7890,13 @@ AnimationTrackEditor::AnimationTrackEditor() { scale->set_min(-99999); scale->set_max(99999); scale->set_step(0.001); + scale->set_select_all_on_focus(true); vbc->add_margin_child(TTR("Scale Ratio:"), scale); - scale_dialog->connect(SceneStringName(confirmed), callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed).bind(EDIT_SCALE_CONFIRM)); + scale_dialog->connect(SceneStringName(confirmed), callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed).bind(EDIT_SCALE_CONFIRM), CONNECT_DEFERRED); add_child(scale_dialog); + scale_dialog->register_text_enter(scale->get_line_edit()); + // ease_dialog = memnew(ConfirmationDialog); ease_dialog->set_title(TTR("Select Transition and Easing")); diff --git a/editor/animation_track_editor.h b/editor/animation_track_editor.h index f17386b0c903..5d998aed66f1 100644 --- a/editor/animation_track_editor.h +++ b/editor/animation_track_editor.h @@ -232,7 +232,7 @@ class AnimationTimelineEdit : public Range { double hscroll_on_zoom_buffer = -1.0; Vector2 zoom_scroll_origin; - bool zoom_callback_occured = false; + bool zoom_callback_occurred = false; virtual void gui_input(const Ref &p_event) override; void _track_added(int p_track); diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 05eeef4fc93c..0c3f91fd1b45 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -758,7 +758,7 @@ FindReplaceBar::FindReplaceBar() { search_text->set_tooltip_text(TTR("Find")); search_text->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); search_text->connect(SceneStringName(text_changed), callable_mp(this, &FindReplaceBar::_search_text_changed)); - search_text->connect("text_submitted", callable_mp(this, &FindReplaceBar::_search_text_submitted)); + search_text->connect(SceneStringName(text_submitted), callable_mp(this, &FindReplaceBar::_search_text_submitted)); search_text->connect(SceneStringName(focus_exited), callable_mp(this, &FindReplaceBar::_focus_lost)); matches_label = memnew(Label); @@ -797,7 +797,7 @@ FindReplaceBar::FindReplaceBar() { replace_text->set_placeholder(TTR("Replace")); replace_text->set_tooltip_text(TTR("Replace")); replace_text->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); - replace_text->connect("text_submitted", callable_mp(this, &FindReplaceBar::_replace_text_submitted)); + replace_text->connect(SceneStringName(text_submitted), callable_mp(this, &FindReplaceBar::_replace_text_submitted)); replace_text->connect(SceneStringName(focus_exited), callable_mp(this, &FindReplaceBar::_focus_lost)); replace = memnew(Button); diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index d76c324be05c..53b1f2a759a9 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -523,7 +523,7 @@ void ConnectDialog::set_dst_node(Node *p_node) { StringName ConnectDialog::get_dst_method_name() const { String txt = dst_method->get_text(); - if (txt.contains("(")) { + if (txt.contains_char('(')) { txt = txt.left(txt.find_char('(')).strip_edges(); } return txt; @@ -907,7 +907,7 @@ ConnectDialog::~ConnectDialog() { Control *ConnectionsDockTree::make_custom_tooltip(const String &p_text) const { // If it's not a doc tooltip, fallback to the default one. - if (p_text.contains("::")) { + if (p_text.is_empty() || p_text.contains("::")) { return nullptr; } diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 2273014f720e..c66adb63e86c 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -764,6 +764,7 @@ CreateDialog::CreateDialog() { favorites->connect("cell_selected", callable_mp(this, &CreateDialog::_favorite_selected)); favorites->connect("item_activated", callable_mp(this, &CreateDialog::_favorite_activated)); favorites->add_theme_constant_override("draw_guides", 1); + favorites->set_theme_type_variation("TreeSecondary"); SET_DRAG_FORWARDING_GCD(favorites, CreateDialog); fav_vb->add_margin_child(TTR("Favorites:"), favorites, true); @@ -779,6 +780,7 @@ CreateDialog::CreateDialog() { recent->connect(SceneStringName(item_selected), callable_mp(this, &CreateDialog::_history_selected)); recent->connect("item_activated", callable_mp(this, &CreateDialog::_history_activated)); recent->add_theme_constant_override("draw_guides", 1); + recent->set_theme_type_variation("ItemListSecondary"); VBoxContainer *vbc = memnew(VBoxContainer); vbc->set_custom_minimum_size(Size2(300, 0) * EDSCALE); diff --git a/editor/debugger/debug_adapter/debug_adapter_parser.cpp b/editor/debugger/debug_adapter/debug_adapter_parser.cpp index 904085630ba7..30abbbce8eb5 100644 --- a/editor/debugger/debug_adapter/debug_adapter_parser.cpp +++ b/editor/debugger/debug_adapter/debug_adapter_parser.cpp @@ -359,7 +359,7 @@ Dictionary DebugAdapterParser::req_setBreakpoints(const Dictionary &p_params) co } // If path contains \, it's a Windows path, so we need to convert it to /, and make the drive letter uppercase - if (source.path.contains("\\")) { + if (source.path.contains_char('\\')) { source.path = source.path.replace("\\", "/"); source.path = source.path.substr(0, 1).to_upper() + source.path.substr(1); } diff --git a/editor/debugger/debug_adapter/debug_adapter_parser.h b/editor/debugger/debug_adapter/debug_adapter_parser.h index 8fd2c2b3e26e..61cd6c7f9419 100644 --- a/editor/debugger/debug_adapter/debug_adapter_parser.h +++ b/editor/debugger/debug_adapter/debug_adapter_parser.h @@ -47,7 +47,7 @@ class DebugAdapterParser : public Object { _FORCE_INLINE_ bool is_valid_path(const String &p_path) const { // If path contains \, it's a Windows path, so we need to convert it to /, and check as case-insensitive. - if (p_path.contains("\\")) { + if (p_path.contains_char('\\')) { String project_path = ProjectSettings::get_singleton()->get_resource_path(); String path = p_path.replace("\\", "/"); return path.containsn(project_path); diff --git a/editor/debugger/debug_adapter/debug_adapter_protocol.cpp b/editor/debugger/debug_adapter/debug_adapter_protocol.cpp index 066cf6330149..ba4c078d7ed5 100644 --- a/editor/debugger/debug_adapter/debug_adapter_protocol.cpp +++ b/editor/debugger/debug_adapter/debug_adapter_protocol.cpp @@ -1247,7 +1247,7 @@ DebugAdapterProtocol::DebugAdapterProtocol() { debugger_node->connect("breakpoint_toggled", callable_mp(this, &DebugAdapterProtocol::on_debug_breakpoint_toggled)); debugger_node->get_default_debugger()->connect("stopped", callable_mp(this, &DebugAdapterProtocol::on_debug_stopped)); - debugger_node->get_default_debugger()->connect("output", callable_mp(this, &DebugAdapterProtocol::on_debug_output)); + debugger_node->get_default_debugger()->connect(SceneStringName(output), callable_mp(this, &DebugAdapterProtocol::on_debug_output)); debugger_node->get_default_debugger()->connect("breaked", callable_mp(this, &DebugAdapterProtocol::on_debug_breaked)); debugger_node->get_default_debugger()->connect("stack_dump", callable_mp(this, &DebugAdapterProtocol::on_debug_stack_dump)); debugger_node->get_default_debugger()->connect("stack_frame_vars", callable_mp(this, &DebugAdapterProtocol::on_debug_stack_frame_vars)); diff --git a/editor/debugger/editor_debugger_node.cpp b/editor/debugger/editor_debugger_node.cpp index 909651da454e..f06d9be78f58 100644 --- a/editor/debugger/editor_debugger_node.cpp +++ b/editor/debugger/editor_debugger_node.cpp @@ -120,7 +120,7 @@ ScriptEditorDebugger *EditorDebuggerNode::_add_debugger() { tabs->add_child(node); - node->set_name("Session " + itos(tabs->get_tab_count())); + node->set_name(vformat(TTR("Session %d"), tabs->get_tab_count())); if (tabs->get_tab_count() > 1) { node->clear_style(); tabs->set_tabs_visible(true); diff --git a/editor/debugger/editor_expression_evaluator.cpp b/editor/debugger/editor_expression_evaluator.cpp index 25e9c9eac379..369361cdbac9 100644 --- a/editor/debugger/editor_expression_evaluator.cpp +++ b/editor/debugger/editor_expression_evaluator.cpp @@ -110,7 +110,7 @@ EditorExpressionEvaluator::EditorExpressionEvaluator() { expression_input->set_h_size_flags(Control::SIZE_EXPAND_FILL); expression_input->set_placeholder(TTR("Expression to evaluate")); expression_input->set_clear_button_enabled(true); - expression_input->connect("text_submitted", callable_mp(this, &EditorExpressionEvaluator::_evaluate).unbind(1)); + expression_input->connect(SceneStringName(text_submitted), callable_mp(this, &EditorExpressionEvaluator::_evaluate).unbind(1)); expression_input->connect(SceneStringName(text_changed), callable_mp(this, &EditorExpressionEvaluator::_on_expression_input_changed)); hb->add_child(expression_input); diff --git a/editor/debugger/editor_performance_profiler.cpp b/editor/debugger/editor_performance_profiler.cpp index 1ea9a6653478..41e7d4024ff1 100644 --- a/editor/debugger/editor_performance_profiler.cpp +++ b/editor/debugger/editor_performance_profiler.cpp @@ -81,6 +81,9 @@ void EditorPerformanceProfiler::Monitor::reset() { String EditorPerformanceProfiler::_create_label(float p_value, Performance::MonitorType p_type) { switch (p_type) { + case Performance::MONITOR_TYPE_QUANTITY: { + return TS->format_number(itos(p_value)); + } case Performance::MONITOR_TYPE_MEMORY: { return String::humanize_size(p_value); } @@ -393,17 +396,23 @@ EditorPerformanceProfiler::EditorPerformanceProfiler() { set_split_offset(340 * EDSCALE); monitor_tree = memnew(Tree); + monitor_tree->set_custom_minimum_size(Size2(300, 0) * EDSCALE); monitor_tree->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); monitor_tree->set_columns(2); monitor_tree->set_column_title(0, TTR("Monitor")); + monitor_tree->set_column_expand(0, true); monitor_tree->set_column_title(1, TTR("Value")); + monitor_tree->set_column_custom_minimum_width(1, 100 * EDSCALE); + monitor_tree->set_column_expand(1, false); monitor_tree->set_column_titles_visible(true); monitor_tree->connect("item_edited", callable_mp(this, &EditorPerformanceProfiler::_monitor_select)); monitor_tree->create_item(); monitor_tree->set_hide_root(true); + monitor_tree->set_theme_type_variation("TreeSecondary"); add_child(monitor_tree); monitor_draw = memnew(Control); + monitor_draw->set_custom_minimum_size(Size2(300, 0) * EDSCALE); monitor_draw->set_clip_contents(true); monitor_draw->connect(SceneStringName(draw), callable_mp(this, &EditorPerformanceProfiler::_monitor_draw)); monitor_draw->connect(SceneStringName(gui_input), callable_mp(this, &EditorPerformanceProfiler::_marker_input)); diff --git a/editor/debugger/editor_profiler.cpp b/editor/debugger/editor_profiler.cpp index 33fa208f70a3..567f552298e9 100644 --- a/editor/debugger/editor_profiler.cpp +++ b/editor/debugger/editor_profiler.cpp @@ -152,6 +152,11 @@ Color EditorProfiler::_get_color_from_signature(const StringName &p_signature) c return c.lerp(get_theme_color(SNAME("base_color"), EditorStringName(Editor)), 0.07); } +int EditorProfiler::_get_zoom_left_border() const { + const int max_profiles_shown = frame_metrics.size() / Math::exp(graph_zoom); + return CLAMP(zoom_center - max_profiles_shown / 2, 0, frame_metrics.size() - max_profiles_shown); +} + void EditorProfiler::_item_edited() { if (updating_frame) { return; @@ -237,12 +242,17 @@ void EditorProfiler::_update_plot() { HashMap prev_plots; - for (int i = 0; i < total_metrics * w / frame_metrics.size() - 1; i++) { + const int max_profiles_shown = frame_metrics.size() / Math::exp(graph_zoom); + const int left_border = _get_zoom_left_border(); + const int profiles_drawn = CLAMP(total_metrics - left_border, 0, max_profiles_shown); + const int pixel_cols = (profiles_drawn * w) / max_profiles_shown - 1; + + for (int i = 0; i < pixel_cols; i++) { for (int j = 0; j < h * 4; j++) { column[j] = 0; } - int current = i * frame_metrics.size() / w; + int current = (i * max_profiles_shown / w) + left_border; for (const StringName &E : plot_sigs) { const Metric &m = _get_frame_metric(current); @@ -449,10 +459,12 @@ void EditorProfiler::_graph_tex_draw() { } if (seeking) { int frame = cursor_metric_edit->get_value() - _get_frame_metric(0).frame_number; - int cur_x = (2 * frame + 1) * graph->get_size().x / (2 * frame_metrics.size()) + 1; + frame = frame - _get_zoom_left_border() + 1; + int cur_x = (frame * graph->get_size().width * Math::exp(graph_zoom)) / frame_metrics.size(); + cur_x = CLAMP(cur_x, 0, graph->get_size().width); graph->draw_line(Vector2(cur_x, 0), Vector2(cur_x, graph->get_size().y), theme_cache.seek_line_color); } - if (hover_metric > -1 && hover_metric < total_metrics) { + if (hover_metric > -1) { int cur_x = (2 * hover_metric + 1) * graph->get_size().x / (2 * frame_metrics.size()) + 1; graph->draw_line(Vector2(cur_x, 0), Vector2(cur_x, graph->get_size().y), theme_cache.seek_line_hover_color); } @@ -480,22 +492,17 @@ void EditorProfiler::_graph_tex_input(const Ref &p_ev) { Ref me = p_ev; Ref mb = p_ev; Ref mm = p_ev; + MouseButton button_idx = mb.is_valid() ? mb->get_button_index() : MouseButton(); if ( - (mb.is_valid() && mb->get_button_index() == MouseButton::LEFT && mb->is_pressed()) || + (mb.is_valid() && button_idx == MouseButton::LEFT && mb->is_pressed()) || (mm.is_valid())) { int x = me->get_position().x - 1; - x = x * frame_metrics.size() / graph->get_size().width; - - hover_metric = x; + hover_metric = x * frame_metrics.size() / graph->get_size().width; - if (x < 0) { - x = 0; - } - - if (x >= frame_metrics.size()) { - x = frame_metrics.size() - 1; - } + x = x * frame_metrics.size() / graph->get_size().width; + x = x / Math::exp(graph_zoom) + _get_zoom_left_border(); + x = CLAMP(x, 0, frame_metrics.size() - 1); if (mb.is_valid() || (mm->get_button_mask().has_flag(MouseButtonMask::LEFT))) { updating_frame = true; @@ -518,9 +525,34 @@ void EditorProfiler::_graph_tex_input(const Ref &p_ev) { frame_delay->start(); } } + } + + if (graph_zoom > 0 && mm.is_valid() && (mm->get_button_mask().has_flag(MouseButtonMask::MIDDLE) || mm->get_button_mask().has_flag(MouseButtonMask::RIGHT))) { + // Panning. + const int max_profiles_shown = frame_metrics.size() / Math::exp(graph_zoom); + pan_accumulator += (float)mm->get_relative().x * max_profiles_shown / graph->get_size().width; + + if (Math::abs(pan_accumulator) > 1) { + zoom_center = CLAMP(zoom_center - (int)pan_accumulator, max_profiles_shown / 2, frame_metrics.size() - max_profiles_shown / 2); + pan_accumulator -= (int)pan_accumulator; + _update_plot(); + } + } - graph->queue_redraw(); + if (button_idx == MouseButton::WHEEL_DOWN) { + // Zooming. + graph_zoom = MAX(-0.05 + graph_zoom, 0); + _update_plot(); + } else if (button_idx == MouseButton::WHEEL_UP) { + if (graph_zoom == 0) { + zoom_center = me->get_position().x; + zoom_center = zoom_center * frame_metrics.size() / graph->get_size().width; + } + graph_zoom = MIN(0.05 + graph_zoom, 2); + _update_plot(); } + + graph->queue_redraw(); } void EditorProfiler::disable_seeking() { @@ -712,9 +744,11 @@ EditorProfiler::EditorProfiler() { variables->set_column_expand(2, false); variables->set_column_clip_content(2, true); variables->set_column_custom_minimum_width(2, 50 * EDSCALE); + variables->set_theme_type_variation("TreeSecondary"); variables->connect("item_edited", callable_mp(this, &EditorProfiler::_item_edited)); graph = memnew(TextureRect); + graph->set_custom_minimum_size(Size2(250 * EDSCALE, 0)); graph->set_expand_mode(TextureRect::EXPAND_IGNORE_SIZE); graph->set_mouse_filter(MOUSE_FILTER_STOP); graph->connect(SceneStringName(draw), callable_mp(this, &EditorProfiler::_graph_tex_draw)); diff --git a/editor/debugger/editor_profiler.h b/editor/debugger/editor_profiler.h index 8de276be4378..c9a18e3f26a5 100644 --- a/editor/debugger/editor_profiler.h +++ b/editor/debugger/editor_profiler.h @@ -104,6 +104,11 @@ class EditorProfiler : public VBoxContainer { TextureRect *graph = nullptr; Ref graph_texture; Vector graph_image; + + float graph_zoom = 0.0f; + float pan_accumulator = 0.0f; + int zoom_center = -1; + Tree *variables = nullptr; HSplitContainer *h_split = nullptr; @@ -155,6 +160,7 @@ class EditorProfiler : public VBoxContainer { void _graph_tex_input(const Ref &p_ev); Color _get_color_from_signature(const StringName &p_signature) const; + int _get_zoom_left_border() const; void _cursor_metric_changed(double); diff --git a/editor/debugger/editor_visual_profiler.cpp b/editor/debugger/editor_visual_profiler.cpp index 9a83277e99af..c1de540a0da3 100644 --- a/editor/debugger/editor_visual_profiler.cpp +++ b/editor/debugger/editor_visual_profiler.cpp @@ -37,6 +37,12 @@ #include "editor/themes/editor_scale.h" #include "scene/resources/image_texture.h" +void EditorVisualProfiler::set_hardware_info(const String &p_cpu_name, const String &p_gpu_name) { + cpu_name = p_cpu_name; + gpu_name = p_gpu_name; + queue_redraw(); +} + void EditorVisualProfiler::add_frame_metric(const Metric &p_metric) { ++last_metric; if (last_metric >= frame_metrics.size()) { @@ -489,8 +495,8 @@ void EditorVisualProfiler::_graph_tex_draw() { graph->draw_string(font, Vector2(half_width * 2 - font->get_string_size(limit_str, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x - 2, frame_y - 2), limit_str, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, color * Color(1, 1, 1, 0.75)); } - graph->draw_string(font, Vector2(font->get_string_size("X", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x, font->get_ascent(font_size) + 2), "CPU:", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, color * Color(1, 1, 1)); - graph->draw_string(font, Vector2(font->get_string_size("X", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x + graph->get_size().width / 2, font->get_ascent(font_size) + 2), "GPU:", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, color * Color(1, 1, 1)); + graph->draw_string(font, Vector2(font->get_string_size("X", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x, font->get_ascent(font_size) + 2), "CPU: " + cpu_name, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, color * Color(1, 1, 1, 0.75)); + graph->draw_string(font, Vector2(font->get_string_size("X", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x + graph->get_size().width / 2, font->get_ascent(font_size) + 2), "GPU: " + gpu_name, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, color * Color(1, 1, 1, 0.75)); } void EditorVisualProfiler::_graph_tex_mouse_exit() { @@ -807,9 +813,11 @@ EditorVisualProfiler::EditorVisualProfiler() { variables->set_column_expand(2, false); variables->set_column_clip_content(2, true); variables->set_column_custom_minimum_width(2, 75 * EDSCALE); + variables->set_theme_type_variation("TreeSecondary"); variables->connect("cell_selected", callable_mp(this, &EditorVisualProfiler::_item_selected)); graph = memnew(TextureRect); + graph->set_custom_minimum_size(Size2(250 * EDSCALE, 0)); graph->set_expand_mode(TextureRect::EXPAND_IGNORE_SIZE); graph->set_mouse_filter(MOUSE_FILTER_STOP); graph->connect(SceneStringName(draw), callable_mp(this, &EditorVisualProfiler::_graph_tex_draw)); diff --git a/editor/debugger/editor_visual_profiler.h b/editor/debugger/editor_visual_profiler.h index a8ed58132ebc..5ef45fcc086d 100644 --- a/editor/debugger/editor_visual_profiler.h +++ b/editor/debugger/editor_visual_profiler.h @@ -98,6 +98,9 @@ class EditorVisualProfiler : public VBoxContainer { float graph_limit = 1000.0f / 60; + String cpu_name; + String gpu_name; + bool seeking = false; Timer *frame_delay = nullptr; @@ -136,6 +139,7 @@ class EditorVisualProfiler : public VBoxContainer { static void _bind_methods(); public: + void set_hardware_info(const String &p_cpu_name, const String &p_gpu_name); void add_frame_metric(const Metric &p_metric); void set_enabled(bool p_enable); void set_profiling(bool p_profiling); diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp index da59450dd0a5..e50b6273bc0d 100644 --- a/editor/debugger/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -315,7 +315,7 @@ void ScriptEditorDebugger::_thread_debug_enter(uint64_t p_thread_id) { ThreadDebugged &td = threads_debugged[p_thread_id]; _set_reason_text(td.error, MESSAGE_ERROR); emit_signal(SNAME("breaked"), true, td.can_debug, td.error, td.has_stackdump); - if (!td.error.is_empty()) { + if (!td.error.is_empty() && EDITOR_GET("debugger/auto_switch_to_stack_trace")) { tabs->set_current_tab(0); } inspector->clear_cache(); // Take a chance to force remote objects update. @@ -504,7 +504,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, uint64_t p_thread } break; } EditorNode::get_log()->add_message(output_strings[i], msg_type); - emit_signal(SNAME("output"), output_strings[i], msg_type); + emit_signal(SceneStringName(output), output_strings[i], msg_type); } } else if (p_msg == "performance:profile_frame") { Vector frame_data; @@ -513,6 +513,10 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, uint64_t p_thread frame_data.write[i] = p_data[i]; } performance_profiler->add_profile_frame(frame_data); + } else if (p_msg == "visual:hardware_info") { + const String cpu_name = p_data[0]; + const String gpu_name = p_data[1]; + visual_profiler->set_hardware_info(cpu_name, gpu_name); } else if (p_msg == "visual:profile_frame") { ServersDebugger::VisualProfilerFrame frame; frame.deserialize(p_data); @@ -1062,6 +1066,7 @@ void ScriptEditorDebugger::_update_buttons_state() { for (KeyValue &I : threads_debugged) { threadss.push_back(&I.value); } + threads->set_disabled(threadss.is_empty()); threadss.sort_custom(); threads->clear(); @@ -1915,16 +1920,19 @@ ScriptEditorDebugger::ScriptEditorDebugger() { threads->connect(SceneStringName(item_selected), callable_mp(this, &ScriptEditorDebugger::_select_thread)); stack_dump = memnew(Tree); + stack_dump->set_custom_minimum_size(Size2(150, 0) * EDSCALE); stack_dump->set_allow_reselect(true); stack_dump->set_columns(1); stack_dump->set_column_titles_visible(true); stack_dump->set_column_title(0, TTR("Stack Frames")); stack_dump->set_hide_root(true); stack_dump->set_v_size_flags(SIZE_EXPAND_FILL); + stack_dump->set_theme_type_variation("TreeSecondary"); stack_dump->connect("cell_selected", callable_mp(this, &ScriptEditorDebugger::_stack_dump_frame_selected)); stack_vb->add_child(stack_dump); VBoxContainer *inspector_vbox = memnew(VBoxContainer); + inspector_vbox->set_custom_minimum_size(Size2(200, 0) * EDSCALE); inspector_vbox->set_h_size_flags(SIZE_EXPAND_FILL); sc->add_child(inspector_vbox); @@ -1950,12 +1958,14 @@ ScriptEditorDebugger::ScriptEditorDebugger() { inspector_vbox->add_child(inspector); breakpoints_tree = memnew(Tree); + breakpoints_tree->set_custom_minimum_size(Size2(100, 0) * EDSCALE); breakpoints_tree->set_h_size_flags(SIZE_EXPAND_FILL); breakpoints_tree->set_column_titles_visible(true); breakpoints_tree->set_column_title(0, TTR("Breakpoints")); breakpoints_tree->set_allow_reselect(true); breakpoints_tree->set_allow_rmb_select(true); breakpoints_tree->set_hide_root(true); + breakpoints_tree->set_theme_type_variation("TreeSecondary"); breakpoints_tree->connect("item_mouse_selected", callable_mp(this, &ScriptEditorDebugger::_breakpoints_item_rmb_selected)); breakpoints_tree->create_item(); diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp index 9ca12070fec3..ba57806a7761 100644 --- a/editor/dependency_editor.cpp +++ b/editor/dependency_editor.cpp @@ -527,6 +527,20 @@ void DependencyRemoveDialog::_build_removed_dependency_tree(const Vectorclear(); + + for (const String &s : dirs_to_delete) { + String t = s.trim_prefix("res://"); + files_to_delete_list->add_item(t, Ref(), false); + } + + for (const String &s : files_to_delete) { + String t = s.trim_prefix("res://"); + files_to_delete_list->add_item(t, Ref(), false); + } +} + void DependencyRemoveDialog::show(const Vector &p_folders, const Vector &p_files) { all_remove_files.clear(); dirs_to_delete.clear(); @@ -543,21 +557,24 @@ void DependencyRemoveDialog::show(const Vector &p_folders, const Vector< files_to_delete.push_back(p_files[i]); } + _show_files_to_delete_list(); + Vector removed_deps; _find_all_removed_dependencies(EditorFileSystem::get_singleton()->get_filesystem(), removed_deps); _find_localization_remaps_of_removed_files(removed_deps); removed_deps.sort(); if (removed_deps.is_empty()) { - owners->hide(); + vb_owners->hide(); text->set_text(TTR("Remove the selected files from the project? (Cannot be undone.)\nDepending on your filesystem configuration, the files will either be moved to the system trash or deleted permanently.")); reset_size(); popup_centered(); } else { _build_removed_dependency_tree(removed_deps); - owners->show(); + vb_owners->show(); text->set_text(TTR("The files being removed are required by other resources in order for them to work.\nRemove them anyway? (Cannot be undone.)\nDepending on your filesystem configuration, the files will either be moved to the system trash or deleted permanently.")); popup_centered(Size2(500, 350)); } + EditorFileSystem::get_singleton()->scan_changes(); } @@ -666,15 +683,38 @@ DependencyRemoveDialog::DependencyRemoveDialog() { set_ok_button_text(TTR("Remove")); VBoxContainer *vb = memnew(VBoxContainer); + vb->set_h_size_flags(Control::SIZE_EXPAND_FILL); add_child(vb); text = memnew(Label); vb->add_child(text); + Label *files_to_delete_label = memnew(Label); + files_to_delete_label->set_theme_type_variation("HeaderSmall"); + files_to_delete_label->set_text(TTR("Files to be deleted:")); + vb->add_child(files_to_delete_label); + + files_to_delete_list = memnew(ItemList); + files_to_delete_list->set_h_size_flags(Control::SIZE_EXPAND_FILL); + files_to_delete_list->set_v_size_flags(Control::SIZE_EXPAND_FILL); + files_to_delete_list->set_custom_minimum_size(Size2(0, 94) * EDSCALE); + vb->add_child(files_to_delete_list); + + vb_owners = memnew(VBoxContainer); + vb_owners->set_h_size_flags(Control::SIZE_EXPAND_FILL); + vb_owners->set_v_size_flags(Control::SIZE_EXPAND_FILL); + vb->add_child(vb_owners); + + Label *owners_label = memnew(Label); + owners_label->set_theme_type_variation("HeaderSmall"); + owners_label->set_text(TTR("Dependencies of files to be deleted:")); + vb_owners->add_child(owners_label); + owners = memnew(Tree); owners->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); owners->set_hide_root(true); - vb->add_child(owners); + owners->set_custom_minimum_size(Size2(0, 94) * EDSCALE); + vb_owners->add_child(owners); owners->set_v_size_flags(Control::SIZE_EXPAND_FILL); } diff --git a/editor/dependency_editor.h b/editor/dependency_editor.h index 0256f39979d6..93954cbd97cc 100644 --- a/editor/dependency_editor.h +++ b/editor/dependency_editor.h @@ -31,6 +31,7 @@ #ifndef DEPENDENCY_EDITOR_H #define DEPENDENCY_EDITOR_H +#include "scene/gui/box_container.h" #include "scene/gui/dialogs.h" #include "scene/gui/item_list.h" #include "scene/gui/tab_container.h" @@ -98,6 +99,8 @@ class DependencyRemoveDialog : public ConfirmationDialog { Label *text = nullptr; Tree *owners = nullptr; + VBoxContainer *vb_owners = nullptr; + ItemList *files_to_delete_list = nullptr; HashMap all_remove_files; Vector dirs_to_delete; @@ -122,6 +125,7 @@ class DependencyRemoveDialog : public ConfirmationDialog { void _find_all_removed_dependencies(EditorFileSystemDirectory *efsd, Vector &p_removed); void _find_localization_remaps_of_removed_files(Vector &p_removed); void _build_removed_dependency_tree(const Vector &p_removed); + void _show_files_to_delete_list(); void ok_pressed() override; diff --git a/editor/directory_create_dialog.cpp b/editor/directory_create_dialog.cpp index d68af88fc8ea..3c176782f270 100644 --- a/editor/directory_create_dialog.cpp +++ b/editor/directory_create_dialog.cpp @@ -67,8 +67,8 @@ String DirectoryCreateDialog::_validate_path(const String &p_path) const { return TTR("Folder name cannot be empty."); } } - if (part.contains("\\") || part.contains(":") || part.contains("*") || - part.contains("|") || part.contains(">") || part.ends_with(".") || part.ends_with(" ")) { + if (part.contains_char('\\') || part.contains_char(':') || part.contains_char('*') || + part.contains_char('|') || part.contains_char('>') || part.ends_with(".") || part.ends_with(" ")) { if (is_file) { return TTR("File name contains invalid characters."); } else { @@ -101,7 +101,7 @@ void DirectoryCreateDialog::_on_dir_path_changed() { const String error = _validate_path(path); if (error.is_empty()) { - if (path.contains("/")) { + if (path.contains_char('/')) { if (mode == MODE_DIRECTORY) { validation_panel->set_message(EditorValidationPanel::MSG_ID_DEFAULT, TTR("Using slashes in folder names will create subfolders recursively."), EditorValidationPanel::MSG_OK); } else { diff --git a/editor/doc_tools.cpp b/editor/doc_tools.cpp index 79e0c7ebd1bc..842c4acce065 100644 --- a/editor/doc_tools.cpp +++ b/editor/doc_tools.cpp @@ -908,6 +908,23 @@ void DocTools::generate(BitField p_flags) { c.properties.sort(); + List enums; + Variant::get_enums_for_type(Variant::Type(i), &enums); + + for (const StringName &E : enums) { + List enumerations; + Variant::get_enumerations_for_enum(Variant::Type(i), E, &enumerations); + + for (const StringName &F : enumerations) { + DocData::ConstantDoc constant; + constant.name = F; + constant.value = itos(Variant::get_enum_value(Variant::Type(i), E, F)); + constant.is_value_valid = true; + constant.enumeration = E; + c.constants.push_back(constant); + } + } + List constants; Variant::get_constants_for_type(Variant::Type(i), &constants); diff --git a/editor/editor_asset_installer.cpp b/editor/editor_asset_installer.cpp index 72755e8943d4..5035900fe87e 100644 --- a/editor/editor_asset_installer.cpp +++ b/editor/editor_asset_installer.cpp @@ -735,6 +735,7 @@ EditorAssetInstaller::EditorAssetInstaller() { source_tree->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); source_tree->set_v_size_flags(Control::SIZE_EXPAND_FILL); source_tree->connect("item_edited", callable_mp(this, &EditorAssetInstaller::_item_checked_cbk)); + source_tree->set_theme_type_variation("TreeSecondary"); source_tree_vb->add_child(source_tree); VBoxContainer *destination_tree_vb = memnew(VBoxContainer); diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index 0649272216e3..11a1fbf452ed 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -815,7 +815,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) { set_v_size_flags(SIZE_EXPAND_FILL); track_name = memnew(LineEdit); - track_name->connect("text_submitted", callable_mp(this, &EditorAudioBus::_name_changed)); + track_name->connect(SceneStringName(text_submitted), callable_mp(this, &EditorAudioBus::_name_changed)); track_name->connect(SceneStringName(focus_exited), callable_mp(this, &EditorAudioBus::_name_focus_exit)); vb->add_child(track_name); @@ -959,6 +959,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) { effects->set_allow_rmb_select(true); effects->set_focus_mode(FOCUS_CLICK); effects->set_allow_reselect(true); + effects->set_theme_type_variation("TreeSecondary"); effects->connect(SceneStringName(gui_input), callable_mp(this, &EditorAudioBus::_effects_gui_input)); send = memnew(OptionButton); diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp index 23a2f5b13c8a..40fdd537d46d 100644 --- a/editor/editor_autoload_settings.cpp +++ b/editor/editor_autoload_settings.cpp @@ -921,7 +921,7 @@ EditorAutoloadSettings::EditorAutoloadSettings() { autoload_add_name = memnew(LineEdit); autoload_add_name->set_h_size_flags(SIZE_EXPAND_FILL); - autoload_add_name->connect("text_submitted", callable_mp(this, &EditorAutoloadSettings::_autoload_text_submitted)); + autoload_add_name->connect(SceneStringName(text_submitted), callable_mp(this, &EditorAutoloadSettings::_autoload_text_submitted)); autoload_add_name->connect(SceneStringName(text_changed), callable_mp(this, &EditorAutoloadSettings::_autoload_text_changed)); hbc->add_child(autoload_add_name); @@ -975,7 +975,7 @@ EditorAutoloadSettings::~EditorAutoloadSettings() { void EditorAutoloadSettings::_set_autoload_add_path(const String &p_text) { autoload_add_path->set_text(p_text); - autoload_add_path->emit_signal(SNAME("text_submitted"), p_text); + autoload_add_path->emit_signal(SceneStringName(text_submitted), p_text); } void EditorAutoloadSettings::_browse_autoload_add_path() { diff --git a/editor/editor_dock_manager.cpp b/editor/editor_dock_manager.cpp index 1db073ec81c6..bad683bf1342 100644 --- a/editor/editor_dock_manager.cpp +++ b/editor/editor_dock_manager.cpp @@ -174,6 +174,9 @@ void EditorDockManager::_update_docks_menu() { docks_menu_docks.clear(); int id = 0; for (const KeyValue &dock : all_docks) { + if (!dock.value.enabled) { + continue; + } if (dock.value.shortcut.is_valid()) { docks_menu->add_shortcut(dock.value.shortcut, id); docks_menu->set_item_text(id, dock.value.title); @@ -184,8 +187,10 @@ void EditorDockManager::_update_docks_menu() { docks_menu->set_item_icon(id, icon.is_valid() ? icon : default_icon); if (!dock.value.open) { docks_menu->set_item_icon_modulate(id, closed_icon_color_mod); + docks_menu->set_item_tooltip(id, vformat(TTR("Open the %s dock."), dock.value.title)); + } else { + docks_menu->set_item_tooltip(id, vformat(TTR("Focus on the %s dock."), dock.value.title)); } - docks_menu->set_item_disabled(id, !dock.value.enabled); docks_menu_docks.push_back(dock.key); id++; } diff --git a/editor/editor_feature_profile.cpp b/editor/editor_feature_profile.cpp index 9cf10c0ecb18..86a1c161f481 100644 --- a/editor/editor_feature_profile.cpp +++ b/editor/editor_feature_profile.cpp @@ -472,7 +472,7 @@ void EditorFeatureProfileManager::_erase_selected_profile() { void EditorFeatureProfileManager::_create_new_profile() { String name = new_profile_name->get_text().strip_edges(); - if (!name.is_valid_filename() || name.contains(".")) { + if (!name.is_valid_filename() || name.contains_char('.')) { EditorNode::get_singleton()->show_warning(TTR("Profile must be a valid filename and must not contain '.'")); return; } @@ -989,6 +989,7 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() { class_list->connect("cell_selected", callable_mp(this, &EditorFeatureProfileManager::_class_list_item_selected)); class_list->connect("item_edited", callable_mp(this, &EditorFeatureProfileManager::_class_list_item_edited), CONNECT_DEFERRED); class_list->connect("item_collapsed", callable_mp(this, &EditorFeatureProfileManager::_class_list_item_collapsed)); + class_list->set_theme_type_variation("TreeSecondary"); // It will be displayed once the user creates or chooses a profile. class_list_vbc->hide(); diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index b5306154badb..4911d5c702dc 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -384,7 +384,7 @@ void EditorFileSystem::_scan_filesystem() { FileCache fc; fc.type = split[1]; - if (fc.type.contains("/")) { + if (fc.type.contains_char('/')) { fc.type = split[1].get_slice("/", 0); fc.resource_script_class = split[1].get_slice("/", 1); } @@ -3556,5 +3556,9 @@ EditorFileSystem::EditorFileSystem() { } EditorFileSystem::~EditorFileSystem() { + if (filesystem) { + memdelete(filesystem); + } + filesystem = nullptr; ResourceSaver::set_get_resource_id_for_path(nullptr); } diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index f0c54b9edd04..2def625f8ce7 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -320,7 +320,7 @@ void EditorHelp::_class_desc_select(const String &p_select) { } } - if (link.contains(".")) { + if (link.contains_char('.')) { const int class_end = link.find_char('.'); emit_signal(SNAME("go_to_help"), topic + ":" + link.left(class_end) + ":" + link.substr(class_end + 1)); } @@ -365,7 +365,7 @@ static void _add_type_to_rt(const String &p_type, const String &p_enum, bool p_i bool is_enum_type = !p_enum.is_empty(); bool is_bitfield = p_is_bitfield && is_enum_type; - bool can_ref = !p_type.contains("*") || is_enum_type; + bool can_ref = !p_type.contains_char('*') || is_enum_type; String link_t = p_type; // For links in metadata String display_t; // For display purposes. @@ -2378,11 +2378,7 @@ void EditorHelp::_help_callback(const String &p_topic) { } if (class_desc->is_finished()) { - // call_deferred() is not enough. - if (class_desc->is_connected(SceneStringName(draw), callable_mp(class_desc, &RichTextLabel::scroll_to_paragraph))) { - class_desc->disconnect(SceneStringName(draw), callable_mp(class_desc, &RichTextLabel::scroll_to_paragraph)); - } - class_desc->connect(SceneStringName(draw), callable_mp(class_desc, &RichTextLabel::scroll_to_paragraph).bind(line), CONNECT_ONE_SHOT | CONNECT_DEFERRED); + class_desc->scroll_to_paragraph(line); } else { scroll_to = line; } @@ -2407,6 +2403,7 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt, const C const Ref doc_code_font = p_owner_node->get_theme_font(SNAME("doc_source"), EditorStringName(EditorFonts)); const Ref doc_kbd_font = p_owner_node->get_theme_font(SNAME("doc_keyboard"), EditorStringName(EditorFonts)); + const int doc_font_size = p_owner_node->get_theme_font_size(SNAME("doc_size"), EditorStringName(EditorFonts)); const int doc_code_font_size = p_owner_node->get_theme_font_size(SNAME("doc_source_size"), EditorStringName(EditorFonts)); const int doc_kbd_font_size = p_owner_node->get_theme_font_size(SNAME("doc_keyboard_size"), EditorStringName(EditorFonts)); @@ -2519,7 +2516,14 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt, const C tag_stack.pop_front(); pos = brk_end + 1; - if (tag != "/img") { + if (tag == "/img") { + // Nothing to do. + } else if (tag == "/url") { + p_rt->pop(); // meta + p_rt->pop(); // color + p_rt->add_text(" "); + p_rt->add_image(p_owner_node->get_editor_theme_icon(SNAME("ExternalLink")), 0, doc_font_size, link_color); + } else { p_rt->pop(); } } else if (tag.begins_with("method ") || tag.begins_with("constructor ") || tag.begins_with("operator ") || tag.begins_with("member ") || tag.begins_with("signal ") || tag.begins_with("enum ") || tag.begins_with("constant ") || tag.begins_with("annotation ") || tag.begins_with("theme_item ")) { @@ -2548,7 +2552,7 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt, const C p_rt->push_meta("@" + link_tag + " " + link_target, underline_mode); if (link_tag == "member" && - ((!link_target.contains(".") && (p_class == "ProjectSettings" || p_class == "EditorSettings")) || + ((!link_target.contains_char('.') && (p_class == "ProjectSettings" || p_class == "EditorSettings")) || link_target.begins_with("ProjectSettings.") || link_target.begins_with("EditorSettings."))) { // Special formatting for both ProjectSettings and EditorSettings. String prefix; @@ -2787,19 +2791,20 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt, const C } else if (tag == "rb") { p_rt->add_text("]"); pos = brk_end + 1; - } else if (tag == "url") { - int end = bbcode.find_char('[', brk_end); - if (end == -1) { - end = bbcode.length(); + } else if (tag == "url" || tag.begins_with("url=")) { + String url; + if (tag.begins_with("url=")) { + url = tag.substr(4); + } else { + int end = bbcode.find_char('[', brk_end); + if (end == -1) { + end = bbcode.length(); + } + url = bbcode.substr(brk_end + 1, end - brk_end - 1); } - String url = bbcode.substr(brk_end + 1, end - brk_end - 1); - p_rt->push_meta(url); - pos = brk_end + 1; - tag_stack.push_front(tag); - } else if (tag.begins_with("url=")) { - String url = tag.substr(4); - p_rt->push_meta(url); + p_rt->push_color(link_color); + p_rt->push_meta(url, RichTextLabel::META_UNDERLINE_ON_HOVER, url + "\n\n" + TTR("Click to open in browser.")); pos = brk_end + 1; tag_stack.push_front("url"); @@ -3660,7 +3665,7 @@ void EditorHelpBit::_meta_clicked(const String &p_select) { return; } - if (link.contains(".")) { + if (link.contains_char('.')) { const int class_end = link.find_char('.'); _go_to_help(topic + ":" + link.left(class_end) + ":" + link.substr(class_end + 1)); } else { @@ -4103,7 +4108,7 @@ FindBar::FindBar() { search_text->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); search_text->set_h_size_flags(SIZE_EXPAND_FILL); search_text->connect(SceneStringName(text_changed), callable_mp(this, &FindBar::_search_text_changed)); - search_text->connect("text_submitted", callable_mp(this, &FindBar::_search_text_submitted)); + search_text->connect(SceneStringName(text_submitted), callable_mp(this, &FindBar::_search_text_submitted)); matches_label = memnew(Label); add_child(matches_label); diff --git a/editor/editor_help_search.cpp b/editor/editor_help_search.cpp index 0fc7052a2b41..9f4bb3ab2f5b 100644 --- a/editor/editor_help_search.cpp +++ b/editor/editor_help_search.cpp @@ -957,7 +957,7 @@ void EditorHelpSearch::Runner::_match_method_name_and_push_back(Vector(&p_methods[i]); + method.doc = &p_methods[i]; r_match_methods->push_back(method); } } diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 6b3c6b462d1d..6b5f29e91148 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -69,6 +69,12 @@ bool EditorInspector::_property_path_matches(const String &p_property_path, cons return false; } +String EditorProperty::get_tooltip_string(const String &p_string) const { + // Trim to 100 characters to prevent the tooltip from being too long. + constexpr int TOOLTIP_MAX_LENGTH = 100; + return p_string.left(TOOLTIP_MAX_LENGTH).strip_edges() + String((p_string.length() > TOOLTIP_MAX_LENGTH) ? "..." : ""); +} + Size2 EditorProperty::get_minimum_size() const { Size2 ms; Ref font = get_theme_font(SceneStringName(font), SNAME("Tree")); @@ -275,7 +281,7 @@ void EditorProperty::_notification(int p_what) { } else { color = get_theme_color(is_read_only() ? SNAME("readonly_color") : SNAME("property_color")); } - if (label.contains(".")) { + if (label.contains_char('.')) { // FIXME: Move this to the project settings editor, as this is only used // for project settings feature tag overrides. color.a = 0.5; @@ -1090,6 +1096,21 @@ void EditorProperty::_bind_methods() { ClassDB::bind_method(D_METHOD("add_focusable", "control"), &EditorProperty::add_focusable); ClassDB::bind_method(D_METHOD("set_bottom_editor", "editor"), &EditorProperty::set_bottom_editor); + ClassDB::bind_method(D_METHOD("set_selectable", "selectable"), &EditorProperty::set_selectable); + ClassDB::bind_method(D_METHOD("is_selectable"), &EditorProperty::is_selectable); + + ClassDB::bind_method(D_METHOD("set_use_folding", "use_folding"), &EditorProperty::set_use_folding); + ClassDB::bind_method(D_METHOD("is_using_folding"), &EditorProperty::is_using_folding); + + ClassDB::bind_method(D_METHOD("set_name_split_ratio", "ratio"), &EditorProperty::set_name_split_ratio); + ClassDB::bind_method(D_METHOD("get_name_split_ratio"), &EditorProperty::get_name_split_ratio); + + ClassDB::bind_method(D_METHOD("deselect"), &EditorProperty::deselect); + ClassDB::bind_method(D_METHOD("is_selected"), &EditorProperty::is_selected); + ClassDB::bind_method(D_METHOD("select", "focusable"), &EditorProperty::select, DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("set_object_and_property", "object", "property"), &EditorProperty::set_object_and_property); + ClassDB::bind_method(D_METHOD("set_label_reference", "control"), &EditorProperty::set_label_reference); + ClassDB::bind_method(D_METHOD("emit_changed", "property", "value", "field", "changing"), &EditorProperty::emit_changed, DEFVAL(StringName()), DEFVAL(false)); ADD_PROPERTY(PropertyInfo(Variant::STRING, "label"), "set_label", "get_label"); @@ -1099,6 +1120,9 @@ void EditorProperty::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "draw_warning"), "set_draw_warning", "is_draw_warning"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "keying"), "set_keying", "is_keying"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "deletable"), "set_deletable", "is_deletable"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "selectable"), "set_selectable", "is_selectable"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_folding"), "set_use_folding", "is_using_folding"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "name_split_ratio"), "set_name_split_ratio", "get_name_split_ratio"); ADD_SIGNAL(MethodInfo("property_changed", PropertyInfo(Variant::STRING_NAME, "property"), PropertyInfo(Variant::NIL, "value", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NIL_IS_VARIANT), PropertyInfo(Variant::STRING_NAME, "field"), PropertyInfo(Variant::BOOL, "changing"))); ADD_SIGNAL(MethodInfo("multiple_properties_changed", PropertyInfo(Variant::PACKED_STRING_ARRAY, "properties"), PropertyInfo(Variant::ARRAY, "value"))); @@ -2534,7 +2558,7 @@ EditorInspectorArray::EditorInspectorArray(bool p_read_only) { new_size_spin_box = memnew(SpinBox); new_size_spin_box->set_max(16384); new_size_spin_box->connect(SceneStringName(value_changed), callable_mp(this, &EditorInspectorArray::_new_size_spin_box_value_changed)); - new_size_spin_box->get_line_edit()->connect("text_submitted", callable_mp(this, &EditorInspectorArray::_new_size_spin_box_text_submitted)); + new_size_spin_box->get_line_edit()->connect(SceneStringName(text_submitted), callable_mp(this, &EditorInspectorArray::_new_size_spin_box_text_submitted)); new_size_spin_box->set_editable(!read_only); resize_dialog_vbox->add_margin_child(TTRC("New Size:"), new_size_spin_box); @@ -2617,7 +2641,7 @@ EditorPaginator::EditorPaginator() { add_child(prev_page_button); page_line_edit = memnew(LineEdit); - page_line_edit->connect("text_submitted", callable_mp(this, &EditorPaginator::_page_line_edit_text_submitted)); + page_line_edit->connect(SceneStringName(text_submitted), callable_mp(this, &EditorPaginator::_page_line_edit_text_submitted)); page_line_edit->add_theme_constant_override("minimum_character_width", 2); add_child(page_line_edit); @@ -3171,7 +3195,7 @@ void EditorInspector::update_tree() { } // Get the property label's string. - String name_override = (path.contains("/")) ? path.substr(path.rfind_char('/') + 1) : path; + String name_override = (path.contains_char('/')) ? path.substr(path.rfind_char('/') + 1) : path; String feature_tag; { const int dot = name_override.find_char('.'); @@ -3320,7 +3344,7 @@ void EditorInspector::update_tree() { array_element_prefix = class_name_components[0]; editor_inspector_array = memnew(EditorInspectorArray(all_read_only)); - String array_label = path.contains("/") ? path.substr(path.rfind_char('/') + 1) : path; + String array_label = path.contains_char('/') ? path.substr(path.rfind_char('/') + 1) : path; array_label = EditorPropertyNameProcessor::get_singleton()->process_name(property_label_string, property_name_style, p.name, doc_name); int page = per_array_page.has(array_element_prefix) ? per_array_page[array_element_prefix] : 0; editor_inspector_array->setup_with_move_element_function(object, array_label, array_element_prefix, page, c, use_folding); @@ -3472,6 +3496,14 @@ void EditorInspector::update_tree() { editors.append_array(late_editors); + const Node *node = Object::cast_to(object); + + Vector sstack; + if (node != nullptr) { + const Node *es = EditorNode::get_singleton()->get_edited_scene(); + sstack = PropertyUtils::get_node_states_stack(node, es); + } + for (int i = 0; i < editors.size(); i++) { EditorProperty *ep = Object::cast_to(editors[i].property_editor); const Vector &properties = editors[i].properties; @@ -3525,7 +3557,15 @@ void EditorInspector::update_tree() { ep->set_checked(checked); ep->set_keying(keying); ep->set_read_only(property_read_only || all_read_only); - ep->set_deletable(deletable_properties || p.name.begins_with("metadata/")); + if (p.name.begins_with("metadata/")) { + Variant _default = Variant(); + if (node != nullptr) { + _default = PropertyUtils::get_property_default_value(node, p.name, nullptr, &sstack, false, nullptr, nullptr); + } + ep->set_deletable(_default == Variant()); + } else { + ep->set_deletable(deletable_properties); + } } if (ep && ep->is_favoritable() && current_favorites.has(p.name)) { @@ -3648,8 +3688,6 @@ void EditorInspector::update_tree() { for (List::Element *I = sections.back(); I; I = I->prev()) { EditorInspectorSection *section = I->get(); if (section->get_vbox()->get_child_count() == 0) { - I = I->prev(); - sections.erase(section); vbox_per_path[main_vbox].erase(section->get_section()); memdelete(section); @@ -4614,6 +4652,8 @@ void EditorInspector::_bind_methods() { ClassDB::bind_method("get_selected_path", &EditorInspector::get_selected_path); ClassDB::bind_method("get_edited_object", &EditorInspector::get_edited_object); + ClassDB::bind_static_method("EditorInspector", D_METHOD("instantiate_property_editor", "object", "type", "path", "hint", "hint_text", "usage", "wide"), &EditorInspector::instantiate_property_editor, DEFVAL(false)); + ADD_SIGNAL(MethodInfo("property_selected", PropertyInfo(Variant::STRING, "property"))); ADD_SIGNAL(MethodInfo("property_keyed", PropertyInfo(Variant::STRING, "property"), PropertyInfo(Variant::NIL, "value", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NIL_IS_VARIANT), PropertyInfo(Variant::BOOL, "advance"))); ADD_SIGNAL(MethodInfo("property_deleted", PropertyInfo(Variant::STRING, "property"))); @@ -4664,6 +4704,7 @@ EditorInspector::EditorInspector() { search_box = nullptr; _prop_edited = "property_edited"; set_process(false); + set_focus_mode(FocusMode::FOCUS_ALL); property_focusable = -1; property_clipboard = Variant(); @@ -4682,4 +4723,6 @@ EditorInspector::EditorInspector() { // `use_settings_name_style` is true by default, set the name style accordingly. set_property_name_style(EditorPropertyNameProcessor::get_singleton()->get_settings_style()); + + set_draw_focus_border(true); } diff --git a/editor/editor_inspector.h b/editor/editor_inspector.h index 2e4633ccea98..bc2c8112937c 100644 --- a/editor/editor_inspector.h +++ b/editor/editor_inspector.h @@ -160,6 +160,8 @@ class EditorProperty : public Container { public: void emit_changed(const StringName &p_property, const Variant &p_value, const StringName &p_field = StringName(), bool p_changing = false); + String get_tooltip_string(const String &p_string) const; + virtual Size2 get_minimum_size() const override; void set_label(const String &p_label); @@ -170,7 +172,10 @@ class EditorProperty : public Container { Object *get_edited_object(); StringName get_edited_property() const; - inline Variant get_edited_property_value() const { return object->get(property); } + inline Variant get_edited_property_value() const { + ERR_FAIL_NULL_V(object, Variant()); + return object->get(property); + } EditorInspector *get_parent_inspector() const; void set_doc_path(const String &p_doc_path); diff --git a/editor/editor_interface.cpp b/editor/editor_interface.cpp index e85258df50b4..158d1bd4c4bd 100644 --- a/editor/editor_interface.cpp +++ b/editor/editor_interface.cpp @@ -31,6 +31,7 @@ #include "editor_interface.h" #include "editor_interface.compat.inc" +#include "core/config/project_settings.h" #include "editor/editor_command_palette.h" #include "editor/editor_feature_profile.h" #include "editor/editor_main_screen.h" @@ -50,6 +51,10 @@ #include "editor/property_selector.h" #include "editor/themes/editor_scale.h" #include "main/main.h" +#include "plugins/editor_preview_plugins.h" +#include "scene/3d/light_3d.h" +#include "scene/3d/mesh_instance_3d.h" +#include "scene/3d/world_environment.h" #include "scene/gui/box_container.h" #include "scene/gui/control.h" #include "scene/main/window.h" @@ -98,6 +103,27 @@ EditorUndoRedoManager *EditorInterface::get_editor_undo_redo() const { return EditorUndoRedoManager::get_singleton(); } +AABB EditorInterface::_calculate_aabb_for_scene(Node *p_node, AABB &p_scene_aabb) { + MeshInstance3D *mesh_node = Object::cast_to(p_node); + if (mesh_node && mesh_node->get_mesh().is_valid()) { + Transform3D accum_xform; + Node3D *base = mesh_node; + while (base) { + accum_xform = base->get_transform() * accum_xform; + base = Object::cast_to(base->get_parent()); + } + + AABB aabb = accum_xform.xform(mesh_node->get_mesh()->get_aabb()); + p_scene_aabb.merge_with(aabb); + } + + for (int i = 0; i < p_node->get_child_count(); i++) { + p_scene_aabb = _calculate_aabb_for_scene(p_node->get_child(i), p_scene_aabb); + } + + return p_scene_aabb; +} + TypedArray EditorInterface::_make_mesh_previews(const TypedArray &p_meshes, int p_preview_size) { Vector> meshes; @@ -203,6 +229,137 @@ Vector> EditorInterface::make_mesh_previews(const Vectoris_inside_tree(), "The scene must not be inside the tree."); + ERR_FAIL_COND_MSG(!Engine::get_singleton()->is_editor_hint(), "This function can only be called from the editor."); + ERR_FAIL_NULL_MSG(EditorNode::get_singleton(), "EditorNode doesn't exist."); + + SubViewport *sub_viewport_node = memnew(SubViewport); + AABB scene_aabb; + scene_aabb = _calculate_aabb_for_scene(p_scene, scene_aabb); + + sub_viewport_node->set_update_mode(SubViewport::UPDATE_ALWAYS); + sub_viewport_node->set_size(Vector2i(p_preview_size, p_preview_size)); + sub_viewport_node->set_transparent_background(false); + Ref world; + world.instantiate(); + sub_viewport_node->set_world_3d(world); + + EditorNode::get_singleton()->add_child(sub_viewport_node); + Ref env; + env.instantiate(); + env->set_background(Environment::BG_CLEAR_COLOR); + + Ref camera_attributes; + camera_attributes.instantiate(); + + Node3D *root = memnew(Node3D); + root->set_name("Root"); + sub_viewport_node->add_child(root); + + Camera3D *camera = memnew(Camera3D); + camera->set_environment(env); + camera->set_attributes(camera_attributes); + camera->set_name("Camera3D"); + root->add_child(camera); + camera->set_current(true); + + camera->set_position(Vector3(0.0, 0.0, 3.0)); + + DirectionalLight3D *light = memnew(DirectionalLight3D); + light->set_name("Light"); + DirectionalLight3D *light2 = memnew(DirectionalLight3D); + light2->set_name("Light2"); + light2->set_color(Color(0.7, 0.7, 0.7, 1.0)); + + root->add_child(light); + root->add_child(light2); + + sub_viewport_node->add_child(p_scene); + + // Calculate the camera and lighting position based on the size of the scene. + Vector3 center = scene_aabb.get_center(); + float camera_size = scene_aabb.get_longest_axis_size(); + + const float cam_rot_x = -Math_PI / 4; + const float cam_rot_y = -Math_PI / 4; + + camera->set_orthogonal(camera_size * 2.0, 0.0001, camera_size * 2.0); + + Transform3D xf; + xf.basis = Basis(Vector3(0, 1, 0), cam_rot_y) * Basis(Vector3(1, 0, 0), cam_rot_x); + xf.origin = center; + xf.translate_local(0, 0, camera_size); + + camera->set_transform(xf); + + Transform3D xform; + xform.basis = Basis().rotated(Vector3(0, 1, 0), -Math_PI / 6); + xform.basis = Basis().rotated(Vector3(1, 0, 0), Math_PI / 6) * xform.basis; + + light->set_transform(xform * Transform3D().looking_at(Vector3(-2, -1, -1), Vector3(0, 1, 0))); + light2->set_transform(xform * Transform3D().looking_at(Vector3(+1, -1, -2), Vector3(0, 1, 0))); + + // Update the renderer to get the screenshot. + DisplayServer::get_singleton()->process_events(); + Main::iteration(); + Main::iteration(); + + // Get the texture. + Ref texture = sub_viewport_node->get_texture(); + ERR_FAIL_COND_MSG(texture.is_null(), "Failed to get texture from sub_viewport_node."); + + // Remove the initial scene node. + sub_viewport_node->remove_child(p_scene); + + // Cleanup the viewport. + if (sub_viewport_node) { + if (sub_viewport_node->get_parent()) { + sub_viewport_node->get_parent()->remove_child(sub_viewport_node); + } + sub_viewport_node->queue_free(); + sub_viewport_node = nullptr; + } + + // Now generate the cache image. + Ref img = texture->get_image(); + if (img.is_valid() && img->get_width() > 0 && img->get_height() > 0) { + img = img->duplicate(); + + int preview_size = EDITOR_GET("filesystem/file_dialog/thumbnail_size"); + preview_size *= EDSCALE; + + int vp_size = MIN(img->get_width(), img->get_height()); + int x = (img->get_width() - vp_size) / 2; + int y = (img->get_height() - vp_size) / 2; + + if (vp_size < preview_size) { + img->crop_from_point(x, y, vp_size, vp_size); + } else { + int ratio = vp_size / preview_size; + int size = preview_size * MAX(1, ratio / 2); + + x = (img->get_width() - size) / 2; + y = (img->get_height() - size) / 2; + + img->crop_from_point(x, y, size, size); + img->resize(preview_size, preview_size, Image::INTERPOLATE_LANCZOS); + } + img->convert(Image::FORMAT_RGB8); + + String temp_path = EditorPaths::get_singleton()->get_cache_dir(); + String cache_base = ProjectSettings::get_singleton()->globalize_path(p_path).md5_text(); + cache_base = temp_path.path_join("resthumb-" + cache_base); + + post_process_preview(img); + img->save_png(cache_base + ".png"); + } + + EditorResourcePreview::get_singleton()->check_for_invalidation(p_path); + EditorFileSystem::get_singleton()->emit_signal(SNAME("filesystem_changed")); +} + void EditorInterface::set_plugin_enabled(const String &p_plugin, bool p_enabled) { EditorNode::get_singleton()->set_addon_plugin_enabled(p_plugin, p_enabled, true); } diff --git a/editor/editor_interface.h b/editor/editor_interface.h index 2ae77331b197..92d981200370 100644 --- a/editor/editor_interface.h +++ b/editor/editor_interface.h @@ -79,6 +79,7 @@ class EditorInterface : public Object { // Editor tools. TypedArray _make_mesh_previews(const TypedArray &p_meshes, int p_preview_size); + AABB _calculate_aabb_for_scene(Node *p_node, AABB &p_scene_aabb); protected: static void _bind_methods(); @@ -107,6 +108,7 @@ class EditorInterface : public Object { EditorUndoRedoManager *get_editor_undo_redo() const; Vector> make_mesh_previews(const Vector> &p_meshes, Vector *p_transforms, int p_preview_size); + void make_scene_preview(const String &p_path, Node *p_scene, int p_preview_size); void set_plugin_enabled(const String &p_plugin, bool p_enabled); bool is_plugin_enabled(const String &p_plugin) const; diff --git a/editor/editor_log.h b/editor/editor_log.h index 899b4a9ac491..4f97416d0d35 100644 --- a/editor/editor_log.h +++ b/editor/editor_log.h @@ -98,8 +98,6 @@ class EditorLog : public HBoxContainer { toggle_button->set_pressed(true); toggle_button->set_text(itos(message_count)); toggle_button->set_tooltip_text(TTR(p_tooltip)); - // Don't tint the icon even when in "pressed" state. - toggle_button->add_theme_color_override("icon_color_pressed", Color(1, 1, 1, 1)); toggle_button->set_focus_mode(FOCUS_NONE); // When toggled call the callback and pass the MessageType this button is for. toggle_button->connect(SceneStringName(toggled), p_toggled_callback.bind(type)); @@ -145,11 +143,10 @@ class EditorLog : public HBoxContainer { Button *show_search_button = nullptr; LineEdit *search_box = nullptr; - // Reference to the "Output" button on the toolbar so we can update it's icon when - // Warnings or Errors are encounetered. + // Reference to the "Output" button on the toolbar so we can update its icon when warnings or errors are encountered. Button *tool_button = nullptr; - bool is_loading_state = false; // Used to disable saving requests while loading (some signals from buttons will try trigger a save, which happens during loading). + bool is_loading_state = false; // Used to disable saving requests while loading (some signals from buttons will try to trigger a save, which happens during loading). Timer *save_state_timer = nullptr; static void _error_handler(void *p_self, const char *p_func, const char *p_file, int p_line, const char *p_error, const char *p_errorexp, bool p_editor_notify, ErrorHandlerType p_type); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index f056a477c41b..bda5ccc27a5a 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -1427,7 +1427,7 @@ void EditorNode::save_resource_as(const Ref &p_resource, const String if (p_resource->get_path().is_resource_file()) { file->set_current_file(p_resource->get_path().get_file()); } else { - if (extensions.size()) { + if (!preferred.is_empty()) { String resource_name_snake_case = p_resource->get_class().to_snake_case(); file->set_current_file("new_" + resource_name_snake_case + "." + preferred.front()->get().to_lower()); } else { @@ -1436,18 +1436,15 @@ void EditorNode::save_resource_as(const Ref &p_resource, const String } } else if (!p_resource->get_path().is_empty()) { file->set_current_path(p_resource->get_path()); - if (extensions.size()) { - String ext = p_resource->get_path().get_extension().to_lower(); + if (!extensions.is_empty()) { + const String ext = p_resource->get_path().get_extension().to_lower(); if (extensions.find(ext) == nullptr) { file->set_current_path(p_resource->get_path().replacen("." + ext, "." + extensions.front()->get())); } } - } else if (preferred.size()) { - String existing; - if (extensions.size()) { - String resource_name_snake_case = p_resource->get_class().to_snake_case(); - existing = "new_" + resource_name_snake_case + "." + preferred.front()->get().to_lower(); - } + } else if (!preferred.is_empty()) { + const String resource_name_snake_case = p_resource->get_class().to_snake_case(); + const String existing = "new_" + resource_name_snake_case + "." + preferred.front()->get().to_lower(); file->set_current_path(existing); } file->set_title(TTR("Save Resource As...")); @@ -3444,6 +3441,11 @@ void EditorNode::_update_file_menu_closed() { file_menu->set_item_disabled(file_menu->get_item_index(FILE_OPEN_PREV), false); } +void EditorNode::_palette_quick_open_dialog() { + quick_open_color_palette->popup_dialog({ "ColorPalette" }, palette_file_selected_callback); + quick_open_color_palette->set_title(TTR("Quick Open Color Palette...")); +} + void EditorNode::replace_resources_in_object(Object *p_object, const Vector> &p_source_resources, const Vector> &p_target_resource) { List pi; p_object->get_property_list(&pi); @@ -3903,6 +3905,10 @@ void EditorNode::setup_color_picker(ColorPicker *p_picker) { p_picker->set_color_mode((ColorPicker::ColorModeType)default_color_mode); p_picker->set_picker_shape((ColorPicker::PickerShapeType)picker_shape); + + p_picker->set_quick_open_callback(callable_mp(this, &EditorNode::_palette_quick_open_dialog)); + p_picker->set_palette_saved_callback(callable_mp(EditorFileSystem::get_singleton(), &EditorFileSystem::update_file)); + palette_file_selected_callback = callable_mp(p_picker, &ColorPicker::_quick_open_palette_file_selected); } bool EditorNode::is_scene_open(const String &p_path) { @@ -5190,7 +5196,8 @@ void EditorNode::show_accept(const String &p_text, const String &p_title) { _close_save_scene_progress(); accept->set_ok_button_text(p_title); accept->set_text(p_text); - EditorInterface::get_singleton()->popup_dialog_centered(accept); + accept->reset_size(); + EditorInterface::get_singleton()->popup_dialog_centered_clamped(accept, Size2i(), 0.0); } } @@ -5200,7 +5207,8 @@ void EditorNode::show_save_accept(const String &p_text, const String &p_title) { _close_save_scene_progress(); save_accept->set_ok_button_text(p_title); save_accept->set_text(p_text); - EditorInterface::get_singleton()->popup_dialog_centered(save_accept); + save_accept->reset_size(); + EditorInterface::get_singleton()->popup_dialog_centered_clamped(save_accept, Size2i(), 0.0); } } @@ -5209,7 +5217,8 @@ void EditorNode::show_warning(const String &p_text, const String &p_title) { _close_save_scene_progress(); warning->set_text(p_text); warning->set_title(p_title); - EditorInterface::get_singleton()->popup_dialog_centered(warning); + warning->reset_size(); + EditorInterface::get_singleton()->popup_dialog_centered_clamped(warning, Size2i(), 0.0); } else { WARN_PRINT(p_title + " " + p_text); } @@ -7170,6 +7179,7 @@ EditorNode::EditorNode() { main_menu = memnew(MenuBar); main_menu->set_mouse_filter(Control::MOUSE_FILTER_STOP); title_bar->add_child(main_menu); + main_menu->set_v_size_flags(Control::SIZE_SHRINK_CENTER); main_menu->set_theme_type_variation("MainMenuBar"); main_menu->set_start_index(0); // Main menu, add to the start of global menu. main_menu->set_prefer_global_menu(global_menu); @@ -7865,6 +7875,9 @@ EditorNode::EditorNode() { quick_open_dialog = memnew(EditorQuickOpenDialog); gui_base->add_child(quick_open_dialog); + quick_open_color_palette = memnew(EditorQuickOpenDialog); + gui_base->add_child(quick_open_color_palette); + _update_recent_scenes(); set_process_shortcut_input(true); diff --git a/editor/editor_node.h b/editor/editor_node.h index 4a283983c8d2..fb6cc0932f20 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -264,6 +264,7 @@ class EditorNode : public Node { EditorPluginList *editor_plugins_force_input_forwarding = nullptr; EditorPluginList *editor_plugins_force_over = nullptr; EditorPluginList *editor_plugins_over = nullptr; + EditorQuickOpenDialog *quick_open_color_palette = nullptr; EditorResourcePreview *resource_preview = nullptr; EditorSelection *editor_selection = nullptr; EditorSettingsDialog *editor_settings_dialog = nullptr; @@ -413,6 +414,7 @@ class EditorNode : public Node { Timer *editor_layout_save_delay_timer = nullptr; Timer *scan_changes_timer = nullptr; Button *distraction_free = nullptr; + Callable palette_file_selected_callback; EditorBottomPanel *bottom_panel = nullptr; @@ -534,6 +536,7 @@ class EditorNode : public Node { void _export_as_menu_option(int p_idx); void _update_file_menu_opened(); void _update_file_menu_closed(); + void _palette_quick_open_dialog(); void _remove_plugin_from_enabled(const String &p_name); void _plugin_over_edit(EditorPlugin *p_plugin, Object *p_object); diff --git a/editor/editor_paths.cpp b/editor/editor_paths.cpp index 883116bab68b..8e9df68f3b70 100644 --- a/editor/editor_paths.cpp +++ b/editor/editor_paths.cpp @@ -54,6 +54,10 @@ String EditorPaths::get_cache_dir() const { return cache_dir; } +String EditorPaths::get_temp_dir() const { + return temp_dir; +} + String EditorPaths::get_project_data_dir() const { return project_data_dir; } @@ -105,6 +109,7 @@ void EditorPaths::create() { void EditorPaths::free() { ERR_FAIL_NULL(singleton); memdelete(singleton); + singleton = nullptr; } void EditorPaths::_bind_methods() { @@ -160,6 +165,7 @@ EditorPaths::EditorPaths() { config_dir = data_dir; cache_path = exe_path; cache_dir = data_dir.path_join("cache"); + temp_dir = data_dir.path_join("temp"); } else { // Typically XDG_DATA_HOME or %APPDATA%. data_path = OS::get_singleton()->get_data_path(); @@ -174,6 +180,7 @@ EditorPaths::EditorPaths() { } else { cache_dir = cache_path.path_join(OS::get_singleton()->get_godot_dir_name()); } + temp_dir = OS::get_singleton()->get_temp_path(); } paths_valid = (!data_path.is_empty() && !config_path.is_empty() && !cache_path.is_empty()); diff --git a/editor/editor_paths.h b/editor/editor_paths.h index a396c433018a..2fa288727c81 100644 --- a/editor/editor_paths.h +++ b/editor/editor_paths.h @@ -42,6 +42,7 @@ class EditorPaths : public Object { String data_dir; // Editor data (templates, shader cache, etc.). String config_dir; // Editor config (settings, profiles, themes, etc.). String cache_dir; // Editor cache (thumbnails, tmp generated files). + String temp_dir; // Editor temporary directory. String project_data_dir; // Project-specific data (metadata, shader cache, etc.). bool self_contained = false; // Self-contained means everything goes to `editor_data` dir. String self_contained_file; // Self-contained file with configuration. @@ -61,6 +62,7 @@ class EditorPaths : public Object { String get_data_dir() const; String get_config_dir() const; String get_cache_dir() const; + String get_temp_dir() const; String get_project_data_dir() const; String get_export_templates_dir() const; String get_debug_keystore_path() const; diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 2b2b32eb22d7..df40b083d223 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -52,6 +52,7 @@ #include "scene/3d/fog_volume.h" #include "scene/3d/gpu_particles_3d.h" #include "scene/gui/color_picker.h" +#include "scene/gui/grid_container.h" #include "scene/main/window.h" #include "scene/resources/font.h" #include "scene/resources/mesh.h" @@ -90,6 +91,10 @@ void EditorPropertyText::_text_changed(const String &p_string) { return; } + // Set tooltip so that the full text is displayed in a tooltip if hovered. + // This is useful when using a narrow inspector, as the text can be trimmed otherwise. + text->set_tooltip_text(get_tooltip_string(text->get_text())); + if (string_name) { emit_changed(get_edited_property(), StringName(p_string)); } else { @@ -103,6 +108,7 @@ void EditorPropertyText::update_property() { if (text->get_text() != s) { int caret = text->get_caret_column(); text->set_text(s); + text->set_tooltip_text(get_tooltip_string(s)); text->set_caret_column(caret); } text->set_editable(!is_read_only()); @@ -137,7 +143,7 @@ EditorPropertyText::EditorPropertyText() { add_focusable(text); text->set_h_size_flags(SIZE_EXPAND_FILL); text->connect(SceneStringName(text_changed), callable_mp(this, &EditorPropertyText::_text_changed)); - text->connect("text_submitted", callable_mp(this, &EditorPropertyText::_text_submitted)); + text->connect(SceneStringName(text_submitted), callable_mp(this, &EditorPropertyText::_text_submitted)); } ///////////////////// MULTILINE TEXT ///////////////////////// @@ -149,10 +155,14 @@ void EditorPropertyMultilineText::_set_read_only(bool p_read_only) { void EditorPropertyMultilineText::_big_text_changed() { text->set_text(big_text->get_text()); + // Set tooltip so that the full text is displayed in a tooltip if hovered. + // This is useful when using a narrow inspector, as the text can be trimmed otherwise. + text->set_tooltip_text(get_tooltip_string(big_text->get_text())); emit_changed(get_edited_property(), big_text->get_text(), "", true); } void EditorPropertyMultilineText::_text_changed() { + text->set_tooltip_text(get_tooltip_string(text->get_text())); emit_changed(get_edited_property(), text->get_text(), "", true); } @@ -181,6 +191,7 @@ void EditorPropertyMultilineText::update_property() { String t = get_edited_property_value(); if (text->get_text() != t) { text->set_text(t); + text->set_tooltip_text(get_tooltip_string(t)); if (big_text && big_text->is_visible_in_tree()) { big_text->set_text(t); } @@ -377,7 +388,7 @@ EditorPropertyTextEnum::EditorPropertyTextEnum() { custom_value_edit = memnew(LineEdit); custom_value_edit->set_h_size_flags(SIZE_EXPAND_FILL); edit_custom_layout->add_child(custom_value_edit); - custom_value_edit->connect("text_submitted", callable_mp(this, &EditorPropertyTextEnum::_custom_value_submitted)); + custom_value_edit->connect(SceneStringName(text_submitted), callable_mp(this, &EditorPropertyTextEnum::_custom_value_submitted)); accept_button = memnew(Button); accept_button->set_flat(true); @@ -442,7 +453,7 @@ EditorPropertyLocale::EditorPropertyLocale() { add_child(locale_hb); locale = memnew(LineEdit); locale_hb->add_child(locale); - locale->connect("text_submitted", callable_mp(this, &EditorPropertyLocale::_locale_selected)); + locale->connect(SceneStringName(text_submitted), callable_mp(this, &EditorPropertyLocale::_locale_selected)); locale->connect(SceneStringName(focus_exited), callable_mp(this, &EditorPropertyLocale::_locale_focus_exited)); locale->set_h_size_flags(SIZE_EXPAND_FILL); @@ -597,7 +608,7 @@ EditorPropertyPath::EditorPropertyPath() { SET_DRAG_FORWARDING_CDU(path, EditorPropertyPath); path->set_structured_text_bidi_override(TextServer::STRUCTURED_TEXT_FILE); path_hb->add_child(path); - path->connect("text_submitted", callable_mp(this, &EditorPropertyPath::_path_selected)); + path->connect(SceneStringName(text_submitted), callable_mp(this, &EditorPropertyPath::_path_selected)); path->connect(SceneStringName(focus_exited), callable_mp(this, &EditorPropertyPath::_path_focus_exited)); path->set_h_size_flags(SIZE_EXPAND_FILL); @@ -826,7 +837,7 @@ void EditorPropertyLayersGrid::_rename_operation_confirm() { if (new_name.length() == 0) { EditorNode::get_singleton()->show_warning(TTR("No name provided.")); return; - } else if (new_name.contains("/") || new_name.contains("\\") || new_name.contains(":")) { + } else if (new_name.contains_char('/') || new_name.contains_char('\\') || new_name.contains_char(':')) { EditorNode::get_singleton()->show_warning(TTR("Name contains invalid characters.")); return; } @@ -2645,7 +2656,7 @@ EditorPropertyColor::EditorPropertyColor() { add_child(picker); picker->set_flat(true); picker->connect("color_changed", callable_mp(this, &EditorPropertyColor::_color_changed)); - picker->connect("popup_closed", callable_mp(this, &EditorPropertyColor::_popup_closed)); + picker->connect("popup_closed", callable_mp(this, &EditorPropertyColor::_popup_closed), CONNECT_DEFERRED); picker->get_popup()->connect("about_to_popup", callable_mp(EditorNode::get_singleton(), &EditorNode::setup_color_picker).bind(picker->get_picker())); picker->get_popup()->connect("about_to_popup", callable_mp(this, &EditorPropertyColor::_picker_opening)); } @@ -2862,7 +2873,7 @@ void EditorPropertyNodePath::update_property() { const Node *target_node = base_node->get_node(p); ERR_FAIL_NULL(target_node); - if (String(target_node->get_name()).contains("@")) { + if (String(target_node->get_name()).contains_char('@')) { assign->set_button_icon(Ref()); assign->set_text(p); return; @@ -2946,7 +2957,7 @@ EditorPropertyNodePath::EditorPropertyNodePath() { edit->set_h_size_flags(SIZE_EXPAND_FILL); edit->hide(); edit->connect(SceneStringName(focus_exited), callable_mp(this, &EditorPropertyNodePath::_accept_text)); - edit->connect(SNAME("text_submitted"), callable_mp(this, &EditorPropertyNodePath::_text_submitted)); + edit->connect(SceneStringName(text_submitted), callable_mp(this, &EditorPropertyNodePath::_text_submitted)); hbc->add_child(edit); } @@ -3281,6 +3292,8 @@ void EditorPropertyResource::update_property() { sub_inspector->set_read_only(is_read_only()); sub_inspector->set_use_folding(is_using_folding()); + sub_inspector->set_draw_focus_border(false); + sub_inspector->set_mouse_filter(MOUSE_FILTER_STOP); add_child(sub_inspector); set_bottom_editor(sub_inspector); diff --git a/editor/editor_property_name_processor.cpp b/editor/editor_property_name_processor.cpp index ca8854f79702..3560174e6b51 100644 --- a/editor/editor_property_name_processor.cpp +++ b/editor/editor_property_name_processor.cpp @@ -235,6 +235,7 @@ EditorPropertyNameProcessor::EditorPropertyNameProcessor() { capitalize_string_remaps["linuxbsd"] = "Linux/*BSD"; capitalize_string_remaps["lod"] = "LOD"; capitalize_string_remaps["lods"] = "LODs"; + capitalize_string_remaps["loongarch64"] = "loongarch64"; capitalize_string_remaps["lowpass"] = "Low-pass"; capitalize_string_remaps["macos"] = "macOS"; capitalize_string_remaps["mb"] = "(MB)"; // Unit. diff --git a/editor/editor_resource_picker.cpp b/editor/editor_resource_picker.cpp index 4c3fc7f8c2df..897e897f2d4f 100644 --- a/editor/editor_resource_picker.cpp +++ b/editor/editor_resource_picker.cpp @@ -1359,7 +1359,7 @@ void EditorAudioStreamPicker::_preview_draw() { } stream_preview_rect->draw_texture(icon, Point2i(EDSCALE * 4, rect.position.y + (rect.size.height - icon->get_height()) / 2), icon_modulate); - stream_preview_rect->draw_string(font, Point2i(EDSCALE * 4 + icon->get_width(), rect.position.y + font->get_ascent(font_size) + (rect.size.height - font->get_height(font_size)) / 2), text, HORIZONTAL_ALIGNMENT_CENTER, size.width - 4 * EDSCALE - icon->get_width(), font_size, get_theme_color(SNAME("font_color"), EditorStringName(Editor))); + stream_preview_rect->draw_string(font, Point2i(EDSCALE * 4 + icon->get_width(), rect.position.y + font->get_ascent(font_size) + (rect.size.height - font->get_height(font_size)) / 2), text, HORIZONTAL_ALIGNMENT_CENTER, size.width - 4 * EDSCALE - icon->get_width(), font_size, get_theme_color(SceneStringName(font_color), EditorStringName(Editor))); } EditorAudioStreamPicker::EditorAudioStreamPicker() : diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp index 4dca3b33af78..47034104ee91 100644 --- a/editor/editor_resource_preview.cpp +++ b/editor/editor_resource_preview.cpp @@ -96,12 +96,12 @@ void EditorResourcePreviewGenerator::_bind_methods() { EditorResourcePreviewGenerator::EditorResourcePreviewGenerator() { } -void EditorResourcePreviewGenerator::DrawRequester::request_and_wait(RID p_viewport) const { +void EditorResourcePreviewGenerator::DrawRequester::request_and_wait(RID p_viewport) { Callable request_vp_update_once = callable_mp(RS::get_singleton(), &RS::viewport_set_update_mode).bind(p_viewport, RS::VIEWPORT_UPDATE_ONCE); if (EditorResourcePreview::get_singleton()->is_threaded()) { RS::get_singleton()->connect(SNAME("frame_pre_draw"), request_vp_update_once, Object::CONNECT_ONE_SHOT); - RS::get_singleton()->request_frame_drawn_callback(callable_mp(const_cast(this), &EditorResourcePreviewGenerator::DrawRequester::_post_semaphore)); + RS::get_singleton()->request_frame_drawn_callback(callable_mp(this, &EditorResourcePreviewGenerator::DrawRequester::_post_semaphore)); semaphore.wait(); } else { @@ -119,13 +119,13 @@ void EditorResourcePreviewGenerator::DrawRequester::request_and_wait(RID p_viewp } } -void EditorResourcePreviewGenerator::DrawRequester::abort() const { +void EditorResourcePreviewGenerator::DrawRequester::abort() { if (EditorResourcePreview::get_singleton()->is_threaded()) { semaphore.post(); } } -Variant EditorResourcePreviewGenerator::DrawRequester::_post_semaphore() const { +Variant EditorResourcePreviewGenerator::DrawRequester::_post_semaphore() { semaphore.post(); return Variant(); // Needed because of how the callback is used. } @@ -147,6 +147,10 @@ void EditorResourcePreview::_preview_ready(const String &p_path, int p_hash, con if (!p_path.begins_with("ID:")) { modified_time = FileAccess::get_modified_time(p_path); + String import_path = p_path + ".import"; + if (FileAccess::exists(import_path)) { + modified_time = MAX(modified_time, FileAccess::get_modified_time(import_path)); + } } Item item; @@ -237,7 +241,14 @@ void EditorResourcePreview::_generate_preview(Ref &r_texture, Ref< } Ref f = FileAccess::open(cache_base + ".txt", FileAccess::WRITE); ERR_FAIL_COND_MSG(f.is_null(), "Cannot create file '" + cache_base + ".txt'. Check user write permissions."); - _write_preview_cache(f, thumbnail_size, has_small_texture, FileAccess::get_modified_time(p_item.path), FileAccess::get_md5(p_item.path), p_metadata); + + uint64_t modtime = FileAccess::get_modified_time(p_item.path); + String import_path = p_item.path + ".import"; + if (FileAccess::exists(import_path)) { + modtime = MAX(modtime, FileAccess::get_modified_time(import_path)); + } + + _write_preview_cache(f, thumbnail_size, has_small_texture, modtime, FileAccess::get_md5(p_item.path), p_metadata); } } @@ -298,6 +309,11 @@ void EditorResourcePreview::_iterate() { _generate_preview(texture, small_texture, item, cache_base, preview_metadata); } else { uint64_t modtime = FileAccess::get_modified_time(item.path); + String import_path = item.path + ".import"; + if (FileAccess::exists(import_path)) { + modtime = MAX(modtime, FileAccess::get_modified_time(import_path)); + } + int tsize; bool has_small_texture; uint64_t last_modtime; @@ -513,6 +529,11 @@ void EditorResourcePreview::check_for_invalidation(const String &p_path) { if (cache.has(p_path)) { uint64_t modified_time = FileAccess::get_modified_time(p_path); + String import_path = p_path + ".import"; + if (FileAccess::exists(import_path)) { + modified_time = MAX(modified_time, FileAccess::get_modified_time(import_path)); + } + if (modified_time != cache[p_path].modified_time) { cache.erase(p_path); call_invalidated = true; diff --git a/editor/editor_resource_preview.h b/editor/editor_resource_preview.h index 88cd753a5837..876b42b101d0 100644 --- a/editor/editor_resource_preview.h +++ b/editor/editor_resource_preview.h @@ -54,11 +54,11 @@ class EditorResourcePreviewGenerator : public RefCounted { class DrawRequester : public Object { Semaphore semaphore; - Variant _post_semaphore() const; + Variant _post_semaphore(); public: - void request_and_wait(RID p_viewport) const; - void abort() const; + void request_and_wait(RID p_viewport); + void abort(); }; public: diff --git a/editor/editor_sectioned_inspector.cpp b/editor/editor_sectioned_inspector.cpp index d88cc4d5fa7e..94fda334922f 100644 --- a/editor/editor_sectioned_inspector.cpp +++ b/editor/editor_sectioned_inspector.cpp @@ -108,7 +108,7 @@ class SectionedInspectorFilter : public Object { if (pi.name.begins_with(section + "/")) { pi.name = pi.name.replace_first(section + "/", ""); - if (!allow_sub && pi.name.contains("/")) { + if (!allow_sub && pi.name.contains_char('/')) { continue; } p_list->push_back(pi); @@ -247,7 +247,7 @@ void SectionedInspector::update_category_list() { continue; } - if (pi.name.contains(":") || pi.name == "script" || pi.name == "resource_name" || pi.name == "resource_path" || pi.name == "resource_local_to_scene" || pi.name.begins_with("_global_script")) { + if (pi.name.contains_char(':') || pi.name == "script" || pi.name == "resource_name" || pi.name == "resource_path" || pi.name == "resource_local_to_scene" || pi.name.begins_with("_global_script")) { continue; } @@ -353,6 +353,7 @@ SectionedInspector::SectionedInspector() : sections->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); sections->set_v_size_flags(SIZE_EXPAND_FILL); sections->set_hide_root(true); + sections->set_theme_type_variation("TreeSecondary"); left_vb->add_child(sections, true); diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index b0d1c3e6bb1f..7322e2aefb61 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -827,7 +827,8 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { _initial_set("editors/3d/navigation/warped_mouse_panning", true, true); // 3D: Navigation feel - EDITOR_SETTING_BASIC(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/navigation_feel/orbit_sensitivity", 0.25, "0.01,2,0.001") + EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/navigation_feel/orbit_sensitivity", 0.25, "0.01,20,0.001") + EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/navigation_feel/translation_sensitivity", 1.0, "0.01,20,0.001") EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/navigation_feel/orbit_inertia", 0.0, "0,1,0.001") EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/navigation_feel/translation_inertia", 0.05, "0,1,0.001") EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/navigation_feel/zoom_inertia", 0.05, "0,1,0.001") @@ -970,6 +971,7 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { /* Debugger/profiler */ EDITOR_SETTING_BASIC(Variant::BOOL, PROPERTY_HINT_NONE, "debugger/auto_switch_to_remote_scene_tree", false, "") + EDITOR_SETTING_BASIC(Variant::BOOL, PROPERTY_HINT_NONE, "debugger/auto_switch_to_stack_trace", true, "") EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "debugger/profiler_frame_history_size", 3600, "60,10000,1") EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "debugger/profiler_frame_max_functions", 64, "16,512,1") EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "debugger/profiler_target_fps", 60, "1,1000,1") diff --git a/editor/editor_string_names.h b/editor/editor_string_names.h index 55d8a9c1ec0a..0ef5cf63fd94 100644 --- a/editor/editor_string_names.h +++ b/editor/editor_string_names.h @@ -34,9 +34,7 @@ #include "core/string/string_name.h" class EditorStringNames { - static EditorStringNames *singleton; - - EditorStringNames(); + inline static EditorStringNames *singleton = nullptr; public: static void create() { singleton = memnew(EditorStringNames); } @@ -47,10 +45,10 @@ class EditorStringNames { _FORCE_INLINE_ static EditorStringNames *get_singleton() { return singleton; } - StringName Editor; - StringName EditorFonts; - StringName EditorIcons; - StringName EditorStyles; + const StringName Editor = StaticCString::create("Editor"); + const StringName EditorFonts = StaticCString::create("EditorFonts"); + const StringName EditorIcons = StaticCString::create("EditorIcons"); + const StringName EditorStyles = StaticCString::create("EditorStyles"); }; #define EditorStringName(m_name) EditorStringNames::get_singleton()->m_name diff --git a/editor/export/editor_export_platform.cpp b/editor/export/editor_export_platform.cpp index 91c9ff9807cb..72fa20f6716b 100644 --- a/editor/export/editor_export_platform.cpp +++ b/editor/export/editor_export_platform.cpp @@ -900,6 +900,26 @@ String EditorExportPlatform::_get_script_encryption_key(const Refget_script_encryption_key().to_lower(); } +Dictionary EditorExportPlatform::get_internal_export_files() { + Dictionary files; + + // Text server support data. + if (TS->has_feature(TextServer::FEATURE_USE_SUPPORT_DATA) && (bool)GLOBAL_GET("internationalization/locale/include_text_server_data")) { + String ts_name = TS->get_support_data_filename(); + if (!ts_name.is_empty()) { + ts_name = "res://" + ts_name; + if (!FileAccess::exists(ts_name)) { // Do not include if user supplied data file exist. + const PackedByteArray &ts_data = TS->get_support_data(); + if (!ts_data.is_empty()) { + files[ts_name] = ts_data; + } + } + } + } + + return files; +} + Vector EditorExportPlatform::get_forced_export_files() { Vector files; @@ -923,25 +943,13 @@ Vector EditorExportPlatform::get_forced_export_files() { files.push_back(extension_list_config_file); } - // Store text server data if it is supported. - if (TS->has_feature(TextServer::FEATURE_USE_SUPPORT_DATA)) { - bool use_data = GLOBAL_GET("internationalization/locale/include_text_server_data"); - if (use_data) { - // Try using user provided data file. - if (!TS->get_support_data_filename().is_empty()) { - String ts_data = "res://" + TS->get_support_data_filename(); - if (FileAccess::exists(ts_data)) { - files.push_back(ts_data); - } else { - // Use default text server data. - String abs_path = ProjectSettings::get_singleton()->globalize_path(ts_data); - ERR_FAIL_COND_V(!TS->save_support_data(abs_path), files); - if (FileAccess::exists(abs_path)) { - files.push_back(ts_data); - // Remove the file later. - callable_mp_static(DirAccess::remove_absolute).call_deferred(abs_path); - } - } + // Text server support data. + if (TS->has_feature(TextServer::FEATURE_USE_SUPPORT_DATA) && (bool)GLOBAL_GET("internationalization/locale/include_text_server_data")) { + String ts_name = TS->get_support_data_filename(); + if (!ts_name.is_empty()) { + ts_name = "res://" + ts_name; + if (FileAccess::exists(ts_name)) { // Include user supplied data file. + files.push_back(ts_name); } } } @@ -1495,13 +1503,30 @@ Error EditorExportPlatform::export_project_files(const Ref & Vector forced_export = get_forced_export_files(); for (int i = 0; i < forced_export.size(); i++) { - Vector array = FileAccess::get_file_as_bytes(forced_export[i]); + Vector array; + if (GDExtension::get_extension_list_config_file() == forced_export[i]) { + array = _filter_extension_list_config_file(forced_export[i], paths); + if (array.size() == 0) { + continue; + } + } else { + array = FileAccess::get_file_as_bytes(forced_export[i]); + } err = p_save_func(p_udata, forced_export[i], array, idx, total, enc_in_filters, enc_ex_filters, key, seed); if (err != OK) { return err; } } + Dictionary int_export = get_internal_export_files(); + for (const Variant &int_name : int_export.keys()) { + const PackedByteArray &array = int_export[int_name]; + err = p_save_func(p_udata, int_name, array, idx, total, enc_in_filters, enc_ex_filters, key, seed); + if (err != OK) { + return err; + } + } + String config_file = "project.binary"; String engine_cfb = EditorPaths::get_singleton()->get_cache_dir().path_join("tmp" + config_file); ProjectSettings::get_singleton()->save_custom(engine_cfb, custom_map, custom_list); @@ -1534,6 +1559,22 @@ Error EditorExportPlatform::export_project_files(const Ref & return OK; } +Vector EditorExportPlatform::_filter_extension_list_config_file(const String &p_config_path, const HashSet &p_paths) { + Ref f = FileAccess::open(p_config_path, FileAccess::READ); + if (f.is_null()) { + ERR_FAIL_V_MSG(Vector(), "Can't open file from path '" + String(p_config_path) + "'."); + } + Vector data; + while (!f->eof_reached()) { + String l = f->get_line().strip_edges(); + if (p_paths.has(l)) { + data.append_array(l.to_utf8_buffer()); + data.append('\n'); + } + } + return data; +} + Error EditorExportPlatform::_pack_add_shared_object(void *p_userdata, const SharedObject &p_so) { PackData *pack_data = (PackData *)p_userdata; if (pack_data->so_files) { @@ -2403,6 +2444,7 @@ void EditorExportPlatform::_bind_methods() { ClassDB::bind_method(D_METHOD("ssh_push_to_remote", "host", "port", "scp_args", "src_file", "dst_file"), &EditorExportPlatform::ssh_push_to_remote); ClassDB::bind_static_method("EditorExportPlatform", D_METHOD("get_forced_export_files"), &EditorExportPlatform::get_forced_export_files); + ClassDB::bind_static_method("EditorExportPlatform", D_METHOD("get_internal_export_files"), &EditorExportPlatform::get_internal_export_files); BIND_ENUM_CONSTANT(EXPORT_MESSAGE_NONE); BIND_ENUM_CONSTANT(EXPORT_MESSAGE_INFO); diff --git a/editor/export/editor_export_platform.h b/editor/export/editor_export_platform.h index c7378ffec7ed..6b55ecd4b66e 100644 --- a/editor/export/editor_export_platform.h +++ b/editor/export/editor_export_platform.h @@ -135,6 +135,8 @@ class EditorExportPlatform : public RefCounted { void _edit_files_with_filter(Ref &da, const Vector &p_filters, HashSet &r_list, bool exclude); void _edit_filter_list(HashSet &r_list, const String &p_filter, bool exclude); + static Vector _filter_extension_list_config_file(const String &p_config_path, const HashSet &p_paths); + struct FileExportCache { uint64_t source_modified_time = 0; String source_md5; @@ -275,6 +277,7 @@ class EditorExportPlatform : public RefCounted { return worst_type; } + static Dictionary get_internal_export_files(); static Vector get_forced_export_files(); virtual bool fill_log_messages(RichTextLabel *p_log, Error p_err); diff --git a/editor/export/export_template_manager.cpp b/editor/export/export_template_manager.cpp index a90c16f66e69..1e1999ddb702 100644 --- a/editor/export/export_template_manager.cpp +++ b/editor/export/export_template_manager.cpp @@ -437,6 +437,13 @@ bool ExportTemplateManager::_install_file_selected(const String &p_file, bool p_ } String file = String::utf8(fname); + + // Skip the __MACOSX directory created by macOS's built-in file zipper. + if (file.begins_with("__MACOSX")) { + ret = unzGoToNextFile(pkg); + continue; + } + if (file.ends_with("version.txt")) { Vector uncomp_data; uncomp_data.resize(info.uncompressed_size); @@ -512,7 +519,8 @@ bool ExportTemplateManager::_install_file_selected(const String &p_file, bool p_ String file = file_path.get_file(); - if (file.size() == 0) { + // Skip the __MACOSX directory created by macOS's built-in file zipper. + if (file.is_empty() || file.begins_with("__MACOSX")) { ret = unzGoToNextFile(pkg); continue; } diff --git a/editor/export/project_export.cpp b/editor/export/project_export.cpp index 0fc62416afd5..b741cfe8f6bc 100644 --- a/editor/export/project_export.cpp +++ b/editor/export/project_export.cpp @@ -705,6 +705,12 @@ void ProjectExportDialog::_duplicate_preset() { preset->set_exclude_filter(current->get_exclude_filter()); preset->set_patches(current->get_patches()); preset->set_custom_features(current->get_custom_features()); + preset->set_enc_in_filter(current->get_enc_in_filter()); + preset->set_enc_ex_filter(current->get_enc_ex_filter()); + preset->set_enc_pck(current->get_enc_pck()); + preset->set_enc_directory(current->get_enc_directory()); + preset->set_script_encryption_key(current->get_script_encryption_key()); + preset->set_script_export_mode(current->get_script_export_mode()); for (const KeyValue &E : current->get_values()) { preset->set(E.key, E.value); @@ -1245,10 +1251,10 @@ void ProjectExportDialog::_validate_export_path(const String &p_path) { if (invalid_path) { export_project->get_ok_button()->set_disabled(true); - export_project->get_line_edit()->disconnect("text_submitted", callable_mp(export_project, &EditorFileDialog::_file_submitted)); + export_project->get_line_edit()->disconnect(SceneStringName(text_submitted), callable_mp(export_project, &EditorFileDialog::_file_submitted)); } else { export_project->get_ok_button()->set_disabled(false); - export_project->get_line_edit()->connect("text_submitted", callable_mp(export_project, &EditorFileDialog::_file_submitted)); + export_project->get_line_edit()->connect(SceneStringName(text_submitted), callable_mp(export_project, &EditorFileDialog::_file_submitted)); } } @@ -1281,9 +1287,9 @@ void ProjectExportDialog::_export_project() { // with _validate_export_path. // FIXME: This is a hack, we should instead change EditorFileDialog to allow // disabling validation by the "text_submitted" signal. - if (!export_project->get_line_edit()->is_connected("text_submitted", callable_mp(export_project, &EditorFileDialog::_file_submitted))) { + if (!export_project->get_line_edit()->is_connected(SceneStringName(text_submitted), callable_mp(export_project, &EditorFileDialog::_file_submitted))) { export_project->get_ok_button()->set_disabled(false); - export_project->get_line_edit()->connect("text_submitted", callable_mp(export_project, &EditorFileDialog::_file_submitted)); + export_project->get_line_edit()->connect(SceneStringName(text_submitted), callable_mp(export_project, &EditorFileDialog::_file_submitted)); } export_project->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE); @@ -1416,6 +1422,7 @@ ProjectExportDialog::ProjectExportDialog() { preset_vb->add_child(mc); mc->set_v_size_flags(Control::SIZE_EXPAND_FILL); presets = memnew(ItemList); + presets->set_theme_type_variation("ItemListSecondary"); presets->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); SET_DRAG_FORWARDING_GCD(presets, ProjectExportDialog); mc->add_child(presets); diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index c7e12d1f3b54..a9b2a50ae8e7 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -180,7 +180,7 @@ FileSystemList::FileSystemList() { line_editor = memnew(LineEdit); line_editor->set_v_size_flags(SIZE_EXPAND_FILL); popup_editor_vb->add_child(line_editor); - line_editor->connect("text_submitted", callable_mp(this, &FileSystemList::_line_editor_submit)); + line_editor->connect(SceneStringName(text_submitted), callable_mp(this, &FileSystemList::_line_editor_submit)); popup_editor->connect("popup_hide", callable_mp(this, &FileSystemList::_text_editor_popup_modal_close)); } @@ -245,6 +245,8 @@ void FileSystemDock::_create_tree(TreeItem *p_parent, EditorFileSystemDirectory } subdirectory_item->set_selectable(0, true); subdirectory_item->set_metadata(0, lpath); + folder_map[lpath] = subdirectory_item; + if (!p_select_in_favorites && (current_path == lpath || ((display_mode != DISPLAY_MODE_TREE_ONLY) && current_path.get_base_dir() == lpath))) { subdirectory_item->select(0); // Keep select an item when re-created a tree @@ -371,6 +373,7 @@ void FileSystemDock::_update_tree(const Vector &p_uncollapsed_paths, boo tree_update_id++; updating_tree = true; TreeItem *root = tree->create_item(); + folder_map.clear(); // Handles the favorites. favorites_item = tree->create_item(root); @@ -452,6 +455,10 @@ void FileSystemDock::_update_tree(const Vector &p_uncollapsed_paths, boo // Create the remaining of the tree. _create_tree(root, EditorFileSystem::get_singleton()->get_filesystem(), uncollapsed_paths, p_select_in_favorites, p_unfold_path); + if (!searched_tokens.is_empty()) { + _update_filtered_items(); + } + tree->ensure_cursor_is_visible(); updating_tree = false; } @@ -512,7 +519,7 @@ void FileSystemDock::_notification(int p_what) { button_hist_prev->connect(SceneStringName(pressed), callable_mp(this, &FileSystemDock::_bw_history)); file_list_popup->connect(SceneStringName(id_pressed), callable_mp(this, &FileSystemDock::_file_list_rmb_option)); tree_popup->connect(SceneStringName(id_pressed), callable_mp(this, &FileSystemDock::_tree_rmb_option)); - current_path_line_edit->connect("text_submitted", callable_mp(this, &FileSystemDock::_navigate_to_path).bind(false)); + current_path_line_edit->connect(SceneStringName(text_submitted), callable_mp(this, &FileSystemDock::_navigate_to_path).bind(false)); always_show_folders = bool(EDITOR_GET("docks/filesystem/always_show_folders")); @@ -698,19 +705,21 @@ void FileSystemDock::_set_current_path_line_edit_text(const String &p_path) { } void FileSystemDock::_navigate_to_path(const String &p_path, bool p_select_in_favorites) { + bool is_directory = false; if (p_path == "Favorites") { current_path = p_path; } else { String target_path = p_path; // If the path is a file, do not only go to the directory in the tree, also select the file in the file list. if (target_path.ends_with("/")) { - target_path = target_path.substr(0, target_path.length() - 1); + target_path = target_path.trim_suffix("/"); } Ref da = DirAccess::create(DirAccess::ACCESS_RESOURCES); if (da->file_exists(p_path)) { current_path = target_path; } else if (da->dir_exists(p_path)) { current_path = target_path + "/"; + is_directory = true; } else { ERR_FAIL_MSG(vformat("Cannot navigate to '%s' as it has not been found in the file system!", p_path)); } @@ -719,17 +728,56 @@ void FileSystemDock::_navigate_to_path(const String &p_path, bool p_select_in_fa _set_current_path_line_edit_text(current_path); _push_to_history(); - _update_tree(get_uncollapsed_paths(), false, p_select_in_favorites, true); + const String file_name = is_directory ? p_path.trim_suffix("/").get_file() + "/" : p_path.get_file(); + bool found = false; + + TreeItem **base_dir_ptr; + { + const String base_dir = current_path.get_base_dir(); + if (base_dir == "res://") { + base_dir_ptr = folder_map.getptr(base_dir); + } else if (is_directory) { + base_dir_ptr = folder_map.getptr(base_dir.get_base_dir() + "/"); + } else { + base_dir_ptr = folder_map.getptr(base_dir + "/"); + } + } + + if (base_dir_ptr) { + TreeItem *directory = *base_dir_ptr; + { + TreeItem *entry = directory->get_first_child(); + while (entry) { + if (entry->get_metadata(0).operator String().ends_with(file_name)) { + tree->deselect_all(); + entry->select(0); + found = true; + break; + } + entry = entry->get_next(); + } + } + + while (directory) { + directory->set_collapsed(false); + directory = directory->get_parent(); + } + } + + if (!found) { + return; + } + + tree->ensure_cursor_is_visible(); if (display_mode != DISPLAY_MODE_TREE_ONLY) { _update_file_list(false); // Reset the scroll for a directory. - if (p_path.ends_with("/")) { + if (is_directory) { files->get_v_scroll_bar()->set_value(0); } } - String file_name = p_path.get_file(); if (!file_name.is_empty()) { for (int i = 0; i < files->get_item_count(); i++) { if (files->get_item_text(i) == file_name) { @@ -1191,7 +1239,7 @@ HashSet FileSystemDock::_get_valid_conversions_for_file_paths(const Vect return all_valid_conversion_to_targets; } -void FileSystemDock::_select_file(const String &p_path, bool p_select_in_favorites) { +void FileSystemDock::_select_file(const String &p_path, bool p_select_in_favorites, bool p_navigate) { String fpath = p_path; if (fpath.ends_with("/")) { // Ignore a directory. @@ -1258,7 +1306,9 @@ void FileSystemDock::_select_file(const String &p_path, bool p_select_in_favorit EditorNode::get_singleton()->load_resource(fpath); } } - _navigate_to_path(fpath, p_select_in_favorites); + if (p_navigate) { + _navigate_to_path(fpath, p_select_in_favorites); + } } void FileSystemDock::_tree_activate_file() { @@ -1272,7 +1322,7 @@ void FileSystemDock::_tree_activate_file() { bool collapsed = selected->is_collapsed(); selected->set_collapsed(!collapsed); } else { - _select_file(file_path, is_favorite && !file_path.ends_with("/")); + _select_file(file_path, is_favorite && !file_path.ends_with("/"), false); } } } @@ -1753,7 +1803,7 @@ void FileSystemDock::_rename_operation_confirm() { if (new_name.length() == 0) { EditorNode::get_singleton()->show_warning(TTR("No name provided.")); rename_error = true; - } else if (new_name.contains("/") || new_name.contains("\\") || new_name.contains(":")) { + } else if (new_name.contains_char('/') || new_name.contains_char('\\') || new_name.contains_char(':')) { EditorNode::get_singleton()->show_warning(TTR("Name contains invalid characters.")); rename_error = true; } else if (new_name[0] == '.') { @@ -2216,7 +2266,7 @@ void FileSystemDock::_file_option(int p_option, const Vector &p_selected test_args.push_back("command -v " + terminal_emulator); const Error err = OS::get_singleton()->execute("bash", test_args, &pipe); // Check if a path to the terminal executable exists. - if (err == OK && pipe.contains("/")) { + if (err == OK && pipe.contains_char('/')) { chosen_terminal_emulator = terminal_emulator; break; } else if (err == ERR_CANT_FORK) { @@ -3281,7 +3331,7 @@ void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, const Vect if (cached_valid_conversion_targets.size() > CONVERSION_SUBMENU_THRESHOLD) { container_menu = memnew(PopupMenu); - container_menu->connect("id_pressed", callable_mp(this, &FileSystemDock::_generic_rmb_option_selected)); + container_menu->connect(SceneStringName(id_pressed), callable_mp(this, &FileSystemDock::_generic_rmb_option_selected)); p_popup->add_submenu_node_item(TTR("Convert to..."), container_menu, FILE_NEW); conversion_string_template = "%s"; @@ -4146,6 +4196,7 @@ FileSystemDock::FileSystemDock() { files = memnew(FileSystemList); files->set_v_size_flags(SIZE_EXPAND_FILL); files->set_select_mode(ItemList::SELECT_MULTI); + files->set_theme_type_variation("ItemListSecondary"); SET_DRAG_FORWARDING_GCD(files, FileSystemDock); files->connect("item_clicked", callable_mp(this, &FileSystemDock::_file_list_item_clicked)); files->connect(SceneStringName(gui_input), callable_mp(this, &FileSystemDock::_file_list_gui_input)); diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h index d2e403a8aff3..7b10d8b3ef7a 100644 --- a/editor/filesystem_dock.h +++ b/editor/filesystem_dock.h @@ -133,6 +133,7 @@ class FileSystemDock : public VBoxContainer { CONVERT_BASE_ID = 1000, }; + HashMap folder_map; HashMap folder_colors; Dictionary assigned_folder_colors; @@ -262,7 +263,7 @@ class FileSystemDock : public VBoxContainer { void _set_file_display(bool p_active); void _fs_changed(); - void _select_file(const String &p_path, bool p_select_in_favorites = false); + void _select_file(const String &p_path, bool p_select_in_favorites = false, bool p_navigate = true); void _tree_activate_file(); void _file_list_activate_file(int p_idx); void _file_multi_selected(int p_index, bool p_selected); diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp index 719fa25dad2c..42f4b59186ce 100644 --- a/editor/find_in_files.cpp +++ b/editor/find_in_files.cpp @@ -320,7 +320,7 @@ FindInFilesDialog::FindInFilesDialog() { _search_text_line_edit = memnew(LineEdit); _search_text_line_edit->set_h_size_flags(Control::SIZE_EXPAND_FILL); _search_text_line_edit->connect(SceneStringName(text_changed), callable_mp(this, &FindInFilesDialog::_on_search_text_modified)); - _search_text_line_edit->connect("text_submitted", callable_mp(this, &FindInFilesDialog::_on_search_text_submitted)); + _search_text_line_edit->connect(SceneStringName(text_submitted), callable_mp(this, &FindInFilesDialog::_on_search_text_submitted)); gc->add_child(_search_text_line_edit); _replace_label = memnew(Label); @@ -330,7 +330,7 @@ FindInFilesDialog::FindInFilesDialog() { _replace_text_line_edit = memnew(LineEdit); _replace_text_line_edit->set_h_size_flags(Control::SIZE_EXPAND_FILL); - _replace_text_line_edit->connect("text_submitted", callable_mp(this, &FindInFilesDialog::_on_replace_text_submitted)); + _replace_text_line_edit->connect(SceneStringName(text_submitted), callable_mp(this, &FindInFilesDialog::_on_replace_text_submitted)); _replace_text_line_edit->hide(); gc->add_child(_replace_text_line_edit); diff --git a/editor/group_settings_editor.cpp b/editor/group_settings_editor.cpp index 93d5ee071684..b7482cdfff51 100644 --- a/editor/group_settings_editor.cpp +++ b/editor/group_settings_editor.cpp @@ -500,7 +500,7 @@ GroupSettingsEditor::GroupSettingsEditor() { group_name->set_h_size_flags(SIZE_EXPAND_FILL); group_name->set_clear_button_enabled(true); group_name->connect(SceneStringName(text_changed), callable_mp(this, &GroupSettingsEditor::_group_name_text_changed)); - group_name->connect("text_submitted", callable_mp(this, &GroupSettingsEditor::_text_submitted)); + group_name->connect(SceneStringName(text_submitted), callable_mp(this, &GroupSettingsEditor::_text_submitted)); hbc->add_child(group_name); l = memnew(Label); @@ -510,7 +510,7 @@ GroupSettingsEditor::GroupSettingsEditor() { group_description = memnew(LineEdit); group_description->set_clear_button_enabled(true); group_description->set_h_size_flags(SIZE_EXPAND_FILL); - group_description->connect("text_submitted", callable_mp(this, &GroupSettingsEditor::_text_submitted)); + group_description->connect(SceneStringName(text_submitted), callable_mp(this, &GroupSettingsEditor::_text_submitted)); hbc->add_child(group_description); add_button = memnew(Button); diff --git a/editor/gui/editor_file_dialog.cpp b/editor/gui/editor_file_dialog.cpp index 03816098047c..8ece6f5dfef2 100644 --- a/editor/gui/editor_file_dialog.cpp +++ b/editor/gui/editor_file_dialog.cpp @@ -44,7 +44,6 @@ #include "scene/gui/check_box.h" #include "scene/gui/grid_container.h" #include "scene/gui/label.h" -#include "scene/gui/margin_container.h" #include "scene/gui/option_button.h" #include "scene/gui/separator.h" #include "scene/gui/split_container.h" @@ -117,25 +116,37 @@ void EditorFileDialog::_native_dialog_cb(bool p_ok, const Vector &p_file selected_options = p_selected_options; String f = files[0]; + + filter->select(p_filter); + dir->set_text(f.get_base_dir()); + file->set_text(f.get_file()); + _dir_submitted(f.get_base_dir()); + if (mode == FILE_MODE_OPEN_FILES) { emit_signal(SNAME("files_selected"), files); } else { if (mode == FILE_MODE_SAVE_FILE) { - if (p_filter >= 0 && p_filter < filters.size()) { + if (p_filter != 0 && p_filter != filter->get_item_count() - 1) { bool valid = false; - String flt = filters[p_filter].get_slice(";", 0); - int filter_slice_count = flt.get_slice_count(","); - for (int j = 0; j < filter_slice_count; j++) { - String str = (flt.get_slice(",", j).strip_edges()); - if (f.match(str)) { - valid = true; - break; - } + int idx = p_filter; + if (filters.size() > 1) { + idx--; } + if (idx >= 0 && idx < filters.size()) { + String flt = filters[idx].get_slice(";", 0); + int filter_slice_count = flt.get_slice_count(","); + for (int j = 0; j < filter_slice_count; j++) { + String str = (flt.get_slice(",", j).strip_edges()); + if (f.match(str)) { + valid = true; + break; + } + } - if (!valid && filter_slice_count > 0) { - String str = (flt.get_slice(",", 0).strip_edges()); - f += str.substr(1, str.length() - 1); + if (!valid && filter_slice_count > 0) { + String str = (flt.get_slice(",", 0).strip_edges()); + f += str.substr(1, str.length() - 1); + } } } emit_signal(SNAME("file_selected"), f); @@ -145,9 +156,6 @@ void EditorFileDialog::_native_dialog_cb(bool p_ok, const Vector &p_file emit_signal(SNAME("dir_selected"), f); } } - file->set_text(f); - dir->set_text(f.get_base_dir()); - filter->select(p_filter); } void EditorFileDialog::popup_file_dialog() { @@ -175,12 +183,14 @@ void EditorFileDialog::_update_theme_item_cache() { theme_cache.back_folder = get_editor_theme_icon(SNAME("Back")); theme_cache.reload = get_editor_theme_icon(SNAME("Reload")); theme_cache.toggle_hidden = get_editor_theme_icon(SNAME("GuiVisibilityVisible")); + theme_cache.toggle_filename_filter = get_editor_theme_icon(SNAME("FilenameFilter")); theme_cache.favorite = get_editor_theme_icon(SNAME("Favorites")); theme_cache.mode_thumbnails = get_editor_theme_icon(SNAME("FileThumbnail")); theme_cache.mode_list = get_editor_theme_icon(SNAME("FileList")); theme_cache.favorites_up = get_editor_theme_icon(SNAME("MoveUp")); theme_cache.favorites_down = get_editor_theme_icon(SNAME("MoveDown")); theme_cache.create_folder = get_editor_theme_icon(SNAME("FolderCreate")); + theme_cache.open_folder = get_editor_theme_icon(SNAME("FolderBrowse")); theme_cache.filter_box = get_editor_theme_icon(SNAME("Search")); theme_cache.file_sort_button = get_editor_theme_icon(SNAME("Sort")); @@ -329,6 +339,7 @@ void EditorFileDialog::shortcut_input(const Ref &p_event) { handled = true; } if (ED_IS_SHORTCUT("file_dialog/focus_filter", p_event)) { + show_search_filter_button->set_pressed(!show_search_filter_button->is_pressed()); _focus_filter_box(); handled = true; } @@ -363,6 +374,7 @@ Vector EditorFileDialog::get_selected_files() const { } void EditorFileDialog::update_dir() { + full_dir = dir_access->get_current_dir(); if (drives->is_visible()) { if (dir_access->get_current_dir().is_network_share_path()) { _update_drives(false); @@ -529,7 +541,7 @@ void EditorFileDialog::_action_pressed() { String file_text = file->get_text(); String f = file_text.is_absolute_path() ? file_text : dir_access->get_current_dir().path_join(file_text); - if ((mode == FILE_MODE_OPEN_ANY || mode == FILE_MODE_OPEN_FILE) && dir_access->file_exists(f)) { + if ((mode == FILE_MODE_OPEN_ANY || mode == FILE_MODE_OPEN_FILE) && (dir_access->file_exists(f) || dir_access->is_bundle(f))) { _save_to_recent(); hide(); emit_signal(SNAME("file_selected"), f); @@ -565,7 +577,7 @@ void EditorFileDialog::_action_pressed() { String flt = filters[i].get_slice(";", 0); for (int j = 0; j < flt.get_slice_count(","); j++) { String str = flt.get_slice(",", j).strip_edges(); - if (f.match(str)) { + if (f.matchn(str)) { valid = true; break; } @@ -581,16 +593,16 @@ void EditorFileDialog::_action_pressed() { } if (idx >= 0 && idx < filters.size()) { String flt = filters[idx].get_slice(";", 0); - int filterSliceCount = flt.get_slice_count(","); - for (int j = 0; j < filterSliceCount; j++) { + int filter_slice_count = flt.get_slice_count(","); + for (int j = 0; j < filter_slice_count; j++) { String str = (flt.get_slice(",", j).strip_edges()); - if (f.match(str)) { + if (f.matchn(str)) { valid = true; break; } } - if (!valid && filterSliceCount > 0) { + if (!valid && filter_slice_count > 0) { String str = (flt.get_slice(",", 0).strip_edges()); f += str.substr(1, str.length() - 1); _request_single_thumbnail(get_current_dir().path_join(f.get_file())); @@ -781,6 +793,12 @@ void EditorFileDialog::_item_list_item_rmb_clicked(int p_item, const Vector2 &p_ item_menu->add_icon_item(theme_cache.filesystem, item_text, ITEM_MENU_SHOW_IN_EXPLORER); } #endif + if (single_item_selected) { + Dictionary item_meta = item_list->get_item_metadata(p_item); + if (item_meta["bundle"]) { + item_menu->add_icon_item(theme_cache.open_folder, TTR("Show Package Contents"), ITEM_MENU_SHOW_BUNDLE_CONTENT); + } + } if (item_menu->get_item_count() > 0) { item_menu->set_position(item_list->get_screen_position() + p_pos); @@ -843,7 +861,7 @@ void EditorFileDialog::_item_menu_id_pressed(int p_option) { case ITEM_MENU_SHOW_IN_EXPLORER: { String path; int idx = item_list->get_current(); - if (idx == -1 || item_list->get_selected_items().size() == 0) { + if (idx == -1 || !item_list->is_anything_selected()) { // Folder background was clicked. Open this folder. path = ProjectSettings::get_singleton()->globalize_path(dir_access->get_current_dir()); } else { @@ -853,6 +871,20 @@ void EditorFileDialog::_item_menu_id_pressed(int p_option) { } OS::get_singleton()->shell_show_in_file_manager(path, true); } break; + + case ITEM_MENU_SHOW_BUNDLE_CONTENT: { + String path; + int idx = item_list->get_current(); + if (idx == -1 || !item_list->is_anything_selected()) { + return; + } + Dictionary item_meta = item_list->get_item_metadata(idx); + dir_access->change_dir(item_meta["path"]); + callable_mp(this, &EditorFileDialog::update_file_list).call_deferred(); + callable_mp(this, &EditorFileDialog::update_dir).call_deferred(); + + _push_history(); + } break; } } @@ -1020,28 +1052,6 @@ void EditorFileDialog::update_file_list() { } sort_file_info_list(file_infos, file_sort); - while (!dirs.is_empty()) { - const String &dir_name = dirs.front()->get(); - - item_list->add_item(dir_name); - - if (display_mode == DISPLAY_THUMBNAILS) { - item_list->set_item_icon(-1, folder_thumbnail); - } else { - item_list->set_item_icon(-1, theme_cache.folder); - } - - Dictionary d; - d["name"] = dir_name; - d["path"] = cdir.path_join(dir_name); - d["dir"] = true; - - item_list->set_item_metadata(-1, d); - item_list->set_item_icon_modulate(-1, get_dir_icon_color(String(d["path"]))); - - dirs.pop_front(); - } - List patterns; // build filter if (filter->get_selected() == filter->get_item_count() - 1) { @@ -1068,6 +1078,44 @@ void EditorFileDialog::update_file_list() { } } + while (!dirs.is_empty()) { + const String &dir_name = dirs.front()->get(); + + bool bundle = dir_access->is_bundle(dir_name); + bool found = true; + if (bundle) { + bool match = patterns.is_empty(); + for (const String &E : patterns) { + if (dir_name.matchn(E)) { + match = true; + break; + } + } + found = match; + } + + if (found) { + item_list->add_item(dir_name); + + if (display_mode == DISPLAY_THUMBNAILS) { + item_list->set_item_icon(-1, folder_thumbnail); + } else { + item_list->set_item_icon(-1, theme_cache.folder); + } + + Dictionary d; + d["name"] = dir_name; + d["path"] = cdir.path_join(dir_name); + d["dir"] = !bundle; + d["bundle"] = bundle; + + item_list->set_item_metadata(-1, d); + item_list->set_item_icon_modulate(-1, get_dir_icon_color(String(d["path"]))); + } + + dirs.pop_front(); + } + while (!file_infos.is_empty()) { bool match = patterns.is_empty(); @@ -1103,6 +1151,7 @@ void EditorFileDialog::update_file_list() { Dictionary d; d["name"] = file_info.name; d["dir"] = false; + d["bundle"] = false; d["path"] = file_info.path; item_list->set_item_metadata(-1, d); @@ -1146,6 +1195,15 @@ void EditorFileDialog::_filter_selected(int) { update_file_list(); } +void EditorFileDialog::_search_filter_selected() { + Vector items = item_list->get_selected_items(); + if (!items.is_empty()) { + int index = items[0]; + file->set_text(item_list->get_item_text(index)); + file->emit_signal(SceneStringName(text_submitted), file->get_text()); + } +} + void EditorFileDialog::update_filters() { filter->clear(); processed_filters.clear(); @@ -1193,7 +1251,7 @@ void EditorFileDialog::update_filters() { } } - String f = TTR("All Files (*)"); + String f = TTR("All Files") + " (*.*)"; filter->add_item(f); processed_filters.push_back("*.*;" + f); } @@ -1204,6 +1262,23 @@ void EditorFileDialog::clear_filters() { invalidate(); } +void EditorFileDialog::clear_search_filter() { + set_search_filter(""); + update_search_filter_gui(); + invalidate(); +} + +void EditorFileDialog::update_search_filter_gui() { + filter_hb->set_visible(show_search_filter); + if (!show_search_filter) { + search_string.clear(); + } + if (filter_box->get_text() == search_string) { + return; + } + filter_box->set_text(search_string); +} + void EditorFileDialog::add_filter(const String &p_filter, const String &p_description) { if (p_description.is_empty()) { filters.push_back(p_filter); @@ -1223,10 +1298,24 @@ void EditorFileDialog::set_filters(const Vector &p_filters) { invalidate(); } +void EditorFileDialog::set_search_filter(const String &p_search_filter) { + if (search_string == p_search_filter) { + return; + } + search_string = p_search_filter; + update_search_filter_gui(); + emit_signal(SNAME("filename_filter_changed"), filter); + invalidate(); +} + Vector EditorFileDialog::get_filters() const { return filters; } +String EditorFileDialog::get_search_filter() const { + return search_string; +} + String EditorFileDialog::get_current_dir() const { return dir_access->get_current_dir(); } @@ -1310,11 +1399,8 @@ void EditorFileDialog::set_file_mode(FileMode p_mode) { item_list->set_select_mode(ItemList::SELECT_SINGLE); } - if (can_create_dir) { - makedir->show(); - } else { - makedir->hide(); - } + makedir_sep->set_visible(can_create_dir); + makedir->set_visible(can_create_dir); } EditorFileDialog::FileMode EditorFileDialog::get_file_mode() const { @@ -1416,6 +1502,11 @@ void EditorFileDialog::_focus_filter_box() { void EditorFileDialog::_filter_changed(const String &p_text) { search_string = p_text; invalidate(); + + item_list->deselect_all(); + if (item_list->get_item_count() > 0) { + item_list->call_deferred("select", 0); + } } void EditorFileDialog::_file_sort_popup(int p_id) { @@ -1476,6 +1567,8 @@ void EditorFileDialog::_select_drive(int p_idx) { void EditorFileDialog::_update_drives(bool p_select) { int dc = dir_access->get_drive_count(); if (dc == 0 || access != ACCESS_FILESYSTEM) { + shortcuts_container->hide(); + drives_container->hide(); drives->hide(); } else { drives->clear(); @@ -1484,6 +1577,8 @@ void EditorFileDialog::_update_drives(bool p_select) { dp->remove_child(drives); } dp = dir_access->drives_are_shortcuts() ? shortcuts_container : drives_container; + shortcuts_container->set_visible(dir_access->drives_are_shortcuts()); + drives_container->set_visible(!dir_access->drives_are_shortcuts()); dp->add_child(drives); drives->show(); @@ -1519,6 +1614,7 @@ void EditorFileDialog::_update_icons() { filter_box->set_right_icon(theme_cache.filter_box); file_sort_button->set_button_icon(theme_cache.file_sort_button); + show_search_filter_button->set_button_icon(theme_cache.toggle_filename_filter); filter_box->set_clear_button_enabled(true); fav_up->set_button_icon(theme_cache.favorites_up); @@ -1672,6 +1768,9 @@ void EditorFileDialog::_update_favorites() { recent->deselect_all(); } } + + fav_up->set_disabled(current_favorite < 1); + fav_down->set_disabled(current_favorite == -1 || favorited_paths.size() - 1 <= current_favorite); } void EditorFileDialog::_favorite_pressed() { @@ -1998,6 +2097,9 @@ void EditorFileDialog::_bind_methods() { ClassDB::bind_method(D_METHOD("get_option_count"), &EditorFileDialog::get_option_count); ClassDB::bind_method(D_METHOD("add_option", "name", "values", "default_value_index"), &EditorFileDialog::add_option); ClassDB::bind_method(D_METHOD("get_selected_options"), &EditorFileDialog::get_selected_options); + ClassDB::bind_method(D_METHOD("clear_filename_filter"), &EditorFileDialog::clear_search_filter); + ClassDB::bind_method(D_METHOD("set_filename_filter", "filter"), &EditorFileDialog::set_search_filter); + ClassDB::bind_method(D_METHOD("get_filename_filter"), &EditorFileDialog::get_search_filter); ClassDB::bind_method(D_METHOD("get_current_dir"), &EditorFileDialog::get_current_dir); ClassDB::bind_method(D_METHOD("get_current_file"), &EditorFileDialog::get_current_file); ClassDB::bind_method(D_METHOD("get_current_path"), &EditorFileDialog::get_current_path); @@ -2026,6 +2128,7 @@ void EditorFileDialog::_bind_methods() { ADD_SIGNAL(MethodInfo("file_selected", PropertyInfo(Variant::STRING, "path"))); ADD_SIGNAL(MethodInfo("files_selected", PropertyInfo(Variant::PACKED_STRING_ARRAY, "paths"))); ADD_SIGNAL(MethodInfo("dir_selected", PropertyInfo(Variant::STRING, "dir"))); + ADD_SIGNAL(MethodInfo("filename_filter_changed", PropertyInfo(Variant::STRING, "filter"))); ADD_PROPERTY(PropertyInfo(Variant::INT, "access", PROPERTY_HINT_ENUM, "Resources,User data,File system"), "set_access", "get_access"); ADD_PROPERTY(PropertyInfo(Variant::INT, "display_mode", PROPERTY_HINT_ENUM, "Thumbnails,List"), "set_display_mode", "get_display_mode"); @@ -2072,6 +2175,24 @@ void EditorFileDialog::set_show_hidden_files(bool p_show) { invalidate(); } +void EditorFileDialog::set_show_search_filter(bool p_show) { + if (p_show == show_search_filter) { + return; + } + if (p_show) { + filter_box->grab_focus(); + } else { + search_string.clear(); + filter_box->clear(); + if (filter_box->has_focus()) { + item_list->call_deferred("grab_focus"); + } + } + show_search_filter = p_show; + update_search_filter_gui(); + invalidate(); +} + bool EditorFileDialog::is_showing_hidden_files() const { return show_hidden_files; } @@ -2215,7 +2336,6 @@ EditorFileDialog::EditorFileDialog() { dir = memnew(LineEdit); dir->set_structured_text_bidi_override(TextServer::STRUCTURED_TEXT_FILE); pathhb->add_child(dir); - dir->set_h_size_flags(Control::SIZE_EXPAND_FILL); refresh = memnew(Button); refresh->set_theme_type_variation("FlatButton"); @@ -2230,37 +2350,6 @@ EditorFileDialog::EditorFileDialog() { favorite->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::_favorite_pressed)); pathhb->add_child(favorite); - show_hidden = memnew(Button); - show_hidden->set_theme_type_variation("FlatButton"); - show_hidden->set_toggle_mode(true); - show_hidden->set_pressed(is_showing_hidden_files()); - show_hidden->set_tooltip_text(TTR("Toggle the visibility of hidden files.")); - show_hidden->connect(SceneStringName(toggled), callable_mp(this, &EditorFileDialog::set_show_hidden_files)); - pathhb->add_child(show_hidden); - - pathhb->add_child(memnew(VSeparator)); - - Ref view_mode_group; - view_mode_group.instantiate(); - - mode_thumbnails = memnew(Button); - mode_thumbnails->set_theme_type_variation("FlatButton"); - mode_thumbnails->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::set_display_mode).bind(DISPLAY_THUMBNAILS)); - mode_thumbnails->set_toggle_mode(true); - mode_thumbnails->set_pressed(display_mode == DISPLAY_THUMBNAILS); - mode_thumbnails->set_button_group(view_mode_group); - mode_thumbnails->set_tooltip_text(TTR("View items as a grid of thumbnails.")); - pathhb->add_child(mode_thumbnails); - - mode_list = memnew(Button); - mode_list->set_theme_type_variation("FlatButton"); - mode_list->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::set_display_mode).bind(DISPLAY_LIST)); - mode_list->set_toggle_mode(true); - mode_list->set_pressed(display_mode == DISPLAY_LIST); - mode_list->set_button_group(view_mode_group); - mode_list->set_tooltip_text(TTR("View items as a list.")); - pathhb->add_child(mode_list); - shortcuts_container = memnew(HBoxContainer); pathhb->add_child(shortcuts_container); @@ -2268,7 +2357,8 @@ EditorFileDialog::EditorFileDialog() { drives->connect(SceneStringName(item_selected), callable_mp(this, &EditorFileDialog::_select_drive)); pathhb->add_child(drives); - pathhb->add_child(memnew(VSeparator)); + makedir_sep = memnew(VSeparator); + pathhb->add_child(makedir_sep); makedir = memnew(Button); makedir->set_theme_type_variation("FlatButton"); @@ -2276,6 +2366,8 @@ EditorFileDialog::EditorFileDialog() { makedir->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::_make_dir)); pathhb->add_child(makedir); + dir->set_h_size_flags(Control::SIZE_EXPAND_FILL); + body_hsplit = memnew(HSplitContainer); body_hsplit->set_v_size_flags(Control::SIZE_EXPAND_FILL); vbc->add_child(body_hsplit); @@ -2317,6 +2409,7 @@ EditorFileDialog::EditorFileDialog() { favorites->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); fav_vb->add_child(favorites); favorites->set_v_size_flags(Control::SIZE_EXPAND_FILL); + favorites->set_theme_type_variation("ItemListSecondary"); favorites->connect(SceneStringName(item_selected), callable_mp(this, &EditorFileDialog::_favorite_selected)); VBoxContainer *rec_vb = memnew(VBoxContainer); @@ -2326,6 +2419,7 @@ EditorFileDialog::EditorFileDialog() { recent = memnew(ItemList); recent->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); recent->set_allow_reselect(true); + recent->set_theme_type_variation("ItemListSecondary"); rec_vb->add_margin_child(TTR("Recent:"), recent, true); recent->connect(SceneStringName(item_selected), callable_mp(this, &EditorFileDialog::_recent_selected)); @@ -2345,21 +2439,56 @@ EditorFileDialog::EditorFileDialog() { l = memnew(Label(TTR("Directories & Files:"))); l->set_theme_type_variation("HeaderSmall"); + l->set_h_size_flags(Control::SIZE_EXPAND_FILL); + lower_hb->add_child(l); - list_vb->add_child(lower_hb); - preview_hb->add_child(list_vb); + show_hidden = memnew(Button); + show_hidden->set_theme_type_variation("FlatButton"); + show_hidden->set_toggle_mode(true); + show_hidden->set_pressed(is_showing_hidden_files()); + show_hidden->set_tooltip_text(TTR("Toggle the visibility of hidden files.")); + show_hidden->connect(SceneStringName(toggled), callable_mp(this, &EditorFileDialog::set_show_hidden_files)); + lower_hb->add_child(show_hidden); - filter_box = memnew(LineEdit); - filter_box->set_h_size_flags(Control::SIZE_EXPAND_FILL); - filter_box->set_placeholder(TTR("Filter")); - filter_box->connect(SceneStringName(text_changed), callable_mp(this, &EditorFileDialog::_filter_changed)); - lower_hb->add_child(filter_box); + lower_hb->add_child(memnew(VSeparator)); + + Ref view_mode_group; + view_mode_group.instantiate(); + + mode_thumbnails = memnew(Button); + mode_thumbnails->set_theme_type_variation("FlatButton"); + mode_thumbnails->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::set_display_mode).bind(DISPLAY_THUMBNAILS)); + mode_thumbnails->set_toggle_mode(true); + mode_thumbnails->set_pressed(display_mode == DISPLAY_THUMBNAILS); + mode_thumbnails->set_button_group(view_mode_group); + mode_thumbnails->set_tooltip_text(TTR("View items as a grid of thumbnails.")); + lower_hb->add_child(mode_thumbnails); + + mode_list = memnew(Button); + mode_list->set_theme_type_variation("FlatButton"); + mode_list->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::set_display_mode).bind(DISPLAY_LIST)); + mode_list->set_toggle_mode(true); + mode_list->set_pressed(display_mode == DISPLAY_LIST); + mode_list->set_button_group(view_mode_group); + mode_list->set_tooltip_text(TTR("View items as a list.")); + lower_hb->add_child(mode_list); + + lower_hb->add_child(memnew(VSeparator)); file_sort_button = memnew(MenuButton); - file_sort_button->set_flat(true); + file_sort_button->set_flat(false); + file_sort_button->set_theme_type_variation("FlatMenuButton"); file_sort_button->set_tooltip_text(TTR("Sort files")); + show_search_filter_button = memnew(Button); + show_search_filter_button->set_theme_type_variation("FlatButton"); + show_search_filter_button->set_toggle_mode(true); + show_search_filter_button->set_pressed(false); + show_search_filter_button->set_tooltip_text(TTR("Toggle the visibility of the filter for file names.")); + show_search_filter_button->connect(SceneStringName(toggled), callable_mp(this, &EditorFileDialog::set_show_search_filter)); + lower_hb->add_child(show_search_filter_button); + PopupMenu *p = file_sort_button->get_popup(); p->connect(SceneStringName(id_pressed), callable_mp(this, &EditorFileDialog::_file_sort_popup)); p->add_radio_check_item(TTR("Sort by Name (Ascending)"), static_cast(FileSortOption::FILE_SORT_NAME)); @@ -2371,6 +2500,9 @@ EditorFileDialog::EditorFileDialog() { p->set_item_checked(0, true); lower_hb->add_child(file_sort_button); + list_vb->add_child(lower_hb); + preview_hb->add_child(list_vb); + // Item (files and folders) list with context menu. item_list = memnew(ItemList); @@ -2396,6 +2528,15 @@ EditorFileDialog::EditorFileDialog() { prev_cc->add_child(preview); preview_vb->hide(); + filter_hb = memnew(HBoxContainer); + filter_hb->add_child(memnew(Label(RTR("Filter:")))); + filter_box = memnew(LineEdit); + filter_box->set_h_size_flags(Control::SIZE_EXPAND_FILL); + filter_box->set_placeholder(TTR("Filter")); + filter_hb->add_child(filter_box); + filter_hb->set_visible(false); + item_vb->add_child(filter_hb); + file_box = memnew(HBoxContainer); l = memnew(Label(TTR("File:"))); @@ -2423,8 +2564,10 @@ EditorFileDialog::EditorFileDialog() { item_list->connect("multi_selected", callable_mp(this, &EditorFileDialog::_multi_selected), CONNECT_DEFERRED); item_list->connect("item_activated", callable_mp(this, &EditorFileDialog::_item_dc_selected).bind()); item_list->connect("empty_clicked", callable_mp(this, &EditorFileDialog::_items_clear_selection)); - dir->connect("text_submitted", callable_mp(this, &EditorFileDialog::_dir_submitted)); - file->connect("text_submitted", callable_mp(this, &EditorFileDialog::_file_submitted)); + dir->connect(SceneStringName(text_submitted), callable_mp(this, &EditorFileDialog::_dir_submitted)); + filter_box->connect(SceneStringName(text_changed), callable_mp(this, &EditorFileDialog::_filter_changed)); + filter_box->connect(SceneStringName(text_submitted), callable_mp(this, &EditorFileDialog::_search_filter_selected).unbind(1)); + file->connect(SceneStringName(text_submitted), callable_mp(this, &EditorFileDialog::_file_submitted)); filter->connect(SceneStringName(item_selected), callable_mp(this, &EditorFileDialog::_filter_selected)); confirm_save = memnew(ConfirmationDialog); diff --git a/editor/gui/editor_file_dialog.h b/editor/gui/editor_file_dialog.h index 7a928a6188b9..8a07a2094372 100644 --- a/editor/gui/editor_file_dialog.h +++ b/editor/gui/editor_file_dialog.h @@ -44,6 +44,7 @@ class MenuButton; class OptionButton; class PopupMenu; class TextureRect; +class VSeparator; class EditorFileDialog : public ConfirmationDialog { GDCLASS(EditorFileDialog, ConfirmationDialog); @@ -82,12 +83,14 @@ class EditorFileDialog : public ConfirmationDialog { ITEM_MENU_DELETE, ITEM_MENU_REFRESH, ITEM_MENU_NEW_FOLDER, - ITEM_MENU_SHOW_IN_EXPLORER + ITEM_MENU_SHOW_IN_EXPLORER, + ITEM_MENU_SHOW_BUNDLE_CONTENT, }; ConfirmationDialog *makedialog = nullptr; LineEdit *makedirname = nullptr; + VSeparator *makedir_sep = nullptr; Button *makedir = nullptr; Access access = ACCESS_RESOURCES; @@ -128,8 +131,11 @@ class EditorFileDialog : public ConfirmationDialog { Button *refresh = nullptr; Button *favorite = nullptr; Button *show_hidden = nullptr; + Button *show_search_filter_button = nullptr; String search_string; + bool show_search_filter = false; + HBoxContainer *filter_hb = nullptr; LineEdit *filter_box = nullptr; FileSortOption file_sort = FileSortOption::FILE_SORT_NAME; MenuButton *file_sort_button = nullptr; @@ -164,8 +170,10 @@ class EditorFileDialog : public ConfirmationDialog { Ref parent_folder; Ref forward_folder; Ref back_folder; + Ref open_folder; Ref reload; Ref toggle_hidden; + Ref toggle_filename_filter; Ref favorite; Ref mode_thumbnails; Ref mode_list; @@ -203,10 +211,12 @@ class EditorFileDialog : public ConfirmationDialog { Vector