Commit graph

6477 commits

Author SHA1 Message Date
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
David Snopek
e87900970c Allow resizing String's from GDExtension 2023-07-26 21:31:37 -05:00
Yuri Sizov
951691a9a9 Merge pull request #79763 from mihe/indexed-properties
Add support for indexed properties in GDExtension
2023-07-26 18:40:22 +02:00
Yuri Sizov
a68137bf18 Merge pull request #79683 from Zylann/fix_gdext_get_property_list
GDExtension: Fix `_get_property_list` not working correctly in parent classes
2023-07-26 18:40:18 +02:00
Yuri Sizov
2c8cbcd1a0 Merge pull request #78987 from RandomShaper/err_bad_deferred_target
Let user know about dead instances in deferred calls
2023-07-26 18:39:38 +02:00
Yuri Sizov
7c204874eb Merge pull request #78747 from RandomShaper/fix_trans_threading
Support loading of translations on threads
2023-07-26 18:39:27 +02:00
Yuri Sizov
92960b7a22 Merge pull request #78615 from RandomShaper/fix_doc_cache
Re-enable docs cache with fixes
2023-07-26 18:39:22 +02:00
Yuri Sizov
c4e582262f Merge pull request #76582 from reduz/threaded-debugger
Support threads in the script debugger
2023-07-26 18:39:16 +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
Juan Linietsky
5e512b705e Support threads in the script debugger
* This implementation adds threads on the side of the client (script debugger).
* Some functions of the debugger are optimized.
* The profile is also now thread safe using atomics.
* The editor can switch between multiple threads when debugging.

