Commit Graph

6461 Commits

Author SHA1 Message Date
ajreckof 19632eaf50 Change precedence in rules to make location after proper casing. 2023-09-05 16:16:21 +02:00
bruvzg 2b3bbde6da
[String] Fix string conversion for -0.0 float values. 2023-09-05 11:32:55 +03:00
David Snopek 3e7a6e058a Allow implementing `ScriptInstance::validate_property()` from GDExtension 2023-09-04 13:55:48 -05:00
kobewi a490fad82d Prevent axis-based actions from getting stuck 2023-09-04 15:47:26 +02:00
Rémi Verschelde 75de1ca768
Merge pull request #81280 from ogapo/deterministic_pcks
Fix for non-deterministic behavior in PCKPacker
2023-09-04 09:09:23 +02:00
Rémi Verschelde dd4fae6162
Merge pull request #74809 from Chaosus/completion_color_xyzw
Add coloring for completion of vector components
2023-09-04 09:06:57 +02:00
Daylily-Zeleen 41ffe5461f Allow GDExtension to register unexposed class. 2023-09-04 10:18:20 +08:00
Fredia Huya-Kouadio 8cc7739197 Godot Android plugin re-architecture 2023-09-03 17:04:10 -07:00
David Nikdel 067807c1cb Remove nondeterminism in pck_packer
PCK files (like other build products) should be deterministic based on their inputs. Removed calls to Math::rand() that are being used to generate padding.

Looks like these were introduced as part of adding encryption support, but the padding being random does not have any cryptographic significance. This can be trivially inferred since file blocks that happen to be aligned don't get padding anyway.

If there's a desire to indroduce something that functions as a nonce it should probably be added explicitly and only if encryption is enabled.
remove Math::rand() calls in editor_export_platform.cpp

