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
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
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
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
Thaddeus Crews
1b5064e3e3
Merge pull request #105505 from Ivorforce/simplify-force-trivial
...
Simplify use of `LocalVector` `force_trivial` template parameter.
2025-05-22 12:14:58 -05:00
Aaron Franke
15de1d6c35
Use Grisu2 algorithm in String::num_scientific to fix serializing
2025-05-22 09:13:16 -07:00
kobewi
42249bb659
Add @export_file_path to export raw paths (no UID)
2025-05-22 13:25:17 +02:00
Logan Detrick
1a427d3dec
Add feature hint string and "On" text for checkable groups
2025-05-21 14:56:55 -07:00
KirbyRider1337
caf8053b86
Adjusted get_median_from_3 and partitioner to also retrieve the pivot's index and check if either end of the partitioner has reached it to avoid comparing things with themselves
2025-05-21 14:38:09 -04:00
aaronp64
2a02cabe4d
Use LocalVector for RingBuffer
...
Updated RingBuffer to use LocalVector instead of Vector, to avoid _copy_on_write overhead when writing to the buffer.
2025-05-21 13:50:10 -04:00
Danil Alexeev
7aafa6ef18
GDScript: Remove `leftmost_column` and `rightmost_column` fields
2025-05-21 18:16:20 +03:00
Rémi Verschelde
25a3c27c41
Merge pull request #105628 from rsanchezsaez/apple/ios-visionos-4.5
...
Native visionOS platform support
2025-05-20 23:09:07 +02:00
Ricardo Sanchez-Saez
47971c0a27
Introduce 'visionos' platform derived from 'apple_embedded'
2025-05-19 15:47:01 -07:00
Ricardo Sanchez-Saez
457299449d
Introduce 'drivers/apple_embedded' abstract platform for code reuse
2025-05-19 15:37:13 -07:00
Lukas Tenbrink
70f8dd29f5
Simplify use of `LocalVector` `force_trivial` template parameter.
2025-05-19 20:27:14 +02:00
Thaddeus Crews
a2aefab4c7
Merge pull request #106486 from BlueCube3310/image-ch-detect-fix
...
Image: Fix detecting color channels
2025-05-19 08:01:40 -05:00
Thaddeus Crews
6c2d288ef1
Merge pull request #106337 from TokageItLab/arc-tolerance
...
Fix Quaternion arc constructor tolerance
2025-05-19 08:01:37 -05:00
Thaddeus Crews
2bf7ac76cf
Merge pull request #106456 from Repiteo/style/remove-DEBUG_METHODS_ENABLED
...
Style: Remove redundant `DEBUG_METHODS_ENABLED` macro
2025-05-19 08:01:35 -05:00
Thaddeus Crews
2d42b889d1
Merge pull request #104124 from Ivorforce/alloc-static-calloc
...
Add `Memory::alloc_static_zeroed` to allocate memory that's filled with zeroes.
2025-05-19 08:01:33 -05:00
Pedro J. Estébanez
f5383df83b
Overhaul `Resource::duplicate_for_local_scene()`
...
- Serves as a first step for future refactors.
- Code is simpler.
- Algorithm is more efficient: instead of two passes (dumb copy + resolve copies), it's single-pass.
- Now obeys `PROPERTY_USAGE_NEVER_DUPLICATE`.
- Now handles deep self-references (the resource to be duplicated being referenced somewhere deep).
2025-05-19 10:01:11 +02:00
Lukas Tenbrink
6fe17b264e
Use `if` based mod in `HashMap` and `HashSet` in loops (faster than `fastmod`).
2025-05-18 20:05:34 +02:00
Yufeng Ying
1384e82c2c
Improve ScriptLanguage get keyword API.
2025-05-17 18:43:19 +08:00
Thaddeus Crews
5620a215a1
Merge pull request #106021 from Alex2782/fix_xbox_controller_on_android
...
Fix Xbox Controller on Android
2025-05-16 07:43:09 -05:00
BlueCube3310
0f9986470a
Image: Fix detecting color channels
2025-05-16 12:47:57 +02:00
Adam Johnston
76a65de3ab
Change fuzzy search to only set case sensitive within set_query
2025-05-15 12:00:55 -07:00
Thaddeus Crews
d237e31a89
Style: Remove redundant `DEBUG_METHODS_ENABLED`
...
• Replaced with functionally identical and far more ubiquitous `DEBUG_ENABLED`
2025-05-15 13:09:41 -05:00
Thaddeus Crews
5538850d87
Core: Convert `Pair`/`KeyValue` to `constexpr`
2025-05-15 10:37:41 -05:00
Pedro J. Estébanez
820380817a
Exclude RD creation test functions from templates
2025-05-15 10:12:38 +02:00
Yufeng Ying
3bf400ffae
Move bisect to Span and deduplicate code.
...
Co-authored-by: Lukas Tenbrink <lukas.tenbrink@gmail.com>
2025-05-14 18:19:09 +08:00
Rémi Verschelde
1de9789806
Linux: Drop `ppc32` (32-bit PowerPC) architecture support
...
This was added together with `ppc64le` in #54490 , but seemingly only for the
purpose of getting it to compile on a Linux distro that aims at maximizing
support for all CPU architectures.
I don't think anyone has ever _run_ Godot on a `ppc32` system (do those even
support OpenGL ES 3.0?) and so I don't think we should aim to support it.
Debian dropped support for its PowerPC (`ppc32`) arch in Debian 9, released
in 2017.
2025-05-14 10:22:12 +02:00
Silc Lizard (Tokage) Renew
37aca09b23
Fix Quaternion arc constructor tolerance
2025-05-14 07:15:12 +09:00
Thaddeus Crews
0717136785
Merge pull request #106353 from YYF233333/hashmap_zst
...
Optimize `HashMap` size for zero-sized Allocators
2025-05-13 16:22:28 -05:00
Thaddeus Crews
1c4b660312
Merge pull request #96611 from Dynamic-Pistol/master
...
Add `PROPERTY_HINT_INPUT_NAME` for use with `@export_custom` to allow using input actions
2025-05-13 16:22:25 -05:00
Thaddeus Crews
f648eea7f4
Merge pull request #106209 from YYF233333/opt_get_actions
...
Optimize `InputMap::get_actions`
2025-05-13 16:22:23 -05:00
Thaddeus Crews
243c8932d3
Merge pull request #82497 from Repiteo/typed-array-consolidation
...
Typed array equality operator update
2025-05-13 16:22:15 -05:00
Thaddeus Crews
a2b49d0800
Merge pull request #93883 from TV4Fun/variant_join
...
Consolidate and simplify string joining code in `VariantUtilityFunctions`
2025-05-13 16:22:13 -05:00
Thaddeus Crews
172794337c
Merge pull request #99985 from allenwp/release-only-crash-99797
...
Print error message when index is out of range in `Variant::iter_get`
2025-05-13 16:22:11 -05:00
Thaddeus Crews
5b935881fc
Typed array equality operator logic updated
...
• Instead of calling to `_ref`, the same effect is achieved by calling to the base class assignment operator
• No longer need to be expose `_ref`; set back to private & remove reference from gdextension_interface
2025-05-13 14:41:16 -05:00
Allen Pestaluky
5657ecc542
Print error message when index is out of range in `Variant::iter_get` of `DEBUG_ENABLED` builds.
...
Mitigates #99797
2025-05-13 13:57:16 -04:00
Yufeng Ying
0babb2ab02
Optimize HashMap size for zero-sized Allocators.
2025-05-13 21:44:39 +08:00
Lukas Tenbrink
3207066e19
Add `Memory::alloc_static_zeroed` to allocate memory that's filled with zeroes.
...
This is generally faster than `malloc` followed by `memset` / loop-set to 0.
2025-05-13 01:57:05 +02:00
Rémi Verschelde
620206b0ae
Merge pull request #106309 from aaronp64/string_chr_appends
...
Avoid single character `String` allocations when appending characters
2025-05-13 01:05:45 +02:00
Rémi Verschelde
03cae12314
Merge pull request #106295 from timothyqiu/legacy-l10n
...
Remove translation loading logic that was never used
2025-05-13 01:05:31 +02:00
Rémi Verschelde
4c62c8aceb
Merge pull request #106020 from Ivorforce/hashmap-duplicate-hash
...
Optimize `HashMap` insertion by removing duplicate computation of hash and position
2025-05-13 01:04:57 +02:00
Rémi Verschelde
a529abc361
Merge pull request #101339 from Ivorforce/remove-nothing
...
Remove unintentional use of zero-width space.
2025-05-13 01:04:19 +02:00
Rémi Verschelde
2b037e8989
Merge pull request #93276 from mashumafi/avoid-vec-copy
...
Avoid unnecessary copy-on-write Vector/Array
2025-05-13 01:04:16 +02:00
Rémi Verschelde
b8fba34c17
Merge pull request #75629 from RedworkDE/non-atomic-error-macros
...
Remove pointless use of atomics in error macros
2025-05-13 01:04:12 +02:00
Joel Croteau
981f1e9298
Rename `VariantUtilityFunctions::join()` to `join_string()`
2025-05-12 17:51:09 -05:00
Joel Croteau
8be7ad32e7
Consolidate and simplify string joining code in `VariantUtilityFunctions`
...
`variant_utility.cpp` has 8 different copies of the exact same loop to join
vararg strings together. This is bad coding process and makes the codebase
needlessly cluttered. Also, the loop itself has an i == 0 check that is
unnecessary since String is auto-initialized to be empty and String::operator+=
already checks if it is empty before appending. This is a non-functional change
that only reorganizes the code to be a bit more readable.
2025-05-12 17:47:14 -05:00
aaronp64
8fb3697916
Avoid single character String allocations when appending characters
...
Removed calls to String::chr() when appending characters to Strings in Expression, Resource, and VariantParser, to avoid creating temporary Strings for each character. Also updated the Resource case to resize String up front, since size is known.
2025-05-12 17:35:42 -04:00
Lukas Tenbrink
e8c3409d40
Remove 4 unintentional uses of zero-width space and zero-width non-joiner.
2025-05-12 22:00:37 +02:00
RedworkDE
c5777c43d9
Remove pointless use of atomics in error macros
2025-05-12 17:06:19 +02:00
mashumafi
b73346ef19
Avoid copy-on-write when reading vectors
2025-05-12 16:08:05 +02:00
Haoyu Qiu
bbc6643e4c
Remove translation loading logic that was never used
2025-05-12 19:05:20 +08:00
Yufeng Ying
55a61cbd4a
Optimize InputMap::get_actions.
2025-05-12 17:51:27 +08:00
Thaddeus Crews
1b439d49a9
Merge pull request #100446 from YYF233333/vmap
...
Replace `VMap` used in `VisualShader` with `HashMap` and remove `VMap`
2025-05-09 11:29:25 -05:00
Thaddeus Crews
ba710dfde3
Merge pull request #106170 from IphStich/fix-typed-dictionary
...
Fix for debugging typed dictionaries
2025-05-09 11:29:18 -05:00
Thaddeus Crews
0bf9d88797
Merge pull request #106167 from Faless/mbedtls/fix_enable_threading
...
mbedTLS: Fix concurrency issues with TLS
2025-05-09 11:29:17 -05:00
Yufeng Ying
2db0a44519
Remove vmap.h
2025-05-09 19:05:28 +08:00
Thaddeus Crews
16aaa0a213
Merge pull request #103944 from KoBeWi/more_red_info
...
Improve error messages for `add_property_info()`
2025-05-08 07:19:33 -05:00
Elise
057759d413
Fix for debugging typed dictionaries
2025-05-08 21:11:23 +10:00
Fabio Alessandrelli
2c789788c0
mbedTLS: Fix concurrency issues with TLS
...
When we first integrated mbedTLS, we decided not to enable
MBEDTLS_THREADING_C (which adds mutex locking to calls modifying the
state), and instead to simply create separate contexts ("states") for
each connection.
This worked fine until recently.
Sadly, mbedTLS 3 added a global state for the new PSA crypto
functionalities (which are required to support TLSv1.3).
This results in TLSv1.3 connections to access and modify the global
state concurrently when running in threads.
This commit enables MBEDTLS_THREADING_C, and MBEDTLS_THREADING_C_ALT to
provide a generic Godot implementation using the engine Mutex class.
2025-05-08 11:45:00 +02:00
Thaddeus Crews
090d244b16
Merge pull request #101356 from Ivorforce/inline-utf-creation-functions
...
Inline `String::utf8` and `String::utf16` for their simplicity.
2025-05-07 12:48:32 -05:00
Thaddeus Crews
075b55068e
Merge pull request #100067 from aaronp64/randi_range_overflow
...
Fix `RandomPCG::random(int, int)` overflow bug
2025-05-07 12:48:30 -05:00
Thaddeus Crews
051712dfb8
Merge pull request #103264 from mhilbrunner/docs-path-join
...
Rename "file" param for str.path_join() to "path"
2025-05-07 12:48:29 -05:00
Thaddeus Crews
0ce3d75c20
Merge pull request #93783 from aaronp64/json_stringify_performance
...
Improve `JSON::stringify` performance
2025-05-07 12:48:28 -05:00
Thaddeus Crews
aa1ca2b244
Merge pull request #93517 from Repiteo/core/nodiscard-strings
...
Core: Add `[[nodiscard]]` to string-like classes/structs
2025-05-07 12:48:27 -05:00
aaronp64
f13b4b760a
Improve JSON::stringify performance
...
- Changed stringify to call static function _stringify directly, instead of creating JSON object
- Changed colon and end_statement from String to const char * to avoid extra allocations in each _stringify call
- Pass result String reference to each _stringify call to append to instead of allocating new String in each call
These changes make JSON::stringify around 2-3x faster in most cases
2025-05-06 18:27:32 -04:00
aaronp64
1089f61868
Fix RandomPCG::random(int, int) overflow bug
...
- Use int64_t for subtraction before converting to uint32_t
- Don't add one to uint32_t max value for rand() bounds
2025-05-06 17:54:12 -04:00
Thaddeus Crews
579feb387c
Core: Add `[[nodiscard]]` to string-like classes
2025-05-06 12:23:41 -05:00
aaronp64
d176ba045f
Array performance improvements to reduce copying/copy_on_write calls
...
- Avoid temporary copy of p_array in Array::append_array when types match
- Call ptrw() once before looping in methods that return new Arrays, to avoid copy_on_write call for each item (recursive_duplicate, slice, filter, map)
2025-05-06 13:19:50 -04:00
Lukas Tenbrink
26a6d4062d
Inline `String::utf8` and `String::utf16` for their simplicity.
2025-05-06 17:20:03 +02:00
Thaddeus Crews
e085acd71c
Merge pull request #104815 from Ivorforce/strnlen
...
Rename `_strlen_clipped` to `strnlen` (and use the system equivalent for `char *` inputs)
2025-05-06 08:38:06 -05:00
Thaddeus Crews
bd22587170
Merge pull request #106093 from KoBeWi/deprecated_forever
...
Remove registration of deprecated classes
2025-05-06 08:38:05 -05:00
Thaddeus Crews
4cb030d6bf
Merge pull request #106089 from mihe/rogue-newlines
...
Fix empty lines being added for errors with no script backtrace
2025-05-06 08:38:04 -05:00
Thaddeus Crews
7efe897343
Merge pull request #106085 from clayjohn/texture-decompress-import
...
Fix loading BPTC/ASTC textures on devices that don't support them
2025-05-06 08:38:04 -05:00
Thaddeus Crews
5fec9a9fdc
Merge pull request #100057 from aaronp64/container_validate_obj_perf
...
Improve `ContainerTypeValidate` performance for object types
2025-05-06 08:38:03 -05:00
Thaddeus Crews
aa24e3b671
Merge pull request #105884 from stuartcarnie/macos_embedded
...
macOS: Embedded window support.
2025-05-06 08:37:59 -05:00
Lukas Tenbrink
ec32dae1da
Rename `_strlen_clipped` to `strnlen` (and use the system equivalent for `char *` inputs).
...
Add `strnlen` for `char16_t *` and `wchar_t *`.
2025-05-06 15:17:07 +02:00
Stuart Carnie
00e1fdec2c
MacOS: Embedded window support.
2025-05-06 06:09:05 +10:00
kobewi
242293c451
Remove registration of deprecated classes
2025-05-05 20:16:50 +02:00
Thaddeus Crews
5bc01f2994
Merge pull request #105080 from beicause/basisu-ktx2-settings
...
BasisU: Use KTX2 format and add import options to configure encoder
2025-05-05 11:24:20 -05:00
Thaddeus Crews
5aca298548
Merge pull request #106051 from dalexeev/move-alt-codes-from-char-range
...
Move `alt_code_oem437` and `alt_code_cp1252` to separate header file
2025-05-05 11:24:14 -05:00
Thaddeus Crews
743c1eed49
Merge pull request #106027 from aaronp64/string_format_perf
...
Reduce allocations/copies in `String::format`
2025-05-05 11:24:13 -05:00
Mikael Hermansson
31b90246e7
Fix empty lines being added for errors with no script backtrace
2025-05-05 13:27:21 +02:00
clayjohn
2b3923880a
Continue checking for a texture decompression path even if end of import file is not reached
2025-05-05 00:19:32 -07:00
Danil Alexeev
413cb795cd
Move `alt_code_oem437` and `alt_code_cp1252` to separate header file
2025-05-03 11:52:49 +03:00
Alexander Hartmann
cf00265386
Fix Xbox Controller on Android
2025-05-03 01:09:05 +02:00
LuoZhihao
237597b01f
BasisU: Use KTX2 format and add import options to configure encoder
2025-05-03 01:45:38 +08:00
Lukas Tenbrink
1d49a557b6
Optimize away duplicate hash and position computation in `HashMap` on insert.
...
Co-authored-by: Nazarii <nazarii.yablonskyi.pp.2022@lpnu.ua>
2025-05-02 19:02:03 +02:00
aaronp64
a4ba8c37c9
Reduce allocations/copies in String::format
...
- Updated initial new_string copy to use copy constructor/increase ref count instead of copying to new allocated memory
- Removed Variant copies from Array before assigning to String
- Only convert i to String when needed
2025-05-02 12:32:11 -04:00
Danil Alexeev
2b30f23595
GDScript: Fix `Callable` call error text
2025-05-02 18:30:35 +03:00
Thaddeus Crews
01fc9aee6c
Core: Modernize C headers with C++ equivalents
2025-05-02 08:23:01 -05:00
Thaddeus Crews
9e9f6c9c35
Merge pull request #105916 from Repiteo/core/msvc-fastfail
...
Core: Use `__fastfail()` in MSVC error macros
2025-04-30 16:51:53 -05:00
Thaddeus Crews
304347c3ac
Merge pull request #104055 from Ivorforce/fixed-vector
...
Core: Add `FixedVector` template - a collection that can be used completely on the stack.
2025-04-30 16:51:53 -05:00
Thaddeus Crews
baf9d6e150
Merge pull request #105871 from Ivorforce/quick-stringname-fixes
...
Quick `StringName` improvements.
2025-04-30 16:51:52 -05:00
Thaddeus Crews
fb08e94c35
Merge pull request #105930 from a-johnston/fuzzy_search_index_field
...
Add original index field to fuzzy search result
2025-04-30 16:51:51 -05:00
Lukas Tenbrink
1b1ab76a14
Add `FixedVector` template.
...
This is a high performance `Vector`-like object that can be used if the maximum number of objects is small and known, and the objects are needed only temporarily.
2025-04-30 19:14:08 +02:00
Lukas Tenbrink
91362a61da
Simplify `StringName` to `bool` conversions.
...
Move `mutex` include of `string_name.h` to `string_name.cpp`.
2025-04-30 16:59:34 +02:00
lawnjelly
f8f350a32a
Add `GLOBAL_GET` cached macros.
...
GLOBAL_GET is an expensive operation which should not be used each frame / tick.
This PR adds macros which do a cheaper revision check, and only call the expensive GLOBAL_GET when project settings have changed.
Co-authored-by: Lukas Tenbrink <lukas.tenbrink@gmail.com>
2025-04-30 15:08:50 +01:00
Adam Johnston
e025c9ed11
Add original index field to fuzzy search result
2025-04-29 17:39:59 -07:00
Thaddeus Crews
60aae6d856
Merge pull request #86653 from Mickeon/string-format-error
...
Improve error message for `String.format` when using nested Arrays
2025-04-29 16:05:20 -05:00
Thaddeus Crews
eb3d0604ba
Merge pull request #105876 from KoBeWi/dynamic_outline
...
Inline static variables (part 1)
2025-04-29 16:05:16 -05:00
Thaddeus Crews
d849ebb776
Merge pull request #105896 from piiertho/enhancement/gdextension/fallback-to-default-get-property-state-when-not-overriden
...
Fallback to ScriptInstance::get_property_state when get_property_state is not implemented in ScriptInstanceExtension
2025-04-29 16:05:15 -05:00
Thaddeus Crews
347e51e077
Merge pull request #105922 from aaronp64/dictionary_has_all
...
Avoid extra copy/validation of keys in `Dictionary::has_all`
2025-04-29 16:05:14 -05:00
aaronp64
e4bd611e19
Avoid extra copy/validation of keys in Dictionary::has_all
...
Updated Dictionary::has_all to check its HashMap directly for each validated key instead of going through Dictionary::has, to avoid additional copy/validation of each key.
2025-04-29 15:27:12 -04:00
Thaddeus Crews
b23a233b5b
Core: Use `__fastfail()` in MSVC error macros
2025-04-29 12:25:11 -05:00
kobewi
5af4bef46f
Inline static variables (part 1)
2025-04-29 18:10:44 +02:00
Pierre-Thomas Meisels
e8c036beeb
Fallback to ScriptInstance::get_property_state when get_property_state is not implemented in ScriptInstanceExtension
2025-04-29 09:43:20 +02:00
Thaddeus Crews
44d20b2dc6
Merge pull request #100619 from Ivorforce/cowdata-resize-direct
...
Optimize / refactor `CowData`, combining resize and fork to avoid unnecessary reallocations.
2025-04-28 18:45:54 -05:00
Lukas Tenbrink
e57427900f
Use `BinaryMutex` instead of `Mutex` for `StringName`.
2025-04-28 17:13:26 +02:00
Thaddeus Crews
b7d4426fff
Merge pull request #104269 from lawnjelly/fti_scene_tree4
...
Physics Interpolation - Move 3D FTI to `SceneTree`
2025-04-28 10:01:34 -05:00
Thaddeus Crews
751ef44a13
Merge pull request #87714 from KoBeWi/hack_uid()
...
Expose `set_uid()`
2025-04-28 10:01:30 -05:00
Lukas Tenbrink
f064a415b3
Use `PagedAllocator` for `StringName` to accelerate and localize allocations.
2025-04-28 10:38:17 +02:00
kobewi
6f4cf04fb8
Expose set_uid()
2025-04-28 10:13:43 +02:00
Pāvels Nadtočajevs
03048aa94a
Improve edited scene layout direction detection.
2025-04-28 07:57:26 +03:00
Thaddeus Crews
f8a8d6cf04
Merge pull request #105700 from dementive/config-file-get-improvement
...
Improve ConfigFile get_sections and get_section_keys by returning Vector<String>
2025-04-27 19:21:31 -05:00
Thaddeus Crews
74fc4dae15
Merge pull request #95585 from HolonProduction/remove-cache
...
ScriptEditor: Remove obsolete completion cache
2025-04-27 19:21:30 -05:00
Thaddeus Crews
18f5b668d7
Merge pull request #105817 from Ivorforce/extension-loader-gdclass-fix
...
Fix `GDExtensionLoader` using the wrong super type in `GDSOFTCLASS`.
2025-04-27 19:21:29 -05:00
Thaddeus Crews
df78d4a866
Merge pull request #105546 from Splizard/fix_gdextension_tostring
...
Fix GDExtension `Object/Node::to_string` to check `is_valid` before returning the result
2025-04-27 19:21:24 -05:00
Thaddeus Crews
1a2a1b07df
Merge pull request #105799 from Repiteo/scons/enum-conversion-warnings
...
SCons: Add enum conversion warning
2025-04-27 19:21:23 -05:00
Thaddeus Crews
3947cbe3b2
Merge pull request #104386 from Repiteo/core/cpp-math
...
Core: Replace C math headers with C++ equivalents
2025-04-27 19:21:22 -05:00
Thaddeus Crews
ba0ad482ec
Merge pull request #105760 from Ivorforce/string-name-encapsulate
...
Remove unnecessary `StringName` `idx` cache in `_Data` to reduce its size.
2025-04-27 19:21:15 -05:00
Thaddeus Crews
999294d77a
Core: Integrate `CharStringT`
2025-04-27 09:58:39 -05:00
Lukas Tenbrink
f2bab45202
Fix `GDExtensionLoader` using the wrong super type in `GDSOFTCLASS`.
2025-04-27 10:28:08 +02:00
HolonProduction
56bad11517
ScriptEditor: Remove obsolete completion cache
2025-04-26 22:59:10 +02:00
Thaddeus Crews
dc9c34f0c6
SCons: Add enum conversion warning
2025-04-26 12:06:20 -05:00
lawnjelly
ae04a3a5dd
Physics Interpolation - Move 3D FTI to `SceneTree`
...
Moves 3D interpolation from server to the client code (`SceneTree`).
Complete rework of 3D physics interpolation, but using the same user API.
2025-04-26 14:13:30 +01:00
Thaddeus Crews
e37c6261ea
Merge pull request #105767 from Ivorforce/no-alloc-count
...
Optimize static allocations by removing unused `Memory::alloc_count`.
2025-04-25 18:25:32 -05:00
Lukas Tenbrink
af7610576a
Remove unused `Memory::alloc_count`.
2025-04-25 21:44:26 +02:00
Lukas Tenbrink
3b31636985
Remove unnecessary `StringName` `idx` cache in `_Data` to reduce its size by 4 bytes.
...
Encapsulate `StringName` details in its cpp file.
2025-04-25 19:22:29 +02:00
Thaddeus Crews
5c9f93ce03
SCons: Begin decoupling generation & build code
2025-04-25 08:23:01 -05:00
dementive
b8e44a0000
Improve ConfigFile get_sections and get_section_keys by returning Vector<String>
2025-04-24 20:10:31 -04:00
Thaddeus Crews
28089c40c1
Merge pull request #91006 from reduz/live-backtrace
...
Ability to print and log script backtraces
2025-04-24 17:18:52 -05:00
Thaddeus Crews
ca4038f22a
Merge pull request #103336 from dugramen/projecsetting-override-order
...
Keep ProjectSettings overrides right below the original setting
2025-04-24 17:18:46 -05:00
Lukas Tenbrink
d74ef8cb01
Rename `LocalVector.invert()` -> `LocalVector.reverse()` to match the `Vector`, `String` and `List` APIs.
2025-04-24 22:36:32 +02:00
dugramen
3354c32984
Keep ProjectSettings overrides right below the original setting
2025-04-24 15:00:40 -04:00
reduz
d1dcb40d56
Ability to print and log script backtraces
...
Co-authored-by: Mikael Hermansson <mikael@hermansson.io>
2025-04-24 18:54:41 +02:00
Dynamic-Pistol
c8fed1e1d0
Add PROPERTY_HINT_INPUT_NAME
...
Added PROPERTY_HINT_INPUT_NAME for StringName based off https://github.com/godotengine/godot-proposals/discussions/7559
2025-04-23 22:23:44 +02:00
Thaddeus Crews
931820d33c
Merge pull request #105278 from Ivorforce/reserve-smoke-test
...
Smoke test: Log an error if `reserve()` is called with fewer elements than `size()`
2025-04-23 12:01:28 -05:00
Thaddeus Crews
841c29d62c
Merge pull request #104985 from Ivorforce/stringname-always-string
...
Always use `String` as `StringName` backing internally.
2025-04-23 12:01:27 -05:00
Lukas Tenbrink
7c37188ca1
Smoke test: In collections, log an error if `reserve()` is called with a number smaller than the current size. Don't log an error if it is called with a number smaller than the current capacity.
2025-04-23 16:47:47 +02:00
RedMser
a96e8ac62c
Remove old path remaps system
...
Unused in public repositories, deprecated for over 6 years, and the
replacement system is well-tested by now.
2025-04-23 15:48:33 +02:00
Lukas Tenbrink
91fe434a86
Always use `String` as `StringName` backing internally.
2025-04-23 14:57:03 +02:00
Thaddeus Crews
2ffd5a3913
Merge pull request #104738 from YYF233333/cleanup_rid_owner
...
Use `LocalVector` in `RID_Owner::get_owned_list`
2025-04-22 10:44:25 -05:00
Thaddeus Crews
c0e695d5e8
Merge pull request #100944 from Nazarwadim/LocalVector_use_1.5x_growth_factor
...
Use 1.5x growth factor for LocalVector
2025-04-21 08:24:22 -05:00
Thaddeus Crews
6c35474568
Merge pull request #105538 from clayjohn/rid_owner-validation
...
Remove 2^31 cap on RID allocations
2025-04-21 08:24:21 -05:00
Thaddeus Crews
0cc292f880
Merge pull request #105272 from lodetrick/add_section_toggle
...
Add enable checkboxes to editor sections
2025-04-21 08:24:20 -05:00
Yyf2333
1a70a06a43
Change RID_Owner::get_owned_list.
2025-04-21 01:04:27 +08:00
Quentin Quaadgras
23ffdd79e8
fix gdextension Object/Node::to_string to check is_valid before returning the result
...
at best, this results in an empty string, at worst, the result is never
initialised when is_valid is false.
2025-04-19 10:45:12 +12:00
clayjohn
c6c06a966a
Allow chunk validator to wrap around in RID_Alloc so that we do not need to crash once we have made 2^31 allocations
2025-04-18 00:06:53 -07:00
Thaddeus Crews
ad40939b6f
Core: Replace C math headers with C++ equivalents
...
- Minor restructuring to ensure `math_funcs.h` is the central point for math functions
2025-04-16 15:49:02 -05:00
Thaddeus Crews
c5c1cd4440
Merge pull request #105453 from reduz/signals-thread-safe
...
Add thread safety to Object signals
2025-04-16 15:39:22 -05:00
Marc Gilleron
5e6df6a196
Use Math::abs to avoid ambiguity with integer abs
2025-04-16 20:41:36 +02:00
Juan
2f39d8ebef
Add thread safety to Object signals
...
* It turns out the majority of this work was done already by AThousandShips as part of #89451 . This allows to do lock-less emitting of signals.
* This means, that only the signal map needs to be protected, making the task simple and without risk of deadlocks, or affecting performance.
* Objects can choose to not protect signals for performance (as example Node uses thread guards for protection, so these signals are not thread safe).
2025-04-16 17:14:44 +02:00
cier
ebe9370724
Add enable checkboxes to editor sections
...
Fixes https://github.com/godotengine/godot-proposals/issues/4173
2025-04-15 13:49:41 -07:00
Thaddeus Crews
86b1fc7205
Merge pull request #104774 from Cykyrios/fix-center-bbcode-ansi-tag
...
Add missing "/" to "center" tag in `__print_line_rich()`
2025-04-15 12:28:44 -05:00
Thaddeus Crews
29dcead192
Merge pull request #105394 from Zylann/quaternion_abs
...
Use Math::abs to avoid ambiguity with integer abs
2025-04-15 12:28:41 -05:00
Thaddeus Crews
b8950a4662
Merge pull request #105392 from aaronp64/array_min_max
...
Optimize `Array` `min`/`max` methods
2025-04-15 12:28:40 -05:00
Lukas Tenbrink
015a3b0434
Optimize / refactor `CowData`, combining `resize` and `fork` to avoid unnecessary reallocations.
2025-04-15 17:01:26 +02:00
Thaddeus Crews
e5ccaa79e2
Merge pull request #105334 from WindyDarian/insert_at_end
...
Allow inserting at end of array again
2025-04-14 19:39:54 -05:00
Thaddeus Crews
034e614f10
Merge pull request #105326 from basicer/fix-unused-paramater-warning
...
Supress unused paramater warning conflicting with if constexpr
2025-04-14 19:39:52 -05:00
Thaddeus Crews
3d80279f80
Merge pull request #90971 from billuo/string-format-rid
...
Fix `RID` cannot be string formatted
2025-04-14 19:39:50 -05:00
Thaddeus Crews
f56a4d4fe4
Merge pull request #105138 from stuartcarnie/fix_hangs
...
Renderer: Reduce scope of mutex locks to prevent common deadlocks
2025-04-14 19:39:47 -05:00
Thaddeus Crews
53608e3376
Merge pull request #104239 from Ivorforce/optimize-undenormalize
...
Optimize reverb by removing stray `volatile` from the `undenormalize` function signature.
2025-04-14 19:39:46 -05:00