7997 Commits

Author SHA1 Message Date
Lukas Tenbrink
3564e7c231 Add LocalVector move semantics (constructor and operator=). 2024-12-19 15:05:05 +01:00
Lukas Tenbrink
19992e3284 Add move semantics (constructor, operator=) to List. 2024-12-19 15:04:15 +01:00
Kiro
06efe84bca Remove duplicate utf8() calls 2024-12-19 10:15:46 +01:00
Thaddeus Crews
361e3b4fe8
Core: Expand std::initializer_list support 2024-12-18 18:46:59 -06:00
Hilderin
9d2a4c03be Embedding game process in editor 2024-12-18 17:52:42 -05:00
Pāvels Nadtočajevs
eaf2d7c5b0 [GDScript] Fix Packed*Array OP_IN using low precision int and float as input. 2024-12-18 23:41:27 +02:00
Yufeng Ying
be86ce3103 Apply iwyu suggestion in core. 2024-12-19 00:43:47 +08:00
Rémi Verschelde
851d8e49e8
Merge pull request #100386 from hpvb/core-ubsan
Core: Fix UBSAN reports
2024-12-18 17:23:32 +01:00
HP van Braam
240f510fa7 Core ubsan fixes
This fixes UBSAN errors reported by running our testsuite, importing the
TPS demo, and running the TPS demo. I have tried, wherever possible, to
fix issues related to reported issues but not directly reported by UBSAN
because thse code paths just happened to not have been exercised in
these cases.

These fixes apply only to errors reported, and caused by, core/

The following things have been changed:

* Make sure there are no implicit sign changing casts in core.
* Explicitly type enums that are part of a public API such that users of
  the API cannot pass in wrongly-sized values leading to potential stack
  corruption.
* Ensure that memcpy is never called with invalid or null pointers as
  this is undefined behavior, and when the engine is built with
  optimizations turned on leads to memory corruption and hard to debug
  crashes.
* Replace enum values only used as static values with constexpr static
  const values instead. This has no runtime overhead. This makes it so
  that the size of the enums is explicit.
* Make sure that nan and inf is handled consistently in String.
* Implement a _to_int template to ensure that all of the paths use the
  same algorhithm, and correct the negative integer case.
* Changed the way the json serializer precision work, and added tests to
  verify the new behavior. The behavior doesn't quite match master in
  particulary for negative doubles as the original code tried to cast -inf
  to an int. This then led to negative doubles losing all but one of
  their decimal points when serializing. Behavior in GDScript remains
  unchanged.
2024-12-18 14:31:12 +01:00
Rémi Verschelde
d328c00ad3
Merge pull request #99667 from RandomShaper/res_load_verb
ResourceLoader: Print load message only when actually loading
2024-12-18 09:53:06 +01:00
Pedro J. Estébanez
6740823e40 ResourceLoader: Print load message only when actually loading 2024-12-18 09:36:16 +01:00
Yelloween
0153cb8c16 Fix incorrect MODIFIER_MASK value
Updated key modifier mask and documented API change

Changed the old value

Changed the old value inside the .expected file

Resolved Conflicts

Moved changes to the end
2024-12-18 02:59:29 +03:00
Hugo Locurcio
7a04d85ec3
Only allow valid types in Decal, Light3D projector, PointLight2D texture and CSGMesh3D mesh
If an invalid type is supplied (which can still be done from a script),
a warning is printed (along with a workaround for ViewportTexture).

This also adds support for "negative" resource hints such as
"Texture2D,-ViewportTexture" to exclude one or more subclasses
from a class hint.

