Commit Graph

217 Commits

Author SHA1 Message Date
Aaron Franke 22e2696767
Add unit tests for type_convert Variant utility function 2023-09-08 10:13:22 -05:00
Rémi Verschelde 11518665b7
Codestyle: Don't use auto where not warranted
We allow using auto for lambdas or complex macros where a return type
may change based on the parameters. But where the type is clear, we
should be explicit.

Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2023-09-07 16:15:18 +02:00
bruvzg 2b3bbde6da
[String] Fix string conversion for -0.0 float values. 2023-09-05 11:32:55 +03:00
Jcrespo 528a76486c Add inverse hyperbolic functions `asinh()`, `acosh()` & `atanh()`
GDScript has the following built-in trigonometry functions:

- `sin()`
- `cos()`
- `tan()`
- `asin()`
- `acos()`
- `atan()`
- `atan()`
- `sinh()`
- `cosh()`
- `tanh()`

However, it lacks the hyperbolic arc (also known as inverse
hyperbolic) functions:

- `asinh()`
- `acosh()`
- `atanh()`

Implement them by just exposing the C++ Math library, but clamping
its values to the closest real defined value.
For the cosine, clamp input values lower than 1 to 1.
In the case of the tangent, where the limit value is infinite,
clamp it to -inf or +inf.

References #78377
Fixes godotengine/godot-proposals#7110
2023-09-01 01:27:56 +02:00
Rémi Verschelde 8edc0b43b9
Merge pull request #78634 from Sauermann/fix-notification-order
Fix `Object::notification` order
2023-08-30 08:44:36 +02:00
Markus Sauermann c4705a590b Fix Object::notification order
Previously the `p_reversed` parameter didn't influence the order
in a correct way.
Also script overridden _notification functions were not called in
the correct order.

To fix this some `notification` functions had to add a `p_reversed`
parameter.

This made it necessary to adjust cpp-bindings.

Co-authored-by: David Snopek <dsnopek@gmail.com>
2023-08-30 00:15:55 +02:00
clayjohn 0045dc204c Revert "Implement loading DDS textures at run-time"
This reverts commit 34ab1c8a36.
2023-08-29 14:25:16 +02:00
kobewi 67db4693eb Expose _validate_property() for scripting 2023-08-28 15:18:48 +02:00
Rémi Verschelde c3fd8752d2
Merge pull request #80612 from akien-mga/scons-disable-exception-handling
SCons: Disable C++ exception handling
2023-08-16 16:56:07 +02:00
Rémi Verschelde 20e24bd2bb
Merge pull request #78529 from Chaosus/string_reverse
Add `String.reverse` method
2023-08-16 16:53:40 +02:00
Rémi Verschelde 3907e53ff6
SCons: Disable C++ exception handling
Upon investigating the extremely slow MSVC build times in #80513, I noticed
that while Godot policy is to never use exceptions, we weren't enforcing it
with compiler flags, and thus still included exception handling code and
stack unwinding.

This is wasteful on multiple aspects:

- Binary size: Around 20% binary size reduction with exceptions disabled
  for both MSVC and GCC binaries.
- Compile time:
  * More than 50% build time reduction with MSVC.
  * 10% to 25% build time reduction with GCC + LTO.
- Performance: Possibly, needs to be benchmarked.