This PR adds threaded support for the script language debugger. Every thread has its own thread local data and it will connect to the debugger using multiple thread IDs.
This means that, now, the editor can receive multiple threads entering debug mode at the same time.
2023-07-26 12:06:45 +02:00
Yuri Sizov
74d20fe17e Merge pull request #75216 from rune-scape/rune-dependancy-errors
Script editor (GDScript): Show depended script errors
2023-07-24 19:32:20 +02:00
rune-scape
83b01708b2 Script editor: Show depended script errors 2023-07-24 15:49:39 +02:00
Ithamar R. Adema
f37c2b5be2 Fix ImageTextureLayered serialisation issues. 2023-07-23 13:54:04 +02:00
Mikael Hermansson
2173821b38 Add support for indexed properties in GDExtension 2023-07-21 22:59:24 +02:00
Yuri Sizov
01e08677ff Merge pull request #79466 from Repiteo/core_bind-header-fix
Have `core_bind.h` Thread type syntax match `core_bind.cpp`
2023-07-21 17:15:29 +02:00
Yuri Sizov
4d42d6fdf6 Merge pull request #78706 from RedworkDE/node-rename-inplace
Allow renaming child nodes in `_ready`
2023-07-21 17:15:26 +02:00
Hugo Locurcio
5bf64255b0
Mention expected resource type in ResourceLoader load error
This helps troubleshoot issues due to incorrect import types.
2023-07-21 04:45:34 +02:00
Gilles Roudière
b4d86cb42a Add _get_bind_compatibility_methods to Object
Co-authored-by: RedworkDE <10944644+RedworkDE@users.noreply.github.com>
2023-07-20 12:55:00 +02:00
Haoyu Qiu
52cdba6def Fix script name of Hant and Hans 2023-07-20 15:01:39 +08:00
Marc Gilleron
e8731f4821 GDExtension: fix _get_property_list not working correctly in parent classes 2023-07-20 02:24:04 +01:00
Ninni Pipping
1cac72999b Fix root_node_layout_direction setting not enum 2023-07-18 14:33:13 +02:00
kobewi
de4a3fa151 Unify and streamline connecting to Resource changes 2023-07-17 19:35:57 +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
Yuri Roubinski
5f56aa88f8 Add the fill region methods to the AStarGrid2D 2023-07-15 16:52:29 +03: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
f0c24f3145 Merge pull request #79017 from bruvzg/esc_fix
[Terminal Output] Reset text properties after `print_rich`.
2023-07-14 18:49:26 +02:00
Yuri Sizov
acd34153ba Merge pull request #78612 from RandomShaper/mq_flush_ref
Refactor CallQueue flushing for clarity
2023-07-14 18:49:08 +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
Thaddeus Crews
1651c5d2ad
Have core_bind.h thread type syntax match .cpp
• Functionally identical to prior implementation, but removes misattributed errors in VSCode intellisense
2023-07-14 10:12:39 -05:00
bruvzg
4790da7900
[macOS] Implement optional native file selection dialog support for sandboxed apps. 2023-07-12 22:36:24 +03:00
Yuri Sizov
a55e714b56 Merge pull request #79273 from bruvzg/ft2131
FreeType: Update to version 2.13.1
2023-07-12 21:03:07 +02:00
Yuri Sizov
f53329d045 Merge pull request #78890 from KoBeWi/who_needs_restart_anyway
Allow change import type without restarting editor
2023-07-12 17:16:53 +02:00
Yuri Sizov
55b74c7cdf Merge pull request #76045 from Eoin-ONeill-Yokai/steaminput-fix
Prevent double input events on gamepad when running through steam input
2023-07-12 17:16:36 +02:00
Yuri Sizov
95da8e1394 Merge pull request #70771 from kleonc/main-loop-set-after-resolved
Ensure `MainLoop` and its custom script is set right after it's resolved
2023-07-12 17:15:59 +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
f25233cbc9 Merge pull request #49524 from Calinou/document-editor-import-options
Document editor import options in the class reference
2023-07-12 17:15:19 +02:00
Yuri Sizov
6960a1d0e8 Merge pull request #78248 from felaugmar/load-svg-adjustable-scale
Added `Image::load_svg_from_(buffer|string)`
2023-07-12 15:09:03 +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
Danil Alexeev
bb40bd9aaa
Core: Fix recursion level check for array stringification 2023-07-12 14:59:44 +03:00
Eoin O'Neill
8de98dbf21 Prevent double input events on gamepad when running through steam input
During GDC and general testing on Steam Deck units, we found that single
gamepads would often register inputs twice under certain circumstances.
This was caused by SteamInput creating a new virtual device, which Godot
registers as a second gamepad. This resulted in two gamepad devices
reporting the same button presses, often leading to buggy input response
on games with no multi-device logic and other-wise could cause intended
Steam rebindings to not work as intended (for example, swapping o and x
on a playstation pad if that feature isn't supported by the game.)

SDL gets around this by taking in a list of devices that are to be
ignored. When valve sees a controller that wants to be rebound via
SteamInput, they push a new VID/PID entry onto the environment
variable `SDL_GAMECONTROLLER_IGNORE_DEVICES` for the original gamepad
so that all game inputs can be read from the virtual gamepad instead.

This leverages the same logic as we are already using SDL gamepad
related HID mappings.
2023-07-10 15:26:33 -07:00
bruvzg
008d3de1e9
FreeType: Update to version 2.13.1 2023-07-10 12:04:02 +03:00
Rémi Verschelde
83cc5d4914
Merge pull request #79202 from MewPurPur/fix-pad-zeros-error
Fix erroneous `pad_zeros()` warning
2023-07-08 18:23:53 +02:00
Rémi Verschelde
73ca58b45f
Merge pull request #78701 from Calinou/joy-button-name-tweak-xbox-menu
Mention Xbox menu button by name in Start button description
2023-07-08 18:17:21 +02:00
Rémi Verschelde
0c1442f82a
Merge pull request #78551 from AThousandShips/call_rpc
Fix `rpc` calls with binds
2023-07-08 18:15:41 +02:00
Rémi Verschelde
91f029e912
Merge pull request #74012 from myaaaaaaaaa/remove-tap
Remove unused `threaded_array_processor.h`
2023-07-08 18:15:15 +02:00
Danil Alexeev
c1b450566a
GDScript: Add @deprecated and @experimental doc comment tags 2023-07-08 18:13:19 +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
Angad Kambli
9c6c2f09e0
Check parameter validity in Object::set_script
Fixes #46120.
2023-07-07 16:13:33 +02:00
Rémi Verschelde
f1e63b808a
Merge pull request #79101 from akien-mga/linux-unbundle-brotli
Linux: Allow unbundling brotli to use system library
2023-07-07 08:35:44 +02:00
Rémi Verschelde
8a84a3914e
Merge pull request #79087 from Daylily-Zeleen/daylily-zeleen/fix_shell_show_in_file_manager
Fix the fallback logic of `OS::shell_show_in_file_manager`.
2023-07-07 08:34:31 +02:00
Rémi Verschelde
5ee36d119f
Merge pull request #78935 from timothyqiu/zip-pack
Fix error when non-ASCII characters in resource pack path
2023-07-07 08:30:56 +02:00
Rémi Verschelde
862a2841c0
Merge pull request #78845 from RandomShaper/fix_wtp_zero_batch_lazy
Fix zero-sized WorkerThreadPool not processing group tasks
2023-07-07 08:27:43 +02:00
Rémi Verschelde
153c4a4c4f
Linux: Allow unbundling brotli to use system library 2023-07-06 15:26:38 +02:00
Daylily-Zeleen
9dd9818c88 Fixed the fallback logic of OS::shell_show_in_file_manager 2023-07-06 13:16:04 +08:00
Pedro J. Estébanez
cac4d44cde Re-enable docs cache with fixes 2023-07-05 10:44:58 +02:00
bruvzg
0e8cb304a5 [Terminal Output] Reset text properties after print_rich. 2023-07-04 14:09:28 +03:00
Rémi Verschelde
cdd2313ba2
Merge pull request #78977 from RandomShaper/workaround_tls_shutdown
Workaround resource loading crashes due to buggy TLS
2023-07-03 19:43:07 +02:00
Pedro J. Estébanez
3a6527d6d3 Let user know about dead instances in deferred calls 2023-07-03 17:57:49 +02:00
Rémi Verschelde
03f0e5eb15
Merge pull request #78974 from RandomShaper/fix_wtp_safe_flag
Fix management of safe-for-nodes flag in ResourceLoader and WorkerThreadPool
2023-07-03 15:26:28 +02:00
Pedro J. Estébanez
41c0785636 Workaround resource loading crashes due to buggy TLS 2023-07-03 13:54:55 +02:00
kobewi
244968c8d1 Allow change import type without restarting editor 2023-07-03 13:24:24 +02:00
Pedro J. Estébanez
30925fcfb0 Fix management of safe-for-nodes flag in ResourceLoader and WorkerThreadPool 2023-07-03 12:27:57 +02:00
Gabor Koncz
a2ede8c4da Fix GDVIRTUAL_NATIVE_PTR
This commit fixes the usage of GDExtensionPtr and GDExtensionConstPtr
in GDExtension by introducing the required VariantInternalAccessor
specializations.

Sponsored by Migeran (https://migeran.com)
2023-07-03 10:52:02 +02:00
Haoyu Qiu
df5c68af99 Fix error when non-ASCII characters in resource pack path 2023-07-02 16:09:57 +08:00
RedMser
427b293c7d Disallow invalid escape sequences in JSON.parse 2023-06-30 21:28:36 +02:00
Pedro J. Estébanez
28d0d56a69 Fix zero-sized WorkerThreadPool not processing group tasks 2023-06-29 19:44:42 +02:00
Pedro J. Estébanez
5301bbb3a5 Support loading of translations on threads 2023-06-29 16:48:55 +02:00
Valery Zhuk
818cee6184 add explicit default initialization for flag in undo redo operation 2023-06-28 21:57:47 +03:00
RedworkDE
2c0caa5828 Allow renaming child nodes in _ready 2023-06-26 13:25:48 +02:00
Hugo Locurcio
1621b4e2b1
Mention Xbox menu button by name in Start button description
Microsoft officially calls it the Menu button:

https://support.xbox.com/en-US/help/hardware-network/controller/get-to-know-your-xbox-series-x-s-controller
2023-06-26 09:41:54 +02:00
Pedro J. Estébanez
c85beb8106 Refactor CallQueue flushing for clarity 2023-06-23 13:27:34 +02:00
Felipe Augusto Marques
26eb3db234 Added Image's load_svg_from_(buffer|string)
No core dependency to the svg module.
2023-06-23 00:43:43 -03:00
Rémi Verschelde
de3d4e3cec
Merge pull request #78517 from AThousandShips/callable_serialize
Ensure `RID`, `Callable`, and `Signal` are stored as strings
2023-06-22 18:30:51 +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
Ninni Pipping
9159208ed1 Ensure RID, Callable, and Signal are stored as strings
Prevents parser errors in `.tscn` and `.tres` files where the assignment
would otherwise be empty.
2023-06-22 17:01:08 +02:00
Yuri Sizov
b0299c9ad1
Merge pull request #76586 from rcorre/register-language-race
Fix a race condition in ScriptServer
2023-06-22 12:44:25 +02:00
Ninni Pipping
7d174c8dfe Fix rpc calls with binds 2023-06-22 11:07:53 +02:00
Yuri Roubinski
230385b587 Add String.reverse method 2023-06-21 20:40:48 +03:00
Ryan Roden-Corrent
731a13a1ba
Fix race in ScriptServer.
Fixes #76581.

TSAN flagged this issue on starting the editor:

1. main calls register_core_types, which calls IP::create(), which calls Thread::start on the resolver thread
2. Thread::callback calls ScriptServer::thread_enter(), as "Scripts may need to attach a stack."
3. ScriptServer::thread_enter() accesses ScriptServer::_languages, which is still being initialized on the main thread by initialize_gdscript_module

This fixes the issue by skipping thread enter/exit notifications if languages have not finished initializing yet.
I'm assuming that notifying un-initialized languages of thread starts/stops would have been pointless anyways. If we need to somehow notify languages of threads before the languages initialize, we'll need a different solution.

```
Godot Engine v4.0.2.stable.custom_build.7a0977ce2 - https://godotengine.org
==================
WARNING: ThreadSanitizer: data race (pid=9426)
  Write of size 4 at 0x55615b187cd0 by main thread:
    #0 ScriptServer::register_language(ScriptLanguage*) /home/rcorre/src/godot/godot/core/object/script_language.cpp:177:28 (godot.linuxbsd.editor.x86_64.llvm.san+0x9e52ab9) (BuildId: 780a9db7c37d88e78d5ee659c4fa1cd378abd048)
    #1 initialize_gdscript_module(ModuleInitializationLevel) /home/rcorre/src/godot/godot/modules/gdscript/register_types.cpp:118:3 (godot.linuxbsd.editor.x86_64.llvm.san+0x36f9c6f) (BuildId: 780a9db7c37d88e78d5ee659c4fa1cd378abd048)
    #2 initialize_modules(ModuleInitializationLevel) /home/rcorre/src/godot/godot/modules/register_module_types.gen.cpp:93:2 (godot.linuxbsd.editor.x86_64.llvm.san+0x2f50499) (BuildId: 780a9db7c37d88e78d5ee659c4fa1cd378abd048)
    #3 Main::setup2(unsigned long) /home/rcorre/src/godot/godot/main/main.cpp:1961:2 (godot.linuxbsd.editor.x86_64.llvm.san+0x2f1d40d) (BuildId: 780a9db7c37d88e78d5ee659c4fa1cd378abd048)
    #4 Main::setup(char const*, int, char**, bool) /home/rcorre/src/godot/godot/main/main.cpp:1879:10 (godot.linuxbsd.editor.x86_64.llvm.san+0x2f16370) (BuildId: 780a9db7c37d88e78d5ee659c4fa1cd378abd048)
    #5 main /home/rcorre/src/godot/godot/platform/linuxbsd/godot_linuxbsd.cpp:61:14 (godot.linuxbsd.editor.x86_64.llvm.san+0x2e67e1f) (BuildId: 780a9db7c37d88e78d5ee659c4fa1cd378abd048)

  Previous read of size 4 at 0x55615b187cd0 by thread T1:
    #0 ScriptServer::thread_enter() /home/rcorre/src/godot/godot/core/object/script_language.cpp:244:22 (godot.linuxbsd.editor.x86_64.llvm.san+0x9e54aed) (BuildId: 780a9db7c37d88e78d5ee659c4fa1cd378abd048)
    #1 Thread::callback(unsigned long, Thread::Settings const&, void (*)(void*), void*) /home/rcorre/src/godot/godot/core/os/thread.cpp:61:2 (godot.linuxbsd.editor.x86_64.llvm.san+0x9464ab0) (BuildId: 780a9db7c37d88e78d5ee659c4fa1cd378abd048)
    #2 void std::__invoke_impl<void, void (*)(unsigned long, Thread::Settings const&, void (*)(void*), void*), unsigned long, Thread::Settings, void (*)(void*), void*>(std::__invoke_other, void (*&&)(unsigned long, Thread::Settings const&, void (*)(void*), void*), unsigned long&&, Thread::Settings&&, void (*&&)(void*), void*&&) /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/invoke.h:61:14 (godot.linuxbsd.editor.x86_64.llvm.san+0x9465283) (BuildId: 780a9db7c37d88e78d5ee659c4fa1cd378abd048)
    #3 std::__invoke_result<void (*)(unsigned long, Thread::Settings const&, void (*)(void*), void*), unsigned long, Thread::Settings, void (*)(void*), void*>::type std::__invoke<void (*)(unsigned long, Thread::Settings const&, void (*)(void*), void*), unsigned long, Thread::Settings, void (*)(void*), void*>(void (*&&)(unsigned long, Thread::Settings const&, void (*)(void*), void*), unsigned long&&, Thread::Settings&&, void (*&&)(void*), void*&&) /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/invoke.h:96:14 (godot.linuxbsd.editor.x86_64.llvm.san+0x9465283)
    #4 void std:🧵:_Invoker<std::tuple<void (*)(unsigned long, Thread::Settings const&, void (*)(void*), void*), unsigned long, Thread::Settings, void (*)(void*), void*>>::_M_invoke<0ul, 1ul, 2ul, 3ul, 4ul>(std::_Index_tuple<0ul, 1ul, 2ul, 3ul, 4ul>) /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/std_thread.h:258:13 (godot.linuxbsd.editor.x86_64.llvm.san+0x9465283)
    #5 std:🧵:_Invoker<std::tuple<void (*)(unsigned long, Thread::Settings const&, void (*)(void*), void*), unsigned long, Thread::Settings, void (*)(void*), void*>>::operator()() /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/std_thread.h:265:11 (godot.linuxbsd.editor.x86_64.llvm.san+0x9465283)
    #6 std:🧵:_State_impl<std:🧵:_Invoker<std::tuple<void (*)(unsigned long, Thread::Settings const&, void (*)(void*), void*), unsigned long, Thread::Settings, void (*)(void*), void*>>>::_M_run() /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/std_thread.h:210:13 (godot.linuxbsd.editor.x86_64.llvm.san+0x9465283)
    #7 execute_native_thread_routine /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/thread.cc:82:18 (libstdc++.so.6+0xd72c2) (BuildId: 6fe66a2d539a78c993bd2d377e00fad389220963)

  Location is global 'ScriptServer::_language_count' of size 4 at 0x55615b187cd0 (godot.linuxbsd.editor.x86_64.llvm.san+0xbf46cd0)

  Thread T1 (tid=9431, running) created by main thread at:
    #0 pthread_create <null> (godot.linuxbsd.editor.x86_64.llvm.san+0x2de5776) (BuildId: 780a9db7c37d88e78d5ee659c4fa1cd378abd048)
    #1 __gthread_create /usr/src/debug/gcc/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu/bits/gthr-default.h:663:35 (libstdc++.so.6+0xd73a9) (BuildId: 6fe66a2d539a78c993bd2d377e00fad389220963)
    #2 std:🧵:_M_start_thread(std::unique_ptr<std:🧵:_State, std::default_delete<std:🧵:_State>>, void (*)()) /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/thread.cc:147:37 (libstdc++.so.6+0xd73a9)
    #3 IP::IP() /home/rcorre/src/godot/godot/core/io/ip.cpp:347:19 (godot.linuxbsd.editor.x86_64.llvm.san+0x962cbcd) (BuildId: 780a9db7c37d88e78d5ee659c4fa1cd378abd048)
    #4 IPUnix::IPUnix() /home/rcorre/src/godot/godot/drivers/unix/ip_unix.cpp:261:9 (godot.linuxbsd.editor.x86_64.llvm.san+0x4aee599) (BuildId: 780a9db7c37d88e78d5ee659c4fa1cd378abd048)
    #5 IPUnix::_create_unix() /home/rcorre/src/godot/godot/drivers/unix/ip_unix.cpp:258:9 (godot.linuxbsd.editor.x86_64.llvm.san+0x4aee599)
    #6 IP::create() /home/rcorre/src/godot/godot/core/io/ip.cpp:339:9 (godot.linuxbsd.editor.x86_64.llvm.san+0x962ca5e) (BuildId: 780a9db7c37d88e78d5ee659c4fa1cd378abd048)
    #7 register_core_types() /home/rcorre/src/godot/godot/core/register_core_types.cpp:279:7 (godot.linuxbsd.editor.x86_64.llvm.san+0x93e2333) (BuildId: 780a9db7c37d88e78d5ee659c4fa1cd378abd048)
    #8 Main::setup(char const*, int, char**, bool) /home/rcorre/src/godot/godot/main/main.cpp:690:2 (godot.linuxbsd.editor.x86_64.llvm.san+0x2f08a49) (BuildId: 780a9db7c37d88e78d5ee659c4fa1cd378abd048)
    #9 main /home/rcorre/src/godot/godot/platform/linuxbsd/godot_linuxbsd.cpp:61:14 (godot.linuxbsd.editor.x86_64.llvm.san+0x2e67e1f) (BuildId: 780a9db7c37d88e78d5ee659c4fa1cd378abd048)

SUMMARY: ThreadSanitizer: data race /home/rcorre/src/godot/godot/core/object/script_language.cpp:177:28 in ScriptServer::register_language(ScriptLanguage*)
```

Co-authored-by: Pedro J. Estébanez <RandomShaper@users.noreply.github.com>
2023-06-21 09:52:10 -04:00
Jan Haller
9ddd3c2af6 GDExtension @since attribute
All GDExtension function pointer types are versioned using a `@since` attribute, denoting the Godot minor version in
which they were introduced. This allows bindings to query if a feature is available for a target API version, or provide
a polyfill/fallback for it. It also serves as documentation for humans giving a feeling about recency of features.
2023-06-21 12:47:48 +02:00
Yuri Sizov
329652b6fe
Merge pull request #78392 from Gallilus/master
Fix `Ref<>.is_valid()` for ScriptInstanceExtension
2023-06-20 21:19:20 +02:00
David Cambré
ceed30c442 Fix Ref<>.is_valid() for ScriptInstanceExtension
Only check the reference not the value.
2023-06-20 19:45:47 +02:00
Rémi Verschelde
248e5245e4
Merge pull request #73540 from mashumafi/fix-typed-array-add
Fix: Typed arrays aren't working with +
2023-06-20 15:12:39 +02:00