Co-authored-by: Tomasz Chabora <kobewi4e@gmail.com>
2024-12-17 20:41:12 +01:00
Lukas Tenbrink
a636c04244 Optimize CowData and LocalVector functions .insert and .remove_at by using move semantics. 2024-12-17 14:10:10 +01:00
Raul Santos
69f1cc10b6
GDExtension: Add icon path to class creation info
Allows GDExtensions to set the icon of a class programmatically, which is useful for extensions that don't use a `.gdextension` file.
2024-12-17 08:43:12 +01:00
MJacred
40832387ce Fix Input::remove_joy_mapping
Erasing a joypad mapping can invalidate other attached joypads and the fallback mapping guid
2024-12-16 20:27:33 +01:00
Thaddeus Crews
24a8c05cbd
Merge pull request #100335 from kiroxas/ImproveResourceUID--id_to_textPerformance
Improve `ResourceUID::id_to_text` performance
2024-12-16 12:10:05 -06:00
Thaddeus Crews
e42c22f359
Merge pull request #100426 from Ivorforce/variant-move-constructor
Add move assignment and move constructor to Variant.
2024-12-16 12:09:52 -06:00
Thaddeus Crews
9c9af038d5
Merge pull request #91060 from dalexeev/code-edit-add-doc-tooltips
Code Editor: Add documentation tooltips
2024-12-16 12:09:45 -06:00
Thaddeus Crews
7254761a46
Merge pull request #98861 from MJacred/get_joypad_infos_on_windows
Get joypad's vendor ID, product ID and name on Windows for XInput devices.
2024-12-16 12:09:44 -06:00
Thaddeus Crews
a7fa0528bb
Merge pull request #100372 from Calinou/os-add-get-version-alias
Add `OS.get_version_alias()` to return a human-readable Windows/macOS version number
2024-12-16 12:09:40 -06:00
Lukas Tenbrink
8c4e674770 Add move semantics (constructor, assignment) to StringName. 2024-12-16 19:02:52 +01:00
Rémi Verschelde
08508d2e01
Merge pull request #99700 from hpvb/scene_tree_editor_performance
Improve Scene Tree editor performance
2024-12-16 17:16:00 +01:00
MJacred
01a2726c59 Get joypad's vendor ID, product ID, and name on Windows 2024-12-15 23:59:11 +01:00
Lukas Tenbrink
df3e9291c6 Rename String::copy_from functions to their respective encodings (parse_latin1, parse_wstring, parse_utf32). 2024-12-15 21:46:50 +01:00
Lukas Tenbrink
34fa0bf3ec Add move assignment and move constructor to Variant.
Add `_to_variant` helper functions to `gdvirtual.gen.inc` to work around an MSVC bug.
2024-12-15 14:38:46 +01:00
Kiro
5f401e63b5 Improve ResourceUID::id_to_text performance 2024-12-15 10:41:13 +01:00
Danil Alexeev
80d11500b5
Code Editor: Add documentation tooltips 2024-12-15 10:51:33 +03:00
Hugo Locurcio
928982891e Add OS.get_version_alias() to return a human-readable Windows/macOS version number
Windows 11's major version number is actually 10.x.x, which can be confusing
if you don't know about this quirk. `OS.get_version_alias()` avoids this
by displaying the "branding" version number and the build number as a suffix,
so that individual updates can still be distinguished from each other.

On macOS, `OS.get_version_alias()` returns the version number prepended
with the version name (e.g. Sequoia for macOS 15).

On other operating systems, this returns the same value as `OS.get_version()`.
2024-12-14 18:47:50 +01:00
Rémi Verschelde
68559c4906
Merge pull request #100367 from Ivorforce/swap-move
Optimize `SWAP` macro by using move semantics.
2024-12-14 18:25:42 +01:00
Hilderin
4e19ab8afe
Fix connecting a signal with a double click is too difficult
Co-authored-by: Danil Alexeev <dalexeev12@yandex.ru>
2024-12-14 16:18:34 +03:00
Markus Sauermann
ee2930cad4 Remove temporary project conversion
This project conversion should be removed before the next stable release,
because it affects only projects opened during dev-builds.
2024-12-14 00:37:47 +01:00
Lukas Tenbrink
383d933f53 Optimize SWAP macro by using move semantics. 2024-12-13 16:19:52 +01:00
Thaddeus Crews
ba2c5c1e61
Merge pull request #100318 from dsnopek/stream-peer-extension-put-partial-data-bug
Fix `StreamPeerExtension::put_partial_data()` to call `_put_partial_data()`
2024-12-12 16:13:38 -06:00
Thaddeus Crews
9fba62a938
Merge pull request #100239 from Ivorforce/cowdata-move-constructor
Add move constructor and move assignment to `CowData`, `String`, `Char16String`, `CharString`, and `Vector`.
2024-12-12 16:13:30 -06:00
Thaddeus Crews
9c290c4c56
Merge pull request #100033 from Daylily-Zeleen/daylily-zeleen/optimize_callable_to_string
Optimize callable's stringify text.
2024-12-12 16:13:23 -06:00
HP van Braam
6f7525c396 Improve Scene Tree editor performance
We now cache the Node*<>TreeItem* mapping in the SceneTreeEditor. This
allows us to make targeted updates to the Tree used to display the scene
tree in the editor.