follow up to make consistent with pck_packer
2023-09-03 18:14:30 -04:00
Rémi Verschelde fa3428ff25
Merge pull request #81221 from dalexeev/editor-inspector-and-signal-dock-improvements
Editor: Inspector and Signal docks improvements
2023-09-03 00:21:04 +02:00
Jan Haller 4e202bcec7 GDExtension: fix `bool` unknown in C 2023-09-02 21:04:49 +02:00
Rémi Verschelde c326914c49
Merge pull request #81206 from dsnopek/script-instance-extension-memory-bug2
GDExtension: Allocate `GDExtensionScriptInstanceInfo2` for compatibility on the heap to prevent crash
2023-09-02 14:30:36 +02:00
Danil Alexeev c33ca26e17
Editor: Inspector and Signal docks improvements 2023-09-02 08:50:28 +03:00
Daylily-Zeleen 67e1401891 Set builtin varrarg ptrcalls, called without arg. 2023-09-02 00:34:16 +08:00
Rémi Verschelde bbdd1aaa38
Merge pull request #81131 from AThousandShips/callable_fix
Fix comparison of `Callable`s with binds
2023-09-01 16:02:35 +02: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
David Snopek 83faf84ec9 GDExtension: Allocate `GDExtensionScriptInstanceInfo2` for compatibility on the heap to prevent crash 2023-08-31 15:19:31 -05:00
Mai Lavelle e0ee985f64 Allow CallableCustom objects to be created from GDExtensions
Co-authored-by: David Snopek <dsnopek@gmail.com>
2023-08-31 12:36:25 -04:00
Yuri Rubinsky 35802374ac Add coloring for completion of vector components 2023-08-30 21:13:25 +03: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
Rémi Verschelde cfe9cd5cae
Merge pull request #81126 from clayjohn/revert-dds-runtime
Revert "Implement loading DDS textures at run-time"
2023-08-29 18:42:56 +02:00
Rémi Verschelde d7ceb7f1dc
Merge pull request #81129 from KoBeWi/debug_bug
Remove debug print
2023-08-29 17:30:32 +02:00
A Thousand Ships 2caf5ae453 Fix comparison of `Callable`s with binds 2023-08-29 16:10:14 +02:00
David Snopek 39a604c9ab Exclude unexposed classes from the extension_api.json 2023-08-29 08:45:58 -05:00
kobewi 5b95935e18 Remove debug print 2023-08-29 15:34:24 +02:00
Rémi Verschelde c8c2a7e083
Merge pull request #81123 from dalexeev/core-fix-recursion-check-for-wariant-writer-objects
Core: Fix recursion level check for `VariantWriter::write()` with objects
2023-08-29 15:07:12 +02:00
Rémi Verschelde 76bc5a6554
Merge pull request #80859 from KoBeWi/prepare_for_action_and_make_it_double
Fix action state when multiple events are assigned
2023-08-29 15:06:02 +02:00
Rémi Verschelde 8ebb34707a
Merge pull request #61818 from KoBeWi/secret_prefix_stash
Made hidden ProjectSettings groups more explicit
2023-08-29 15:05:38 +02:00
clayjohn 0045dc204c Revert "Implement loading DDS textures at run-time"
This reverts commit 34ab1c8a36.
2023-08-29 14:25:16 +02:00
Danil Alexeev 5d689ad560
Core: Fix recursion level check for `VariantWriter::write()` with objects 2023-08-29 15:05:53 +03:00
Rémi Verschelde 7e083e53c3
Merge pull request #81020 from AThousandShips/object_register_fix
Add check to ensure registered classes are declared
2023-08-29 12:45:33 +02:00
Rémi Verschelde 38a69c0719
Merge pull request #80394 from maiself/expose-placeholder-script-instance-to-gde
Expose PlaceHolderScriptInstance to GDExtension
2023-08-29 12:42:40 +02:00
Rémi Verschelde 76d318dbd1
Merge pull request #75778 from KoBeWi/_vp
Expose `_validate_property()` for scripting
2023-08-29 12:41:27 +02:00
Rémi Verschelde 91c5273ec5
Merge pull request #75656 from YuriSizov/core-iconic-builtins
Add a script method to get its class icon
2023-08-29 12:41:03 +02:00
Mai Lavelle 4b5da7e0ac Expose PlaceHolderScriptInstance to GDExtension
Co-authored-by: David Snopek <dsnopek@gmail.com>
2023-08-28 17:43:45 -04:00
kobewi 67db4693eb Expose _validate_property() for scripting 2023-08-28 15:18:48 +02:00
alcomposer deaf6c3bb1
Context aware MIDI event printing 2023-08-28 12:42:15 +02:00
A Thousand Ships c638238fae Add check to ensure registered classes are declared
Checks that all classes registered to `ClassDB` have been properly
declared with `GDCLASS`
2023-08-28 12:16:49 +02:00
AttackButton 8908ac4e6e Add missing YEN, SECTION and OPENURL names to keycode mappings 2023-08-28 03:37:22 -03:00
kobewi ad1abca668 Fix action state when multiple events are assigned 2023-08-25 23:10:27 +02:00
Yuri Sizov 4cdbbfd071 Differentiate between core and editor-only singletons
This makes sure that running scenes in debug mode
(from the editor) does not crash Godot.
In export mode it should already work correctly, because
editor-only singletons are never registered in the first place.
2023-08-24 16:46:54 +02:00
Yuri Sizov 2c77f07aaa Add a script method to get its class icon
Co-authored-by: Danil Alexeev <danil@alexeev.xyz>
2023-08-24 13:05:41 +02:00
kobewi 2cd63a1ef0 Made hidden ProjectSettings groups more explicit 2023-08-23 22:43:43 +02:00
Ricardo Buring acf9d4e4de Fix GDExtension classes derived from abstract GDExtension classes always being registered as abstract 2023-08-22 09:53:03 +02:00
Rémi Verschelde 970be7afdc
Merge pull request #80824 from MewPurPur/optimize-left-and-right
Optimize `String.left()` and `String.right()`
2023-08-21 08:26:15 +02:00
MewPurPur c9287e5224 Optimize String.left() and String.right() 2023-08-20 20:01:06 +03:00
Thaddeus Crews c82bdef2fc
Undefine typed array templates after use 2023-08-19 12:30:43 -05:00
Rémi Verschelde 5444afae63
Merge pull request #76572 from acazuc/ktx_format_support
Add support for KTX image format so that we can use Basis Universal for GLTF
2023-08-19 13:00:35 +02:00
acazuc a00cf02241 Add support for KTX & KTX2 image format
Add support glTF KHR_texture_basisu extension
2023-08-19 10:27:29 +02:00
Rémi Verschelde 1d70968e9a
Merge pull request #79370 from dalexeev/core-array-recursion-check
Core: Fix recursion level check for array stringification
2023-08-18 15:43:29 +02:00
Rémi Verschelde 5dc7e23198
Merge pull request #80720 from dsnopek/gdextension-dll-copy-error
GDExtension: Remove DLL copy if it fails to load
2023-08-18 00:41:11 +02:00
David Snopek 908b8c0507 GDExtension: Remove DLL copy if it fails to load 2023-08-17 13:23:31 -05:00
Rémi Verschelde e73a4a382e
Merge pull request #79201 from Rindbee/fix-setup-state-not-cleared
Clear the previously set state when configuring for a new scene root node
2023-08-17 15:43:38 +02:00
Hugo Locurcio 6f1152bdbe
Add a `--audio-output-latency` command-line argument
This allows optimizing the audio output latency on higher-end CPUs,
especially in projects that do not expose a way to override this setting.
2023-08-17 14:45:17 +02:00
Rémi Verschelde 1e3b1a7137
Merge pull request #80188 from vnen/gdextension-copy-dll
GDExtension: Copy DLL to a temp file before opening
2023-08-16 16:55:19 +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 4ed3f67229
Merge pull request #80591 from AThousandShips/compat_ver
Fix version check for GDExtension
2023-08-16 09:14:16 +02:00
Rémi Verschelde 20127ab693
Merge pull request #78871 from jitspoe/master.pr_compute_convex_mesh_points
Expose `compute_convex_mesh_points` function to GDScript
2023-08-16 09:11:53 +02:00
Rémi Verschelde b44867b947
Merge pull request #77975 from sakrel/shader_debug_info
Add support for GLSL source-level debugging with RenderDoc
2023-08-16 09:11:23 +02:00
Ninni Pipping 97ef4a0536 Fix version check for GDExtension 2023-08-15 10:10:04 +02:00
jitspoe 541b021ab6 Expose compute_convex_mesh_points function to GDScript. 2023-08-14 22:37:21 -04:00
Rémi Verschelde efdff9cbc2
Fix GCC -Wmaybe-uninitialized warnings 2023-08-14 14:35:35 +02:00
sakrel 80a36ff985 Add support for GLSL source-level debugging with RenderDoc (`--generate-spirv-debug-info`) 2023-08-12 14:56:49 +02:00
George Marques cff69b0612
GDExtension: Copy DLL to a temp file before opening
This is done only in the editor and only on Windows, to avoid a file
lock that prevents the original library being updated (e.g. by a
compiler).

