Commit Graph

7974 Commits

Author SHA1 Message Date
08508d2e01 Merge pull request #99700 from hpvb/scene_tree_editor_performance
Improve Scene Tree editor performance
2024-12-16 17:16:00 +01:00
01a2726c59 Get joypad's vendor ID, product ID, and name on Windows 2024-12-15 23:59:11 +01:00
df3e9291c6 Rename String::copy_from functions to their respective encodings (parse_latin1, parse_wstring, parse_utf32). 2024-12-15 21:46:50 +01:00
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
5f401e63b5 Improve ResourceUID::id_to_text performance 2024-12-15 10:41:13 +01:00
80d11500b5 Code Editor: Add documentation tooltips 2024-12-15 10:51:33 +03:00
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
68559c4906 Merge pull request #100367 from Ivorforce/swap-move
Optimize `SWAP` macro by using move semantics.
2024-12-14 18:25:42 +01:00
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
383d933f53 Optimize SWAP macro by using move semantics. 2024-12-13 16:19:52 +01:00
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
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
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
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
8c01fc2274 Fix StreamPeerExtension::put_partial_data() to call _put_partial_data() 2024-12-12 08:31:12 -06:00
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
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
819db4daf5 Merge pull request #99559 from mayoff/OperatorEvaluatorModNZ-ptr_evaluate
Fix `Variant` modulo operation
2024-12-12 14:09:59 +01:00
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
335077a03f Image: More cleanup and reduced code duplication. 2024-12-12 11:52:59 +01:00
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
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
ef3eecd34e Optimize String.count and String.countn by avoiding repeated reallocations. 2024-12-12 00:28:13 +01:00
054891de04 Implement buffer_get_data_async and texture_get_data_async. 2024-12-11 11:55:23 -08:00
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
57073ba14e Add move constructor and move assignment to CowData, String, Char16String, CharString and Vector. 2024-12-11 15:52:15 +01:00
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
d470c2ac6a Add Jolt Physics as an alternative 3D physics engine
Co-authored-by: Jorrit Rouwe <jrouwe@gmail.com>
2024-12-11 13:57:25 +01:00
ba66c478c0 Merge pull request #100041 from Ivorforce/optimize-string-similarity
Optimize String.similarity by avoiding allocation for bigrams.
2024-12-10 14:16:00 -06:00
3ef8e835c2 Merge pull request #99775 from Ivorforce/string-builder-template-append
Optimize StringBuilder by using `LocalVector` instead of `Vector`.
2024-12-10 14:15:58 -06:00
8f16f864a6 Merge pull request #99765 from dalexeev/core-fix-json-from-to-native
Core: Fix `JSON.{from,to}_native()` issues
2024-12-10 14:15:53 -06:00
d108d4f29e Merge pull request #100147 from esainane/vector-victor
Remove apparent contradiction in vector.h header
2024-12-10 14:15:52 -06:00
78215f3cc6 Merge pull request #100132 from Ivorforce/string-compile-time-strlen
Optimize String construction from statically known strings by evaluating `strlen` at compile-time.
2024-12-10 14:15:49 -06:00
bdf24924e6 [Codestyle] Merge identical code piece. 2024-12-11 00:48:00 +08:00
2153a60425 Revert "Avoid duplicating signals from scene instances into packed scenes"
This partially reverts commit 8a42e3d3ef.

Comment improvements and the test case were kept, with one part commented out.
2024-12-10 10:42:58 +01:00
66b7d5f1b5 Remove apparent contradiction in vector.h header
3205a92ad8 was a major commit which removed `PoolVector`, and replaced
most references to `PoolVector` with `Vector` instead. In most cases,
this was appropriate, given that `PoolVector` was being replaced with
`Vector`, as an effective generalist in 64-bit address space layouts.

However, vector.h itself was left with an artifact advising the reader
to use `Vector` instead of `Vector` for large arrays. While this led
to a fascinating deep dive, and hopefully improved some of the
documentation along the way, it's probably best to clean this up for
the next person.
2024-12-10 01:51:30 +00:00
a3f48f7047 Optimize String construction from statically known strings allowing strlen to be evaluated at compile time, where possible. 2024-12-09 21:47:28 +01:00
4b1a51d3e3 Merge pull request #100075 from demolke/simplify
Fix handling of leading `..` in simplify_path
2024-12-09 14:33:34 -06:00
5b312d0e59 Merge pull request #99816 from Ivorforce/string-copy-from-optimizations
Optimize `String::copy_from` and `String::copy_from_unchecked` implementations, improving String allocation speed.
2024-12-09 14:33:33 -06:00
da8b9ba1ff Merge pull request #99168 from RandomShaper/even_better_spinlock
SpinLock: Overhaul false sharing prevention
2024-12-09 14:33:31 -06:00
7d4db793e6 Merge pull request #100044 from Yelloween10/fix-input-event-metadata
Fix discarded input event metadata in `xformed_by`
2024-12-09 14:33:27 -06:00
473c28b1ad Merge pull request #98118 from bruvzg/escape_colors
Add support for 24-bit color escape sequences, simplify `print_rich` BBCode parsing.
2024-12-09 14:33:25 -06:00
a607bca2fd Merge pull request #100024 from Ivorforce/optimize-string-single-char
Optimize string single char contains calls.
2024-12-09 14:33:24 -06:00
2654dbaf5c Merge pull request #99984 from KoBeWi/negative_diff_but_it's_deleting_whole_files
Move singleton StringName definitions to header
2024-12-09 14:33:11 -06:00
8df2dbe2f6 Optimize StringBuilder append for static strings, and as_string(). 2024-12-08 16:39:25 +01:00
875b48366c Optimize String.similarity by avoiding allocation for bigrams. 2024-12-08 13:28:40 +01:00
e1c42392c2 Improve string copy_from and copy_from_unchecked implementations, by making use of caller contracts and language spec (NULL termination and casts). 2024-12-07 01:41:25 +01:00
b5c31ebb41 Add contains_char() for single-character 'contains' calls. 2024-12-06 20:23:35 +01:00
98a23136d5 Fix missing event metadata in _input() with Input.parse_input_event()
Use merge_meta_from() for metadata copying.

Fixed include order

Removed unnecessary line
2024-12-06 22:08:16 +03:00
d3c9bee653 Move singleton StringName definitions to header 2024-12-06 13:43:31 +01:00