Commit Graph

803 Commits

Author SHA1 Message Date
c8ce7e34e2 i18n: Misc fixes translation strings
Adds some translator comments to solve some questions raised on Weblate.
2022-06-08 12:57:54 +02:00
5ebdfc31b2 Merge pull request #61319 from JFonS/taa_wip
Initial TAA implementation
2022-06-07 20:53:55 +02:00
1b776a6e7a Allow picking similar colours using OKHSL. 2022-06-07 05:53:27 -07:00
ba832d83b2 Initial TAA implementation
Initial TAA support based on the implementation in Spartan Engine.

Motion vectors are correctly generated for camera and mesh movement, but there is no support for other things like particles or skeleton deformations.
2022-06-07 13:14:44 +02:00
45af29da80 Add a new HashSet template
* Intended to replace RBSet in most cases.
* Optimized for iteration speed
2022-05-20 22:40:38 +02:00
900c676b02 Use range iterators for RBSet in most cases 2022-05-19 12:09:16 +02:00
746dddc067 Replace most uses of Map by HashMap
* Map is unnecessary and inefficient in almost every case.
* Replaced by the new HashMap.
* Renamed Map to RBMap and Set to RBSet for cases that still make sense
  (order matters) but use is discouraged.

There were very few cases where replacing by HashMap was undesired because
keeping the key order was intended.
I tried to keep those (as RBMap) as much as possible, but might have missed
some. Review appreciated!
2022-05-16 10:37:48 +02:00
dbd7a31507 Implement exponential operator (**) to GDScript/Expressions 2022-05-11 16:30:37 +03:00
d8935b27a9 Fix warnings found by Emscripten 3.1.10
Fix `-Wunused-but-set-variable`, `-Wunqualified-std-cast-call`, and
`-Wliteral-range` warnings.
2022-05-10 13:03:13 +02:00
868fe4942c Allow AStar2D/AStar3D zero point weight
Allow AStar2D/AStar3D zero point weight.

Limit was set to 1 which seemed like an arbitrary value as lower values down to zero can be useful for common gameplay navigation elements like teleports.
2022-05-06 02:33:10 +02:00
e7a58a7eb6 Core: Rename math 'phi' arguments to 'angle' 2022-05-05 14:17:39 +02:00
fa7a7795f0 Rename Basis get_axis to get_column, remove redundant methods 2022-05-03 09:37:47 -05:00
931838b330 Merge pull request #60627 from aaronfranke/rename-elements
Rename Transform2D and Basis `elements` to `columns` and `rows` respectively
2022-05-03 14:40:01 +02:00
c273ddc3ee Style: Partially apply clang-tidy's cppcoreguidelines-pro-type-member-init
Didn't commit all the changes where it wants to initialize a struct
with `{}`. Should be reviewed in a separate PR.

Option `IgnoreArrays` enabled for now to be conservative, can be
disabled to see if it proposes more useful changes.

Also fixed manually a handful of other missing initializations / moved
some from constructors.
2022-05-02 16:28:25 +02:00
1bf94dff3a Rename Basis "elements" to "rows" 2022-04-29 08:02:56 -05:00
b831fb0a54 Rename Transform2D "elements" to "columns" 2022-04-29 08:02:39 -05:00
de4c97758a Fix more issues found by cppcheck. 2022-04-20 10:34:00 +03:00
46ef52162e Color: Rename to_srgb/to_linear to include base color space
This helps reduce confusion around sRGB <> Linear conversions by making
both input and output color spaces explicit.
2022-04-13 11:45:52 +02:00
8fbed3d582 Rearrange TriangleMesh stack level incrementation to fix MSVC compiler optimization bug 2022-04-13 05:48:49 +01:00
f851c4aa33 Fix some issues found by cppcheck. 2022-04-06 14:34:37 +03:00
099b024a2b Fix DynamicBVH crash after #59867
I made a wrong assumption that initialization the other pointer in the
union would properly initialize the `childs` array.
2022-04-05 02:17:34 +02:00
f8ab79e68a Zero initialize all pointer class and struct members
This prevents the pitfall of UB when checking if they have been
assigned something valid by comparing to nullptr.
2022-04-04 19:49:50 +02:00
109d08c84a Add protective checks for invalid handle use in BVH
Adds DEV_ASSERTS that will halt at runtime if the BVH is misused with invalid IDs, and adds ERR_FAIL macros to prevent calling with invalid IDs.