When the game runs it will load the original DLL and pick up any
changes, only the editor will stay with the copy (until it is restarted
and create a new copy).

The copy is done in place by prepending a `~` to the original file name,
so dependencies that are loaded with a relative file path still work.
When the library is unloaded the copy file is deleted. The copy is also
marked as hidden to not show up in explorer.
2023-08-11 10:44:23 -03:00
Rémi Verschelde 33198d0df0
Merge pull request #75784 from Riteo/int-scale
Add content scale stretch modes, implement integer scaling
2023-08-11 10:32:11 +02:00
Riteo 87cfc415a3 Add content scale stretch modes, implement integer scaling
Integer scaling is achieved (after aspect expansion) by "lying" to the
stretching code about the window's size, telling it that it's always an
integer multiple of the viewport so that it only gets stretched to an
integer factor.

This approach works with all stretch and aspect modes and doesn't
require handling for each, only requiring to "loosen up" some
self-excluding conditions (in other words, replacing some `else if`s
with just `if`s) regarding viewport offset and margin calculation (black
bars).

Includes a tiny usability change that adds a range hint for the content
scale factor between 0.5 to 8.0.

Co-Authored-By: Hugo Locurcio <hugo.locurcio@hugo.pro>
2023-08-10 19:45:47 +02:00
Rémi Verschelde 11cfb23798
Merge pull request #62038 from KoBeWi/ChangedSettings
Add `settings_changed` signal to ProjectSettings
2023-08-10 14:53:07 +02:00
Rémi Verschelde 5cfa9a0d7b
Merge pull request #80432 from rsubtil/fix_linux_joypad_on_thread
Ensure `joy_connection_changed` is emitted on the main thread
2023-08-09 17:46:37 +02:00
Ricardo Subtil 1bb73b0689
Ensure `joy_connection_changed` is emitted on the main thread 2023-08-09 15:32:06 +01:00
Rémi Verschelde d255811443
Merge pull request #80404 from bruvzg/file_attribs
[FileAccess] Add methods to get/set "hidden" and "read-only" attributes on macOS/BSD and Windows.
2023-08-09 15:20:32 +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
kobewi c5ec847aa0 Add settings_changed signal to ProjectSettings 2023-08-08 23:57:31 +02:00
bruvzg 8aa6f29b56
[FileAccess] Add methods to get/set "hidden" and "read-only" attributes on macOS/BSD and Windows. 2023-08-08 21:51:32 +03:00
Rindbee 4795c3cdfa Clear the previously set state when configuring for a new scene root node
Saving a subscene causes the main scene to be re-instantiated. And the resource
instance in the main scene will be reused when the main scene is re-instantiated.
So for resources with `resource_local_to_scene` enabled, resetting state may be
necessary (at least for `ViewportTexture`).
2023-08-08 23:49:53 +08:00
Jeff Ward efc8fd6e2c Add get_script_instance to GDExtension
Adds a method to GDExtension to get the ScriptInstanceExtension for an object.
2023-08-07 23:09:24 -04:00
Jan Haller 38334fdc11 PtrToArg::convert() returns const-references where possible, avoids unnecessary copies 2023-08-07 20:40:23 +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 faaf27f284
Fix various typos with codespell
Also includes typo fixes from #79993, #80068, #80276, and #80303.

