8777 Commits

Author SHA1 Message Date
Marwen Azouzi
873833b4a7 Remove redundant queue_redraw() & fix typo 2025-05-29 17:22:32 +02:00
Spartan322
b666f4fc15 Merge commit godotengine/godot@de37627404 2025-05-29 05:22:55 -04:00
kit
ebf71cd4f3 Fix CodeEdit hover word lookup 2025-05-28 18:35:15 -04:00
Thaddeus Crews
2cde9292c3 Merge pull request #106876 from Ivorforce/localvector-no-force-trivial
Un-support `force_trivial` parameter for `LocalVector`. Instead, users should use `resize_uninitialized`.
2025-05-28 09:47:45 -05:00
Thaddeus Crews
a115af487a Merge pull request #105146 from Ivorforce/cowdata-unref-sanity-check
Add a safety check for `CowData::_unref()`, for when something tries to add elements during destruction.
2025-05-28 09:47:39 -05:00
Thaddeus Crews
bb47f01481 Merge pull request #106390 from akien-mga/linux-drop-ppc32
Linux: Drop `ppc32` (32-bit PowerPC) architecture support
2025-05-28 09:47:34 -05:00
Lukas Tenbrink
37415530d7 Un-support force_trivial parameter for LocalVector. Instead, users are reformatted to use resize_uninitialized to make it explicit that the resize does not initialize missing elements. 2025-05-27 18:43:36 +02:00
Lukas Tenbrink
d2d57849de Add a safety check for CowData::_unref(), for when something tries to add elements during destruction. 2025-05-27 18:00:48 +02:00
Thaddeus Crews
f619ca2519 Merge pull request #60143 from Rindbee/better-connection-dialog
Add a flag to make the connection automatically emit the source object.
2025-05-27 09:39:34 -05:00
Thaddeus Crews
b09c70c8db Merge pull request #106855 from timothyqiu/control-through-stillness
Don't update scene tree when calling `Translation::set_locale()`
2025-05-27 09:39:33 -05:00
Thaddeus Crews
91b3a26438 Merge pull request #106848 from Faless/mp/rpc_config_revert
Expose `get_rpc_config` and `get_node_rpc_config`
2025-05-27 09:39:32 -05:00
Thaddeus Crews
0c12e758ac Merge pull request #106569 from Ivorforce/hashmap-if-mod
Accelerate `HashMap` and `HashSet` lookup by using `if` based modulo in loops
2025-05-27 09:39:29 -05:00
Thaddeus Crews
0f67c3e992 Merge pull request #104522 from Ivorforce/localvector-force-trivial-resize
Core: Add `resize_initialized` and `resize_uninitialized` to `Vector` and `LocalVector`
2025-05-27 09:39:27 -05:00
Thaddeus Crews
63dff62948 Merge pull request #100673 from RandomShaper/res_duplicate
Overhaul resource duplication
2025-05-27 09:39:25 -05:00
Rindbee
5e2396e001 Add a flag to make the connection automatically emit the source object.
Mainly used to improve the connection dialog.