Any such misuse is a bug in the physics, but this should flag any errors quickly.
2022-03-23 09:19:26 +00:00
7913e04950 Rename AStar to AStar3D 2022-03-20 17:34:40 +03:00
5c4de463fe Merge pull request #59229 from taigi100/Bugfix-#59215-Standard-color-name-returns-non-standard-color-code 2022-03-17 11:38:06 +01:00
bd247fa315 Update color constants to use HEX codes 2022-03-17 11:36:23 +02:00
b06d253920 Fix blend animation to solve TRS track bug & blend order inconsistency 2022-03-16 05:11:55 +09:00
21637dfc25 Remove VARIANT_ARG* macros
* Very old macros from the time Godot was created.
* Limited arguments to 5 (then later changed to 8) in many places.
* They were replaced by C++11 Variadic Templates.
* Renamed methods that take argument pointers to have a "p" suffix. This was used in some places and not in others, so made it standard.
* Also added a dereference check for Variant*. Helped catch a couple of bugs.
2022-03-09 18:39:13 +01:00
4e3d5a9a2c VariantUtility: Unexpose Math::range_step_decimals
This method was meant only as a convenience for editor code
to allow using a step of 0 to disable snapping.

It was exposed by mistake when refactoring GlobalScope.
2022-03-07 22:13:49 +01:00
0565676893 Protection for array operator for Vector2 / 3 in DEV builds
A previous PR had changed the array operator to give unbounded access. This could cause crashes where old code depended on this previous safe behaviour.

This PR adds DEV_ASSERT macros for out of bound access to DEV builds, allowing us to quickly identify bugs in calling code, without affecting performance in release or release_debug editor builds.
2022-03-07 11:15:45 +00:00
0d1e3893d9 Merge pull request #57630 from lawnjelly/bvh4_templated_checks
[4.x] BVH - Sync BVH with 3.x
2022-03-04 23:29:38 +01:00
de9446186d Merge pull request #58488 from lawnjelly/float_literals_casts 2022-03-01 01:32:07 +01:00
061ab30051 Use is_zero_approx and fix spelling in CameraMatrix invert 2022-02-26 12:19:54 -06:00
1485924a2b Float literals - fix main primitives to use real_t casting
Uses (real_t) casting to ensure appropriate calculations are done in 32 bit where real_t is compiled as 32 bit.
2022-02-24 08:15:10 +00:00
e031aa06ee Core: Use forward declares for Vector3/Vector3i
Add add Vector3 operator in Vector3i.
2022-02-19 16:47:24 +01:00
b8b4580448 Style: Cleanup single-line blocks, semicolons, dead code
Remove currently unused implementation of TextureBasisU, could be re-added
later on if needed and ported.
2022-02-16 14:06:29 +01:00
865da09871 Implement cubic_interpolate() as MathFunc for refactoring 2022-02-12 18:11:17 +09:00
5298e16e80 Float literals - fix main primitives to use .f
Converts float literals from double format (e.g. 0.0) to float format (e.g. 0.0f) where appropriate for 32 bit calculations.
2022-02-10 18:43:19 +00:00
51cac0709e Fix Vector2 and Vector2i coord access via operator[] 2022-02-09 09:17:17 +01:00
8aa4ed8b5b Merge pull request #57729 from TechnoPorg/astar-fix-invalid-include
Remove a cross include from a_star.cpp
2022-02-07 00:35:42 +01:00
5108af42ad Remove a cross include from a_star.cpp 2022-02-06 15:05:17 -07:00
8c7268664d Fix integer vector mul/div operators and bindings.
* Vector2i and Vector3i mul/div by a float results in Vector2 and Vector3 respectively.
* Create specializations to allow proper bindings.

This fixes #44408 and supersedes #44441 and keeps the same rule of int <op> float returnig float, like with scalars.
2022-02-06 13:34:41 +01:00
a0c87d4c11 Merge pull request #57620 from Haydoggo/expression-exp-fix
Fix Expression's parsing of positive exponent literals
2022-02-05 10:14:10 +01:00
1305ff92f7 Make parser treat all exponent literals as float 2022-02-05 16:34:26 +13:00
84290fe4b1 Merge pull request #57623 from akien-mga/core-math-struct-em-all 2022-02-04 19:02:57 +01:00
f8eaab5b47 BVH - Sync BVH with 3.x
Templated mask checks and generic NUM_TREES
Fix leaking leaves
2022-02-04 16:51:21 +00:00
5ddb518496 Core: Make all Variant math types structs
Some were declared as structs (public by default) and others as classes
(private by default) but in practice all these math types exposed as
Variants are all 100% public.
2022-02-04 16:48:24 +01:00
e223bad86d Core: Move Vector2i to its own vector2i.h header
Also reduce interdependencies and clean up a bit.
2022-02-04 16:32:21 +01:00
5f56d385b0 Core: Move Rect2i to its own rect2i.h header
And take the opportunity to improve interdependencies a bit with forward
declares where possible.
2022-02-04 14:17:30 +01:00
244db37508 Cleanup and move char functions to the char_utils.h header. 2022-02-04 11:35:01 +02:00