1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-08 12:40:44 +00:00
Commit Graph

821 Commits

Author SHA1 Message Date
Thaddeus Crews
01fc9aee6c Core: Modernize C headers with C++ equivalents 2025-05-02 08:23:01 -05:00
Lukas Tenbrink
af7610576a Remove unused Memory::alloc_count. 2025-04-25 21:44:26 +02: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
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
Rob Blanckaert
88a43b7039 Supress unused paramater warning conflicting with if constexpr 2025-04-12 13:18:12 -07:00
Thaddeus Crews
cade15a163 Merge pull request #92475 from AThousandShips/string_replace_char
Add `String::replace_char(s)` methods for performance and convenience
2025-04-10 10:18:16 -05:00
Thaddeus Crews
fc1dbda769 Merge pull request #105164 from stuartcarnie/apple_pthread
Apple: Add pthread implementation of `Thread` class
2025-04-10 10:18:12 -05:00
A Thousand Ships
889410dcda Add String::replace_char(s) methods for performance and convenience 2025-04-10 13:08:45 +02:00
Stuart Carnie
8c8d6de3e7 Apple: Add pthread implementation of Thread class
This allows Apple platforms to override the default stack size of
a thread in the WorkerThreadPool, which is 512KiB by default.

This must be increased, as SPIRV-Cross, used by the Metal driver, can
use deeply nested stacks, as can debug builds.
2025-04-10 09:35:40 +10:00
Adam Scott
b7402b7597 Move THREADS_ENABLED check after common imports 2025-04-08 14:24:13 -04:00
runzh-crypto
9977abd697 Validate custom directory when project is started 2025-04-04 21:21:42 +08:00
Thaddeus Crews
207a2b6472 Core: Integrate warning suppression macro helpers 2025-04-03 10:13:46 -05:00
Yufeng Ying
7a1a970c25 size() <= 0 and size() < 1. 2025-04-02 19:18:44 +08:00
bruvzg
48bfe13e4f Add methods to decode/encode multibyte encodings. 2025-03-28 17:32:34 +02:00
Thaddeus Crews
f09ee0171a Style: Begin integrating simple .clangd fixes 2025-03-22 13:24:35 -05:00
Lukas Tenbrink
6759d3b812 Fix "Unicode parsing error" spam when opening editor. 2025-03-14 08:32:26 +01:00
Aaron Franke
97ee05e9b7 Rename version defines to GODOT_VERSION_* to match GDExtension godot-cpp 2025-03-12 11:11:38 -07:00
Thaddeus Crews
74907876d3 Merge pull request #103759 from Ivorforce/zero-constructible
Optimize `Array.resize` by using `memset` (through new `is_zero_constructible` type trait)
2025-03-12 10:31:55 -05:00
Lukas Tenbrink
75bc471965 Add is_zero_constructible to denote if a type can be semi-trivially constructed with all 0 bytes.
Optimize `CowData` and `LocalVector` resize for zero constructible types.
Mark several compatible types as `is_zero_constructible`.
2025-03-12 09:49:24 +01:00
aaronp64
a7d0724b1a Remove outdated vformat comments/workarounds in Time.cpp
Time methods returning Strings with both date and time values included were calling vformat twice, as older vformat implementation limited how many arguments could be passed in.  Updated these methods to just call vformat once.
2025-03-11 06:57:30 -04:00
A Thousand Ships
331a43a9d8 Add String::remove_char(s) methods for performance and convenience 2025-03-10 13:19:28 +01:00
Thaddeus Crews
324512e11c Style: Replace header guards with #pragma once 2025-03-07 17:33:47 -06:00
Pāvels Nadtočajevs
6ed12bfc5d [Linux/BSD] Offload RenderingDevice creation test to subprocess. 2025-03-04 13:18:26 +02:00
Pāvels Nadtočajevs
ab717497ef [Windows] Offload RenderingDevice creation test to subprocess. 2025-02-24 19:40:10 +02:00
Jānis Kiršteins
0e266b0099 [iOS] Sync the boot splash and the launch screen image scale modes 2025-02-12 17:41:18 +01:00
Marc Gilleron
c7a9d64eaf Add color channel filter to editor texture previews 2025-01-11 23:27:48 +00:00
Rémi Verschelde
da4f9339ea Merge pull request #101072 from hpvb/thread-id-optimization
Optimize `Thread::get_caller_id()`
2025-01-05 14:52:18 +01:00
HP van Braam
873eb21ce8 Optimize Thread::get_caller_id()
By making sure that Thread always has a valid caller_id we can remove the
check making the function a straightforward getter instead.