Since users may want to re-enable exceptions in their own thirdparty code
or the libraries they compile with Godot, this behavior can be toggled with
the `disable_exceptions` SCons option, which defaults to true.
2023-08-16 10:23:34 +02:00
Rémi Verschelde b78d52b693
Merge pull request #75694 from YuriSizov/editor-hot-singleton-interfaces-in-your-area
Make `EditorInterface` accessible as a singleton
2023-08-10 14:53:35 +02:00
Yuri Sizov 951ea2415b Make EditorInterface accessible as a singleton
- EditorPlugin.get_editor_interface() is removed as redundant.
2023-08-09 16:01:31 +02:00
Rémi Verschelde 835957b1fc
Merge pull request #79980 from bruvzg/fix_test_str_errs
[String] Fix Unicode parsing error message encoding and related JSON tests.
2023-08-09 15:20:16 +02:00
Rémi Verschelde 169a28bd0f
Merge pull request #80362 from Calinou/string-use-unicode-compiletime
Use compile-time Unicode string conversion
2023-08-07 14:55:58 +02:00
Rémi Verschelde 432405a3e1
Merge pull request #79342 from RedworkDE/localize-win-path
Fix `ProjectSettings::localize_path` for Windows paths
2023-08-07 14:45:48 +02:00
Rémi Verschelde 66e40e402a
Merge pull request #79331 from azuloo/translation-server-test-suite
Add a test suite for TranslationServer
2023-08-07 14:45:24 +02:00
Hugo Locurcio e9f723006a
Use compile-time Unicode string conversion
Thanks to this syntax introduced in C++11, this reduces the amount of work
that needs to be performed at run-time while making the code more terse.
2023-08-07 10:38:16 +02:00
Marcin Nowak 34ab1c8a36 Implement loading DDS textures at run-time 2023-07-31 21:31:26 +02:00
bruvzg 84a6f0d232 [String] Fix Unicode parsing error message encoding and related JSON tests. 2023-07-28 12:27:01 +03:00
Pedro J. Estébanez f34d580861 Revert "Implement parallel foreach() for easier multithreading"
This reverts commit e28868e30c.
2023-07-27 13:41:27 +02:00
Yuri Sizov 53ba9ccb19 Merge pull request #72346 from myaaaaaaaaa/disconnect-order
Avoid sorting CallableCustomMethodPointers by their actual address values
2023-07-26 18:39:08 +02:00
RedworkDE aee1e50b48 Fix `ProjectSettings::localize_path` for Windows paths 2023-07-26 16:18:31 +02:00
Yuri Sizov b8a29f71e5 Merge pull request #79444 from Miguel0312/TestInputEvent
Add a test suite to InputEvent
2023-07-21 17:54:35 +02:00
Miguel Pereira c2ad5ca435 Added tests to InputEvent 2023-07-17 17:48:34 +02:00
Yuri Sizov 3d04a22d7c
Merge pull request #79103 from AThousandShips/array_slice_range
Fix range error for `Array.slice`
2023-07-17 16:48:48 +02:00
Maxim Kulkin 058604f5b8 Fix crash when saving resources with circular references
When saving resources, marking of already seen resources was
done too late, causing infinite loop traversing referenced resources
and eventual stack overflow. The change marks traversed resource
before descending to it's children, thus when this resource is
encountered again, it is already marked as seen and traversal stops.
2023-07-14 19:20:04 +02:00
Yuri Sizov 2a595c26d9 Merge pull request #72784 from myaaaaaaaaa/parallel-foreach
Implement parallel `foreach()` for easier multithreading
2023-07-14 18:48:49 +02:00
Yuri Sizov e88934cb74 Merge pull request #74238 from bitsawer/fix_image_convert
Fix `Image.convert()` overwriting custom mipmaps
2023-07-12 17:15:39 +02:00
Yuri Sizov f6d568b9e4 Merge pull request #66170 from RedMser/json-fix-invalid-escapes
Disallow invalid escape sequences in `JSON.parse`
2023-07-12 15:08:29 +02:00
azuloo dd0bd90865 Add a test suite for TranslationServer 2023-07-11 14:30:53 +03:00
MewPurPur cc5500f7de Fix erroneous pad_zeros warning 2023-07-08 16:16:01 +03:00
Ninni Pipping 7752a0d8d1 Fix range error for `Array.slice` 2023-07-07 23:19:42 +02:00
RedMser 427b293c7d Disallow invalid escape sequences in JSON.parse 2023-06-30 21:28:36 +02:00
Rémi Verschelde 100082b3ac
Merge pull request #74760 from lassade/unicode-err-uses-replacement-char
Don't append non unicode scalar values on the string, instead use the unicode replacement char
2023-06-22 18:30:04 +02:00
Yuri Roubinski 230385b587 Add `String.reverse` method 2023-06-21 20:40:48 +03:00
angel-721 ab4e89ecde
Add HTTPClient unit tests 2023-06-21 11:53:55 +02:00
myaaaaaaaaa 5cc961627d Avoid sorting CallableCustomMethodPointers by their actual address values 2023-06-20 08:40:01 -04:00
Rémi Verschelde 867ea7fe59
Merge pull request #74730 from MarioLiebisch/fix-74726
Fix read-only dictionaries adding missing keys
2023-06-19 21:38:38 +02:00
andybarcia 553f4f8dce
Improve error reporting when parsing CSV translation file
Fixes #46682.

Also fix unit test suite to separate generic FileAccess CSV testing
from using CSV as translation. And add more CSV translation tests.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2023-06-19 12:47:44 +02:00
Rémi Verschelde 1a62f1e4fc
Merge pull request #74741 from vnen/variant-not-for-everyone
Allow boolean operators for all Variant types
2023-06-18 16:28:10 +02:00
MewPurPur a8412c12da Standardize and Optimize blue robot SVG
Co-authored-by: Andre Vallestero <39736205+AndreVallestero@users.noreply.github.com>
2023-06-12 18:12:40 +02:00
myaaaaaaaaa e28868e30c Implement parallel foreach() for easier multithreading 2023-06-09 08:27:32 -04:00
Kory Postma c8cac39446 Grayscale fix for Image::premultiply_alpha() and Image::convert(FORMAT_L8) while using REC.709, with added test case 2023-05-27 18:01:44 -05:00
myaaaaaaaaa c996863464 Streamline WorkerThreadPool tests and make them more robust 2023-05-17 17:33:08 -04:00
Rémi Verschelde 863bcd3e2b
Merge pull request #76936 from clayjohn/revert-hsl
Revert "Add API for HSL conversion"
2023-05-12 10:03:21 +02:00
Rémi Verschelde fd4a06c515
Merge pull request #76906 from lawnjelly/safe_acos4_2
Make acos and asin safe
2023-05-11 13:33:37 +02:00
lawnjelly 50c5ed4876 Make acos and asin safe
A common bug with using acos and asin is that input outside -1 to 1 range will result in Nan output. This can occur due to floating point error in the input.

The standard solution is to provide safe_acos function with clamped input. For Godot it may make more sense to make the standard functions safe.
2023-05-11 08:34:34 +01:00
clayjohn f83a90192f Revert "Add API for HSL conversion"
This reverts commit 0b7fd664c1.
2023-05-10 17:45:56 -03:00
Rémi Verschelde 703a3ce7ad
Merge pull request #76830 from ajreckof/fix_wrapf_CI_with_too_big_float
fix a test for wrapf with signed 32-bit float
2023-05-10 10:20:03 +02:00