Previously on almost all changes to the scene tree the editor would
rebuild the entire widget, causing a large number of deallocations an
allocations. We now carefully manipulate the Tree widget in-situ saving
a large number of these allocations.

In order to know what Nodes need to be updated we add a
editor_state_changed signal to Node, this is a TOOLS_ENABLED,
editor-only signal fired when changes to Node happen that are relevant
to editor state.

We also now make sure that when nodes are moved/renamed we don't check
expensive properties that cannot contain NodePaths. This saves a lot of
time when SceneTreeDock renames a node in a scene with a lot of
MeshInstances. This makes renaming nodes go from ~27 seconds to ~2
seconds on large scenes.

SceneTreeEditor instances will now also not do all of the potentially
expensive update work if they are invisible. This behavior is turned off
by default so it won't affect existing users. This change allows the
editor to only update SceneTreeEditors that actually in view. In
practice this means that for most changes instead of updating 6
SceneTreeEditors we only update 1 instantly, and the others only when
they become visible.

There is definitely more that could be done, but this is already a
massive improvement. In complex scenes we see an improvement of 10x,
things that used to take ~30 seconds now only take 2.

This fixes #83460

I want to thank KoBeWi, TokisanGames, a-johnston, aniel080400 for
their tireless testing. And AeioMuch for their testing and providing a
fix for the hover issue.
2024-12-12 22:47:05 +01:00
David Snopek
8c01fc2274 Fix StreamPeerExtension::put_partial_data() to call _put_partial_data() 2024-12-12 08:31:12 -06:00
Rémi Verschelde
7b15c0622e
Merge pull request #100295 from Ivorforce/string-builder-inplace
Optimize `StringBuilder.as_string` by constructing the string in-place and skipping unnecessary checks.
2024-12-12 14:10:21 +01:00
Rémi Verschelde
321bd35317
Merge pull request #100294 from Ivorforce/count-no-realloc
Optimize `String.count` and `String.countn` by avoiding repeated reallocations.
2024-12-12 14:10:17 +01:00
Rémi Verschelde
819db4daf5
Merge pull request #99559 from mayoff/OperatorEvaluatorModNZ-ptr_evaluate
Fix `Variant` modulo operation
2024-12-12 14:09:59 +01:00
Rémi Verschelde
1e1e862204
Merge pull request #98100 from BlueCube3310/image-cleanup-more
Image: More cleanup and reduced code duplication
2024-12-12 14:09:49 +01:00
BlueCube3310
335077a03f Image: More cleanup and reduced code duplication. 2024-12-12 11:52:59 +01:00
Lukas Tenbrink
76af9537ed Optimize StringBuilder.as_string by constructing the string in-place and skipping unnecessary checks.
Co-authored-by: YYF233333 <nbyyf2002@mail.ustc.edu.cn>
2024-12-12 01:35:02 +01:00
Thaddeus Crews
c5e6f6276b
Merge pull request #100110 from DarioSamo/rd-get-data-async
Implement `RD::buffer_get_data_async()` and `RD::texture_get_data_async()`
2024-12-11 17:35:29 -06:00
Lukas Tenbrink
ef3eecd34e Optimize String.count and String.countn by avoiding repeated reallocations. 2024-12-12 00:28:13 +01:00
Dario
054891de04 Implement buffer_get_data_async and texture_get_data_async. 2024-12-11 11:55:23 -08:00
Rémi Verschelde
c2e4ae782a
Merge pull request #100235 from akien-mga/revert-97303
Revert "Avoid duplicating signals from scene instances into packed scenes"
2024-12-11 18:48:18 +01:00
Lukas Tenbrink
57073ba14e Add move constructor and move assignment to CowData, String, Char16String, CharString and Vector. 2024-12-11 15:52:15 +01:00
Rémi Verschelde
44dfa7e710
Merge pull request #99895 from mihe/jolt-physics
Add Jolt Physics as an alternative 3D physics engine
2024-12-11 14:53:57 +01:00