In some quick tests we see a repeatable performance improvement of
somewhere around 0.32 mspf in TPS demo.

Co-authored-by: Pedro J. Estébanez <pedrojrulez@gmail.com>
2025-01-03 17:33:10 +01:00
Ricardo Subtil
b77aa473a1 Implement a "Recovery Mode" for recovering crashing/hanging projects during initialization 2025-01-03 10:50:15 +00:00
Rémi Verschelde
b34adf29dc Remove unused OS _display_driver_id member 2025-01-03 01:52:25 +01:00
Rémi Verschelde
21e6671740 Merge pull request #100937 from Repiteo/style/clang-format-sync
Style: Enforce `AllowShortFunctionsOnASingleLine`
2025-01-03 00:49:44 +01:00
Thaddeus Crews
e06d83860d Style: Enforce AllowShortFunctionsOnASingleLine 2025-01-02 10:09:41 -06:00
Rémi Verschelde
f2d4dac92e Thread: Re-add <new> include for std::hardware_destructive_interference_size
Somehow it would still build fine, but would crash when compiled with GCC 12.2
on Debian 12.

Also re-add wrongly removed Mutex include from `thread_safe.h`, where it's used
in macros.

Add IWYU pragma comments to prevent it from mistakenly flagging those as unused.
2025-01-01 22:43:42 +01:00
Thaddeus Crews
b97c8b37f6 Merge pull request #98441 from Yelloween10/fix-modifier-mask
Fix incorrect `KEY_MODIFIER_MASK` value
2024-12-23 11:15:17 -06:00
Rémi Verschelde
a11364d1e6 Merge pull request #99010 from Hilderin/embedding-game-process
Embed game process in editor
2024-12-20 23:56:43 +01:00
Thaddeus Crews
bf9ef5f8a5 Merge pull request #100564 from YYF233333/iwyu
Remove unused headers in core
2024-12-19 19:59:55 -06:00
Hilderin
9d2a4c03be Embedding game process in editor 2024-12-18 17:52:42 -05: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
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
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
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
Mikael Hermansson
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
Thaddeus Crews
da8b9ba1ff Merge pull request #99168 from RandomShaper/even_better_spinlock
SpinLock: Overhaul false sharing prevention
2024-12-09 14:33:31 -06:00
Student Main
e0693f8ad8 Add loongarch64 support 2024-12-06 00:18:26 +08:00
Thaddeus Crews
156bc92282 Merge pull request #98397 from adamscott/add-tmp-support
Add temp utilities (alias `OS::get_temp_dir()`, `FileAccess::create_temp()`, and `DirAccess::create_temp()`)
2024-12-03 14:40:59 -06:00
Thaddeus Crews
a135a6478a Merge pull request #98383 from RandomShaper/deprecate_unsafe_th_rend
Deprecate the pointless unsafe threading model for rendering
2024-12-03 14:40:56 -06:00
Adam Scott
1b3e483899 Add file and dir temporary utilities
Co-authored by @Alex2782 for the Android bindings.
Many thanks to the reviewers also.

Co-authored-by: Alex <alex.hart.278@gmail.com>
2024-12-02 12:08:14 -05:00
Rémi Verschelde
acdffd0a14 Merge pull request #99864 from HuntJSparra/server-features-regression
Fix `OS::has_feature()` skipping custom features
2024-12-02 15:51:56 +01:00