Co-authored-by: betalars <contact@betalars.de>
Co-authored-by: spaceyjase <429978+spaceyjase@users.noreply.github.com>
Co-authored-by: Swarkin <102416174+Swarkin@users.noreply.github.com>
Co-authored-by: Raul Santos <raulsntos@gmail.com>
2023-08-07 13:09:47 +02:00
Yuri Sizov dc6ea03101
Merge pull request #35555 from Calinou/add-version-project-setting
Add a "version" project setting and use it in new export presets
2023-08-04 21:01:15 +02:00
Rémi Verschelde b8fa19cc19
Merge pull request #79495 from Chaosus/astargrid_all_solid
Add a `fill_region` method to the `AStarGrid2D`
2023-08-04 16:59:11 +02:00
Hugo Locurcio ad4480bf2e
Add a "version" project setting and use it in new export presets
This makes it easy to retrieve the project version at runtime
for display purposes, while simplifying the export preset configuration.
You can now leave the version empty unless you need to override it on a per-preset
basis.

Since export presets save the values of default values to the `export_presets.cfg`
file, this change only affects export presets created after this commit was merged.
2023-08-04 10:29:33 +02:00
Yuri Sizov 1610fc2ae7 Merge pull request #78539 from EIREXE/input-info
Add the ability to get per-platform information for joypads
2023-08-03 22:37:45 +02:00
Yuri Sizov a56e960150 Merge pull request #71233 from PrecisionRender/barycentric-coords
Add ability to get face index and barycentric coordinates from raycast
2023-08-03 22:37:30 +02:00
Rémi Verschelde 4ed08409b0
Merge pull request #78108 from aaronfranke/variant-util-header
Make a header for VariantUtilityFunctions
2023-08-03 14:46:29 +02:00
Álex Román Núñez 3aa340d081 Add the ability to get per-platform information for joypads.
This adds the ability for games to obtain platform-specific information about joypads such as their vendor/product ID, their XInput gamepad index or the real name of the device before it gets swapped out by the gamecontrollerdb's name.

This PR also includes a rebased version of #76045, this is because this PR is intended to be mainly to help people implementing Steam Input, as having the gamepad index is essential.
2023-08-02 22:30:30 +02:00
PrecisionRender af7f787c6e Add ability to get barycentric coordinates from ray 2023-08-02 15:16:44 -05:00
Yuri Sizov f415200323 Merge pull request #80156 from lawnjelly/dev_assert_note
Usage notes for DEV_ASSERT macro
2023-08-02 21:37:09 +02:00
lawnjelly 85c3017052 Usage notes for DEV_ASSERT macro
Make it more clear that DEV_ASSERT is only to be used in specific cases.
2023-08-02 13:29:35 +01:00
Rémi Verschelde e48b999f26
Merge pull request #80114 from Deledrius/modulo_typo
Fix typo in modulo error message.
2023-08-02 12:22:01 +02:00
Yuri Sizov 8654ba130b Merge pull request #79654 from timothyqiu/han
Fix script name of Hant and Hans
2023-08-01 17:25:21 +02:00
Joseph Davies 510de82f43
Fix typo in modulo error message. 2023-08-01 04:47:18 -07:00
Marcin Nowak 34ab1c8a36 Implement loading DDS textures at run-time 2023-07-31 21:31:26 +02:00
Yuri Sizov 0be587521e Merge pull request #79737 from Calinou/resourceloader-load-error-clarify-expected-type
Mention expected resource type in ResourceLoader load error
2023-07-31 21:01:28 +02:00
Yuri Sizov 41efc7cb86 Merge pull request #78941 from dalexeev/gds-doc-comments-deprecated-and-experimental
GDScript: Add `@deprecated` and `@experimental` doc comment tags
2023-07-31 21:01:08 +02:00
clayjohn fcc6c6a697 Revert "Let user know about dead instances in deferred calls"
This reverts commit 3a6527d6d3.
2023-07-31 10:45:20 +02:00
bruvzg 84a6f0d232 [String] Fix Unicode parsing error message encoding and related JSON tests. 2023-07-28 12:27:01 +03:00
Yuri Sizov 4e22ce827a Merge pull request #79953 from RandomShaper/revert_wtp_for_range
Revert "Implement parallel foreach() for easier multithreading"
2023-07-27 15:23:01 +02:00
Yuri Sizov 6bfda7f5c5 Merge pull request #79156 from dsnopek/gdextension-string-resize
Allow resizing Strings from GDExtension
2023-07-27 15:22:32 +02: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