Not implemented in `emit_signalp()`, append the source object when a PackScene is instantiated.
2025-05-27 20:19:03 +08:00
Haoyu Qiu
9285bb3a51 Don't update scene tree when calling Translation::set_locale() 2025-05-27 09:34:58 +08:00
Haoyu Qiu
8d93b6a54c Add translation preview in editor 2025-05-27 07:59:28 +08:00
Fabio Alessandrelli
b73ec1fa9b Expose get_rpc_config and get_node_rpc_config 2025-05-27 00:43:21 +02:00
Lukas Tenbrink
670ab7a383 Add resize_initialized and resize_uninitialized to LocalVector. 2025-05-26 18:35:41 +02:00
Lukas Tenbrink
4cb8a0c77e Add resize_initialized and resize_uninitialized to Vector. These functions serve as replacements for resize, to make sure the caller understands whether elements need to be initialized 'by hand' after the call. 2025-05-26 18:35:41 +02:00
Thaddeus Crews
955744fdaf Merge pull request #106733 from Ivorforce/ok-rainbows
Use OkHSV for `RichTextLabel` rainbows
2025-05-26 11:24:44 -05:00
Thaddeus Crews
8bcec7afa9 Merge pull request #106730 from Ivorforce/simplify-memnew-arr-placement
Simplify `Memory::memnew_arr_placement` to always initialize memory
2025-05-26 11:24:43 -05:00
Thaddeus Crews
c38b856f39 Merge pull request #106717 from KoBeWi/uid_in_path_factory
Expose helper methods for converting UIDs
2025-05-26 11:24:40 -05:00
Thaddeus Crews
81953d3cc2 Merge pull request #106445 from YYF233333/opt_sarray
Optimize and simplify `sarray`
2025-05-26 11:24:38 -05:00
Thaddeus Crews
06301bee3e Merge pull request #106775 from Ivorforce/gdsoftclass-expand
Move compatible functionality from `GDCLASS` to `GDSOFTCLASS`.
2025-05-26 11:24:26 -05:00
Thaddeus Crews
506417fe43 Merge pull request #105623 from lodetrick/section-feature-hide
Allow Inspector Section Checkboxes to hide features, Add "On" text to checkboxes
2025-05-26 11:24:25 -05:00
Thaddeus Crews
6132792f05 Merge pull request #106386 from bruvzg/mac_fs_name
Implement `get_filesystem_type` on macOS and Linux.
2025-05-26 11:24:25 -05:00
Thaddeus Crews
c2fde491b7 Merge pull request #105996 from a-johnston/fuzzy_search_case_fix
Only update case sensitive fuzzy searching within `set_query`
2025-05-26 11:24:23 -05:00
Thaddeus Crews
f196a7128c Merge pull request #106759 from aaronp64/time_year_calc
Update `time.cpp` year/unix time conversions to be constant time
2025-05-26 11:24:22 -05:00
Lukas Tenbrink
621a8d14fa Move compatible functionality from GDCLASS to GDSOFTCLASS. 2025-05-26 17:41:15 +02:00
Pedro J. Estébanez
6841b45552 Add tests for resource duplication 2025-05-26 17:05:04 +02:00
Fabio Alessandrelli
c28d5d0058 Revert "Expose get_rpc_config and get_node_rpc_config"
This reverts commit 8835f326b1.
2025-05-26 15:57:38 +02:00
Pedro J. Estébanez
342266cfd9 Overhaul Variant::duplicate() for resources
This in the scope of a duplication triggered via any type in the `Variant` realm. that is, the following: `Variant` itself, `Array` and `Dictionary`. That includes invoking `duplicate()` from scripts.

A `duplicate_deep(deep_subresources_mode)` method is added to `Variant`, `Array` and `Dictionary` (for compatibility reasons, simply adding an extra parameter was not possible). The default value for it is `RESOURCE_DEEP_DUPLICATE_NONE`, which is like calling `duplicate(true)`.

Remarks:
- The results of copying resources via those `Variant` types are exactly the same as if the copy were initiated from the `Resource` type at C++.
- In order to keep some separation between `Variant` and the higher-level animal which is `Resource`, `Variant` still contains the original code for that, so it's self-sufficient unless there's a `Resource` involved. Once the deep copy finds a `Resource` that has to be copied according to the duplication parameters, the algorithm invokes the `Resource` duplication machinery. When the stack is unwind back to a nesting level `Variant` can handle, `Variant` duplication logic keeps functioning.

While that is good from a responsibility separation standpoint, that would have a caveat: `Variant` would not be aware of the mapping between original and duplicate subresources and so wouldn't be able to keep preventing multiple duplicates.

To avoid that, this commit also introduces a wormwhole, a sharing mechanism by which `Variant` and `Resource` can collaborate in managing the lifetime of the original-to-duplicates map. The user-visible benefit is that the overduplicate prevention works as broadly as the whole `Variant` entity being copied, including all nesting levels, regardless how disconnected the data members containing resources may be across al the nesting levels. In other words, despite the aforementioned division of duties between `Variant` and `Resource` duplication logic, the duplicates map is shared among them. It's created when first finding a `Resource` and, however how deep the copy was working at that point, the map kept alive unitl the stack is unwind to the root user call, until the first step of the recursion.

Thanks to that common map of duplicates, this commit is able to fix the issue that `Resource::duplicate_for_local_scene()` used to ignore overridden duplicate logic.
2025-05-26 10:06:40 +02:00
Pedro J. Estébanez
2a03b459b9 Overhaul Resource::duplicate()
Thanks to a refactor, `Resource::duplicate_for_local_scene()` and `Resource::duplicate()` are now both users of the same, parametrized, implementation.

`Resource::duplicate()` now honors deepness in a more consistent and predictable fashion. `Resource::duplicate_deep()` is added (instead of just adding a parameter to the former, for compatibility needs).

