Commit Graph

1079 Commits

Author SHA1 Message Date
f134769506 Fix various typos
* Add TODO notes for typos that should be fixed for 5.0

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2025-01-08 14:47:42 +02:00
d47fef15b8 Merge pull request #100991 from TokageItLab/180deg-arc
Fix looking at with 180 degree arc
2025-01-03 00:49:59 +01:00
d0c421976c Fix looking at with 180 degree arc
Co-authored-by: Fruitsalad <949631+fruitsalad@users.noreply.github.com>
2025-01-02 15:47:01 +09:00
4e48b19e1f Add Color.from_rgba8 and deprecate Color8 2024-12-27 11:26:59 +01:00
dac0b67c4d Merge pull request #100659 from clayjohn/color-srgb-precision
Increase precision in `linear_to_srgb()` and `srgb_to_linear()`
2024-12-20 23:57:35 +01:00
46ce499b6f Increase precision in linear_to_srgb and srgb_to_linear
This avoids the situation where white stops being white after conversion. While maintaining as much floating point ops as possible
2024-12-20 10:49:43 -07:00
bf9ef5f8a5 Merge pull request #100564 from YYF233333/iwyu
Remove unused headers in core
2024-12-19 19:59:55 -06:00
be86ce3103 Apply iwyu suggestion in core. 2024-12-19 00:43:47 +08:00
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
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
bdf24924e6 [Codestyle] Merge identical code piece. 2024-12-11 00:48:00 +08:00
d58b2e879f Get rid of easily removable uses of const_cast 2024-12-01 17:50:13 -08:00
bd1a35ce9e Core: Fix JSON.{from,to}_native() issues 2024-11-29 12:43:06 +03:00
f2f48aaf36 Fix stringification of Projection 2024-11-25 21:10:32 +01:00
9b5c7e9efa Merge pull request #99545 from KoBeWi/Vector4.0
Fix stringification of Vector4
2024-11-25 13:22:33 -06:00
e210313045 Fix stringification of Vector4 2024-11-22 21:44:30 +01:00
e8a4b45ce4 Style: Add 19.1.0 LLVM options to .clang-format 2024-11-22 09:24:32 -06:00
23fc8e22a3 Merge pull request #95303 from EIREXE/inverted_composer
Fix `Projection::invert` for orthographic projection
2024-11-20 17:03:03 +01:00
02b2efc668 Fix Projection::invert on orthogonal projections and others.
Fixes #68878, specially when using orthographic projection.

Also adds some tests.
2024-11-18 16:13:04 +01:00
363c0b5fec Merge pull request #47502 from KoBeWi/add_0
Always add decimal when converting float to string
2024-10-31 20:14:39 -05:00
38f9769bc6 [Core] Improve error messages with vformat 2024-10-30 15:55:51 +01:00
b7a0971ad2 Merge pull request #97934 from adamscott/give-AThousandShips-a-break
[Codestyle] Set clang-format `RemoveSemicolon` rule to `true`
2024-10-29 19:25:36 -05:00
0d350e7108 Set clang-format RemoveSemicolon rule to true
- Set clang-format `Standard` rule to `c++20`
2024-10-25 13:49:43 -04:00
9f0ae21095 Expose Geometry2D.bresenham_line() method
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2024-10-25 10:27:55 +03:00
5c0f2414cd Always add decimal when printing float 2024-10-23 15:00:21 +02:00
9652695f6f Restore arc_tolerance value when using Clipper2's InflatePaths
This was missed when upgrading from Clipper to Clipper2.
2024-10-09 14:13:23 +02:00
e117ed9cd4 Rename Vector4.components -> coord 2024-09-26 14:02:00 +02:00
a4c1804cab Merge pull request #97483 from akien-mga/clang-format-19.1.0
CI: Update `clang-format` pre-commit hook to 19.1.0
2024-09-26 12:46:04 +02:00
991e6c92ab Merge pull request #96923 from Repiteo/style/warning-admonition
Style: Add `WARNING:` as new comment admonition
2024-09-26 12:45:38 +02:00
c92a6c7e27 CI: Update clang-format pre-commit hook to 19.1.0 2024-09-26 11:46:12 +02:00
32c83a228d Style: Add WARNING: as new comment admonition 2024-09-25 09:44:42 -05:00
9f9ee0c813 SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
3bfadeff25 Fix C# operator *(Transform3D, AABB) 2024-09-20 00:18:54 +02:00
c46b5af06b fix astar partial path destination can be solid/disabled
* AStar2D, AStar3D and AStarGrid2D will now return a path when allow_partial_path is true even if the destination is a solid/disabled point.

# Conflicts:
#	core/math/a_star_grid_2d.cpp
#	core/math/a_star_grid_2d.h
2024-09-12 20:09:41 -07:00
d1caac5e75 Merge pull request #93856 from timothyqiu/expression-period
Fix parsing of `4.` in Expression
2024-09-11 12:34:39 +02:00
202e197717 Improve AStarGrid2D performance when jumping is enabled 2024-09-05 18:12:43 +02:00
52d1b0be4a Merge pull request #96328 from object71/fix-animation-snap-96159
Add `modf` function and fix animation editor snap behavior
2024-08-30 23:38:02 +02:00
fcc8518bce Add modf function and fix snap behavior
Fixes #96159
2024-08-30 17:49:57 +03:00
2fadd095a7 Merge pull request #93893 from Togira123/fix-rand-weighted-return-value
Fix `rand_weighted` incorrectly returning -1
2024-08-28 00:11:35 +02:00
1e6b6eaf49 Merge pull request #92123 from timothyqiu/estimate-end
Change param name of AStar's `_estimate_cost` method
2024-08-28 00:10:47 +02:00
9c7cf5440c Merge pull request #91868 from Chaosus/astargrid_get_point_positions_in_region
Add a method to retrieve all points within a region to `AStarGrid2D`
2024-08-28 00:10:42 +02:00
7db24a9ad5 Simplify and fix Rect2/AABB get_support function 2024-08-19 23:55:31 -07:00
886d5865a4 Merge pull request #95291 from BlueCube3310/hdr-optimizations
Optimize .hdr loading and RGB9E5 conversion
2024-08-16 10:35:32 +02:00
27f3dd8d01 Merge pull request #93149 from Malcolmnixon/smoothstep-degenerate-case
Handle the smoothstep degenerate case of empty range
2024-08-16 10:33:58 +02:00
23fc704cbc This PR handles the smoothstep degenerate case where the range is empty.
It also updates the documentation to describe positive and negative ranges.

Co-Authored-By: Hugo Locurcio <hugo.locurcio@hugo.pro>
Co-Authored-By: kleonc <9283098+kleonc@users.noreply.github.com>
2024-08-15 19:08:05 -04:00
80cf6cbfe9 Optimize .hdr loading and RGB9E5 conversion 2024-08-09 22:39:30 +02:00
2f8ab4a654 Fixed Timestep Interpolation (3D)
Adds 3D fixed timestep interpolation to the rendering server.
This does not yet include support for multimeshes or particles.

Co-authored-by: lawnjelly <lawnjelly@gmail.com>
2024-07-07 22:15:23 +02:00
453c8753a9 Add a check to prevent user to call AStarGrid2D::update when its not needed 2024-07-06 14:59:38 +03:00
ab13513403 Fix RandomPCG::rand_weighted incorrectly returning -1 2024-07-04 02:00:59 +02:00
ee9cea521d Fix parsing of 4. in Expression 2024-07-02 20:53:52 +08:00