The behavior after this change is as follows:
  - Deep (`deep=true`, formerly `subresources=true`):
    - Previously, only resources found as direct property values of the one to copy would be, recursively, duplicated.
    - Now, in addition, arrays and dictionaries are walked so the copy is truly deep, and only local subresources found across are copied.
    - Previously, subresources would be duplicated as many times as being referenced throughout the main resource.
    - Now, each subresource is only duplicated once and from that point, a referenced to that single copy is used. That's the enhanced behavior that `duplicate_for_local_scene()` already featured.
    - The behavior with respect to packed arrays is still duplication.
    - Formerly, arrays and dictionaries were recursive duplicated, with resources ignored.
    - Now, arrays and dictionaries are recursive duplicated, with resources duplicated.
    - When doing it through `duplicate_deep()`, there's a` deep_subresources_mode` parameter, with various possibilites to control if no resources are duplicated (so arrays, etc. are, but keeping referencing the originals), if only the internal ones are (resources with no non-local path, the default), or if all of them are. The default is to copy every subresource, just like `duplicate(true)`.
  - Not deep (`deep=false`, formerly `subresources=false`): <a name="resource-shallow"></a>
    - Previously, the first level of resources found as direct property values would be duplicated unconditionally. Packed arrays, arrays and dictionaries were non-recursively duplicated.
    - Now, no subresource found at any level in any form will be duplicated, but the original reference kept instead. Packed arrays, arrays and dictionaries are referenced, not duplicated at all.
    - Now, resources found as values of always-duplicate properties are duplicated, recursively or not matching what was requested for the root call.

This commit also changes what's the virtual method to override to customize the duplication (now it's the protected `_duplicate()` instead of the public `duplicate()`).
2025-05-26 10:05:25 +02:00
kobewi
9c37ca5383 Expose helper methods for converting UIDs 2025-05-25 00:26:16 +02:00
Spartan322
3f2a63752f Add animated WebP import
Add animated WebP file loading
Add animated WebP image frames load test assertions
Add libwebpdemux for local libwebp to linuxbsd/detect.py
2025-05-23 19:36:37 -04:00
Pāvels Nadtočajevs
d609cf62a0 Implement get_filesystem_type on macOS and Linux. 2025-05-23 23:05:06 +03:00
aaronp64
ba68e2a1e8 Update time.cpp year/unix time conversions to be constant time
Added functions to convert between year and day from unix timestamps in constant time, to avoid having to iterate one year at a time.
2025-05-23 14:02:14 -04:00
Yufeng Ying
8773f95e40 Optimize and simplify sarray. 2025-05-23 23:47:57 +08:00
Yufeng Ying
3545e945f6 Simplify implementation of errarray. 2025-05-23 23:14:59 +08:00
Spartan322
7e02ac82f0 Add APNG import
Add APNG file loading
Add APNG image load test assertions
Add APNG patch to libpng
2025-05-23 06:17:38 -04:00
George L. Albany
952ae4141d Merge pull request #821 from Spartan322/add/gif-importer
Add GIF import
2025-05-23 10:14:39 +00:00
Spartan322
614048d3ee Add GIF import
Add GIF file loading
Add `ResourceFormatLoader` for `SpriteFrames`
Add `ResourceFormatLoader` for `AnimatedTexture`
Add `ImageFrames` resource for handling image sequence
Add `ImageFramesLoader` for resource loading image sequences
Add `ResourceFormatLoader` for `ImageFrames`
Add GIF image load test assertions
Add ImageFrames test cases
2025-05-23 05:28:40 -04:00
Dubhghlas McLaughlin
c97ca14537 Preallocate vectors with known size. 2025-05-22 16:14:28 -05:00
Lukas Tenbrink
ea6fbd6687 Use OkHSV for rainbow labels. 2025-05-22 22:53:32 +02:00
Lukas Tenbrink
4371aa864d Simplify Memory::memnew_arr_placement to always initialize memory, to force callers to make the decision of whether to initialize. 2025-05-22 22:25:12 +02:00
Spartan322
38fb5272ad Merge commit godotengine/godot@7a0ab9d561 2025-05-22 14:03:25 -04:00
Thaddeus Crews
15cd5e1619 Merge pull request #106689 from aaronp64/ringbuffer_localvector
Use `LocalVector` for `RingBuffer`
2025-05-22 12:15:03 -05:00
Thaddeus Crews
6258a3e224 Merge pull request #98750 from aaronfranke/grisu
Use Grisu2 algorithm in `String::num_scientific` to fix serializing
2025-05-22 12:15:02 -05:00
Thaddeus Crews
c3c3657a0d Merge pull request #106661 from KirbyRider1337/dont-compare-the-same-item-with-itself
Prevent comparison of items with themselves while partitioning sort arrays
2025-05-22 12:14:58 -05:00