Commit graph

6252 commits

Author SHA1 Message Date
kobewi
313c0c7f5d Fix missing UID handling for binary formats 2023-06-16 13:40:10 +02:00
Rémi Verschelde
d101244d1b
Merge pull request #74641 from dalexeev/fix-bitfield-enum-warnings
Display `BitField[Enum]` in docs to distinguish from `Enum`
2023-06-16 10:18:46 +02:00
Rémi Verschelde
6fb391bc23
Fix various typos with codespell
And ignore some false positives introduced by recent versions of codespell.
2023-06-16 08:45:35 +02:00
Danil Alexeev
eb391d3302
Display BitField[Enum] in docs to distinguish from Enum 2023-06-15 17:23:02 +03:00
Rémi Verschelde
8c5c29f2a3
Merge pull request #78061 from dsnopek/gdextension-class-not-exposed
Fix wrapping Object's in GDExtension that aren't exposed
2023-06-15 10:50:27 +02:00
Rémi Verschelde
0b30785bca
Merge pull request #75438 from ronyeh/typo
Fix typo on "autoremapping".
2023-06-15 10:39:44 +02:00
RedworkDE
92f13ba9ea C#: Unify project name handling and fix issues with the handling of some special characters
Co-authored-by: Raul Santos <raulsntos@gmail.com>
2023-06-14 21:07:58 +02:00
kleonc
77b8e0fcb7 Allow setting negative WorldBoundaryShape2D.distance through the editor 2023-06-14 14:54:00 +02:00
ajreckof
81aa5ad999 add backward_undo_ops as property for action 2023-06-13 15:32:05 +02:00
Rémi Verschelde
e95decf343
Merge pull request #78111 from sbarkeha/master
Fix infinite loop on EOF in the command line debugger
2023-06-12 14:15:54 +02:00
Rémi Verschelde
35ff936b93
Merge pull request #77055 from lawnjelly/input_just_pressed_4
Input - fix just pressed and released with short presses
2023-06-12 14:13:52 +02:00
lawnjelly
a3ef092f18 Input - fix just pressed and released with short presses
Previously if an action was both pressed and released on the same tick or frame, `is_action_just_pressed()` would return false, resulting in missed input.

This PR separately the timestamp for pressing and releasing so each can be tested independently.
2023-06-12 11:14:58 +01:00
Rémi Verschelde
91e2859cd3
Merge pull request #77748 from DevanOBoyle/fix/ignore_false_button_error
Skip error messages for buttons that don't exist
2023-06-12 11:38:43 +02:00
Devan OBoyle
ed02d515e0 Skip error messages for buttons that don't exist 2023-06-11 21:25:29 -07:00
Aaron Franke
5654d40367
Don't use a const reference for the enum constructor in Variant 2023-06-11 15:13:05 -05:00
Simon Barkehanai
4ecad8dea3 Fix infinite loop on EOF in the command line debugger
When using the command line debugger (godot -d) on Unix systems, when
entering an EOF (ctrl+D), the debugger enters an infinite loop.

Adding a check for EOF in the debugger loop exits the debugger when EOF
is entered.

Fixes #50170.
2023-06-11 04:20:22 -07:00
Rémi Verschelde
37d1dfef9d
Merge pull request #78000 from RandomShaper/let_users_mess_up
Let user scripts disable thread safety checks
2023-06-10 12:12:13 +02:00
Pylgos
d7eb7108f0 Fix gdextension variant type conversion 2023-06-10 10:52:17 +09:00
David Snopek
36f4b99638 Fix wrapping Object's in GDExtension that aren't exposed 2023-06-09 13:41:57 -05:00
Pedro J. Estébanez
2b001db76e Let user scripts disable thread safety checks 2023-06-09 18:24:01 +02:00
Rémi Verschelde
577ab3c565
Merge pull request #75746 from ajreckof/order_autocomplete
Sort code autocompletion with rules
2023-06-08 18:14:31 +02:00
Rémi Verschelde
b761c3a54d
Merge pull request #77974 from RandomShaper/fix_gdscr_th_start
Mark thread name setup safe for nodes
2023-06-08 16:55:51 +02:00
Pedro J. Estébanez
543689eeed Mark thread name setup safe for nodes 2023-06-08 09:54:41 +02:00
David Snopek
ef9cb793d3 Remove GDExtension compatibility code for Godot 4.0 2023-06-07 13:01:42 -05:00
Rémi Verschelde
aa5dfff3f0
Merge pull request #77410 from dsnopek/object-pointer-pointer-encoding
Standardize Object ptrcall encoding on `Object **`
2023-06-07 13:31:49 +02:00
Rémi Verschelde
2a1bc05901
Merge pull request #77469 from lyuma/skeleton_ik_roll_fix
Fix for SkeletonIK3D interpolation and bone roll
2023-06-06 20:39:46 +02:00
Lyuma
9aa46bf3f5 Fix for SkeletonIK3D interpolation and bone roll
Fix bug in internal Basis::rotate_to_align function (also used with identity Basis in scene/resources/curve.cpp)
Use ChainItem children rather than local bone rest to determine IK bone roll to match Godot 3.x behavior
2023-06-05 20:44:45 -07:00
Rémi Verschelde
f00c971b81
Merge pull request #63168 from Levrault/master
Fix: InputEventJoypadMotion should trigger only once on a vslider
2023-06-05 18:04:39 +02:00
Luc-Frédéric Langis
166ca77f20 feat(gamepad): improve gamepad behavior with slider and popup_menu 2023-06-05 10:20:46 -04:00
Rémi Verschelde
3dd0307f3f
Merge pull request #76348 from warriormaster12/pipeline-cache
Implement Vulkan pipeline caching
2023-06-01 00:40:33 +02:00
warriormaster12
dded713dc0 Implement Vulkan pipeline caching 2023-05-31 22:24:18 +03:00
Mack
1326b7e04f Fix buffer over-read and memory leaks when using long filepaths in a zip archive and improved robustness of long filepaths and reading files. 2023-05-31 13:11:59 +00:00
Yuri Sizov
eb5e0e07b4
Merge pull request #77459 from felaugmar/fix-override-merging-into-project-godot
Ignore the `project_settings_override` file when in editor
2023-05-31 13:09:46 +02:00
Winston
50d8ee8eee
Expose ProjectSettings.set_as_internal() 2023-05-30 21:16:29 +02:00
Mario Liebisch
f381543185
Properly free core types in reverse order
This fixes #62152.
2023-05-30 17:47:12 +02:00
kobewi
e767ff5695 Add project tags 2023-05-30 00:53:02 +02:00
Yuri Sizov
72f7131be1
Merge pull request #77456 from korypostma/grayscale_fix_77393
Fix grayscale alpha for `Image::convert` `FORMAT_L8` using REC.709
2023-05-29 17:45:29 +02:00
Yuri Sizov
97a6b40e4e
Merge pull request #70386 from sfrembling/70141
Add Human Readable Error Message for Object::set_meta
2023-05-29 17:24:25 +02: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
Yuri Sizov
a12327e277
Merge pull request #77445 from RedworkDE/gdextension-compat-update-validation
Update extension API validation
2023-05-27 17:23:26 +02:00
Rémi Verschelde
699b66b62d
Merge pull request #77010 from dsnopek/gdextension-editor-plugins
Allow GDExtensions to add editor plugins
2023-05-26 11:00:32 +02:00
David Snopek
77733faede Attempt to standardize Object ptrcall encoding on Object ** 2023-05-25 21:46:22 -05:00
David Snopek
3007163210 Allow GDExtensions to add editor plugins 2023-05-25 09:14:29 -05:00
Rémi Verschelde
4203389c1b
Merge pull request #77457 from smix8/clipper_includes_4.x
Remove unnecessary Clipper lib includes
2023-05-25 09:26:09 +02:00
Rémi Verschelde
4c4bf58ffb
Merge pull request #77417 from winston-yallow/support-project-settings-usage-flags
Expose ProjectSettings.set_as_basic() to scripting
2023-05-25 09:25:19 +02:00
Felipe Augusto Marques
e759129dd5 Ignore "project_settings_override" in the editor 2023-05-25 01:30:37 -03:00
smix8
66a8418a2d Remove unnecessary Clipper lib includes
Removes unnecessary Clipper lib includes.
2023-05-24 23:57:08 +02:00
RedworkDE
bbe04e1ec8 Update extension api validation
- Ensure that multiple changes to one method cannot hide each other in the CI.
- Check virtual methods for changes.
- Compare the detailed changes to a method.
- Compare enums.
- Fix comparing global enums.
- Use `vformat` to build error messages.
2023-05-24 18:51:33 +02:00
Winston
263aedc1ad
Expose ProjectSettings.set_as_basic() to GDScript 2023-05-24 13:28:08 +02:00
Rémi Verschelde
6f34a23439
Merge pull request #76082 from reduz/ability-to-look-at-in-model-space
Add the ability to look-at in model-space.
2023-05-24 08:46:53 +02:00
Rémi Verschelde
390d87e974
Merge pull request #71352 from m4gr3d/editor_optimization_main
Improve startup benchmarking
2023-05-24 08:43:52 +02:00
Rémi Verschelde
adbdf9a86e
Merge pull request #77234 from RandomShaper/fix_rtl_mt
Allow threads to mark themselves as safe for nodes
2023-05-24 08:42:59 +02:00
Juan Linietsky
5fdc1232ef Add the ability to look-at in model-space.
This is a much simpler attempt to solve the same problem as #76060, but without breaking any compatibility.

* Adds a description of what model space is in the Vector3 enums (MODEL_* constants). This has the proper axes laid out for imported 3D assets.
* Adds the option to `look_at` using model_space, which uses Vector3.MODEL_FRONT as forward vector.

The attempt of this PR is to still break the assumption that there is a single direction of forward (which is not the case in Godot)
and make it easier to understand where 3D models are facing, as well as orienting them via look_at.
2023-05-24 10:10:24 +09:00
Pedro J. Estébanez
e725b4b02b Allow threads to mark themselves as safe for nodes 2023-05-24 00:22:58 +02:00
Fredia Huya-Kouadio
831b4a5366 Improve startup benchmarking
Move the benchmarking measuring methods from `Engine` to `OS` to allow for platform specific overrides (e.g: can be used to hook into platform specific benchmarking and tracing capabilities).
2023-05-23 13:22:35 -07:00
ajreckof
006e899bb3 sort code completions with rules
Fixups

Add levenshtein distance for comparisons, remove kind sort order, try to improve as many different use cases as possible

Trying again to improve code completion

Sort code autocompletion options by similarity based on input

To make it really brief, uses a combination `String.similiary`, the category system introduced in a previous PR, and some filtering to yield more predictable results, instead of scattering every completion option at seemingly random.

It also gives much higher priority to strings that contain the base in full, closer to the beginning or are perfect matches.

Also moves CodeCompletionOptionCompare to code_edit.cpp

Co-Authored-By: Micky <66727710+Mickeon@users.noreply.github.com>
Co-Authored-By: Eric M <41730826+EricEzaM@users.noreply.github.com>
2023-05-23 05:12:34 +02:00
jpcerrone
0fb307720c PCK file path improvements
Fixes godotengine#77317 (Inconsistent PCK file path behaviour).
Simplifies all PCK file paths so that paths with extra '/' symbols in them
still match to the same path.
Fixes various FileAccess methods that didn't work when using PCK paths that
contain extra '/' symbols.
2023-05-22 15:03:05 -03:00
Rémi Verschelde
5dc093b19a
Merge pull request #77341 from RedworkDE/doctool-material-error-fix
Fix error in `BaseMaterial3D` when running doctool
2023-05-22 17:02:23 +02:00
RedworkDE
69f2bc2751 Improve SelfList and fix error in BaseMaterial3D when running doctool 2023-05-22 16:38:57 +02:00
Rémi Verschelde
80bf8fd186
Merge pull request #73511 from dsnopek/gdextension-object-name
Add GDExtension function to get Object class name
2023-05-22 14:02:59 +02:00
David Snopek
c6b0d4aae3 Add GDExtension function to get Object class name 2023-05-22 06:58:59 -05:00
RedworkDE
402b3d146a Bind forgotten default value for GDExtension::open_library argument 2023-05-22 00:14:55 +02:00
Rémi Verschelde
9ad9820f5d
Merge pull request #77229 from RandomShaper/fix_mt_issues
Fix message queue issues
2023-05-19 14:30:10 +02:00
Pedro J. Estébanez
c450260e3e Fix message queue issues
- Missing flush in resource loading.
- Wrong checks about message queue instance.
2023-05-19 13:11:34 +02:00
Rémi Verschelde
aaa77d0d8f
Merge pull request #77132 from bruvzg/tts_disable
Add `audio/general/text_to_speech` project setting to enable/disable TTS.
2023-05-19 10:10:38 +02:00
Rémi Verschelde
9b1b50f2eb
Merge pull request #75465 from RedworkDE/signal-disconnect-error
Improve error message when disconnecting callable from signal it was not connected to
2023-05-19 10:09:47 +02:00
bruvzg
5b9984b5a2
Add audio/general/text_to_speech project setting to enable/disable TTS. 2023-05-18 20:16:03 +03:00
Ninni Pipping
d2ddd8b228 Fix StringName comparison 2023-05-18 13:25:40 +02:00
RedworkDE
9c9fd9ffbf Improve error message when disconnecting callable from signal it was not connected to 2023-05-18 00:46:27 +02:00
Rémi Verschelde
d803304c62
Merge pull request #77145 from RandomShaper/enh_fix_mt_proc
Enhance/fix MT-processing related things
2023-05-17 15:59:21 +02:00
Rémi Verschelde
26f96aec9d
Merge pull request #77143 from RandomShaper/fix_wtp_deadlocks
Avoid multiple possibilites of deadlock in resource loading
2023-05-17 15:59:18 +02:00
Rémi Verschelde
b0f49266f9
Merge pull request #76719 from m4gr3d/add_input_event_cancelled_state_main
Augment the `InputEvent` class with a `CANCELED` state
2023-05-17 11:25:21 +02:00
Rémi Verschelde
56fc6316b7
Merge pull request #64789 from derammo/derammo_const_ref
Change Ref<T> to allow non const access to ptr
2023-05-17 11:25:13 +02:00
Rémi Verschelde
411b6a95a0
Merge pull request #52314 from lawnjelly/four_delta_smooth
Add frame delta smoothing option (4.x)
2023-05-17 11:25:03 +02:00
Pedro J. Estébanez
50cf3d6966 Optimize threading-sensitive node data for single-threaded processing 2023-05-17 02:04:41 +02:00
Pedro J. Estébanez
a6e43f71b6 Avoid multiple possibilites of deadlock in resource loading 2023-05-17 01:52:39 +02:00
RedworkDE
110bc5058d Compress embedded GDExtension interface 2023-05-16 22:16:45 +02:00
David Snopek
9b9482d4bb Rework GDExtension interface from a struct to loading function pointers 2023-05-16 10:27:46 -05:00
lawnjelly
7925670f81 Add frame delta smoothing option (4.x)
Frame deltas are currently measured by querying the OS timer each frame. This is subject to random error. Frame delta smoothing instead filters the delta read from the OS by replacing it with the refresh rate delta wherever possible.

This PR also contains code to estimate the refresh rate based on the input deltas, without reading the refresh rate from the host OS.

The delta_smooth_enabled setting can also be modified at runtime through OS::, and there is also now a command line setting to override the project setting.
2023-05-16 13:57:25 +01:00
Rémi Verschelde
accb57d50f
Merge pull request #77036 from bonjorno7/ok-color-static
Make ok_color functions static
2023-05-16 11:01:08 +02:00
Rémi Verschelde
8cfa19a078
Merge pull request #77000 from reduz/make-more-base-nodes-thread-safe
Make more base nodes thread safe
2023-05-16 00:31:56 +02:00
Shea Frembling
0d6487073f update error from Object::set_meta to be more human readable
update error from Object::set_meta to be more human readable

Add metadata to error message

Add metadata to identifier
2023-05-15 15:14:45 -05:00
Fredia Huya-Kouadio
250749fa79 Augment the InputEvent class with a CANCELED state
The `InputEvent` class currently supports the `pressed` and `released` states, which given the binary nature, is represented by a `bool` field.
This commit introduced the `CANCELED` state, which signals that an ongoing input event has been canceled.
To represent all the states, the `InputEventState` enum is added and the `InputEvent` logic is refactored accordingly.
2023-05-15 11:48:25 -07:00
Emmanuel Leblond
e785dd9dd9
Improve user-friendliness of "return value as function param" pattern in GDExtension API
This commit introduce separate types (e.g. GDNativeStringPtr vs GDNativeUninitializedStringPtr)
depending on if the pointed data is already initialized (C++ style where constructor is alway
called when create a variable even if it is to be passed as return value) or not (C style).
On top of that, small changes has been made to `GDNativeInterface` so that it methods are
consistent on using uninitialized return value.
2023-05-15 17:14:57 +02:00
Juan Linietsky
0a9f72d5a8 Make more base nodes thread safe
Ongoing work to make more of the base nodes thread safe.
2023-05-15 16:54:10 +02:00
Rémi Verschelde
5c653c27cd
Merge pull request #77093 from RandomShaper/fix_mq_copy
Fix transfer of messages between queues
2023-05-15 13:47:18 +02:00
Rémi Verschelde
70dcfdab1f
Merge pull request #76446 from reduz/add-gdextension-api-compatibility
Add a backwards-compatibility system for GDExtension
2023-05-15 13:43:46 +02:00
Rémi Verschelde
1d83a4c5a5
Merge pull request #72249 from RandomShaper/robust_sync
Robustify multi-threading primitives
2023-05-15 13:42:52 +02:00
Juan Linietsky
d8078d3f4c Add a backwards-compatibility system for GDExtension method
This adds a way to ensure that methods that were modified in the Godot API will continue working in older builds of GDExtension even if the new signature is different.

```C++
// New version (changed)
ClassDB::bind_method(D_METHOD("add_sphere","radius","position"),&MyShapes::add_sphere);
// Compatibility version (still available to extensions).
ClassDB::bind_compatibility_method(D_METHOD("add_sphere","radius"),&MyShapes::_compat_add_sphere);
```

**Q**: If I add an extra argument and provide a default value (hence can still be called the same), do I still have to provide the compatibility version?
**A**: Yes, you must still provide a compatibility method. Most language bindings use the raw method pointer to do the call and process the default parameters in the binding language, hence if the actual method signature changes it will no longer work.

**Q**: If I removed a method, can I still bind a compatibility version even though the main method no longer exists?
**A**: Yes, for methods that were removed or renamed, compatibility versions can still be provided.

**Q**: Would it be possible to automate checking that methods were removed by mistake?
**A**: Yes, as part of a future PR, the idea is to add a a command line option to Godot that can be run like : `$ godot --test-api-compatibility older_api_dump.json`, which will also be integrated to the CI runs.
2023-05-15 12:05:40 +02:00
Pedro J. Estébanez
93de52942a Fix transfer of messages between queues 2023-05-15 11:51:58 +02:00
Fabio Alessandrelli
fb10f45efe
Merge pull request #75867 from tefusion/fix_http_client_unicode_request
Fix HTTPClient _request using wrong size
2023-05-14 16:05:39 +02:00
Emmanuel Leblond
7501ebb91a
Make *_operator_index in gdnative_interface not logging an error if called with an out-of-bound index 2023-05-13 20:01:55 +02:00
bonjorno7
283cac859c Make ok_color functions static
It needs to be a class to prevent build errors, but the functions can at least be static, so you don't have to instance the class.
2023-05-13 16:57:19 +02:00
Rémi Verschelde
1c8b203f70
Merge pull request #77011 from Faless/tls/fix_crashes_when_unavailable
[TLS] Fix crashes trying to use TLS when not available.
2023-05-12 23:26:43 +02:00
Fabio Alessandrelli
eeac6f8c7f [TLS] Fix crashes trying to use TLS when not available.
If no StreamPeerTLS implementation is available, HTTPClient and
WebSocketPeer will now correctly refuse to connect using TLS returning
ERR_UNAVAILABLE.

Similarly, ENetConnection will refuse to setup DTLS when PacketPeerDTLS
is not available.
2023-05-12 20:08:10 +02:00
Pedro J. Estébanez
6189ab5291 Robustify multi-threading primitives 2023-05-12 19:04:57 +02:00
Pedro J. Estébanez
45d0b38076 Enhance thread safety of loaders and importers 2023-05-12 17:44:48 +02:00
Pedro J. Estébanez
7537a0521f Simplify ResourceLoader error callbacks 2023-05-12 17:44:48 +02:00
Rémi Verschelde
20ed51a912
Merge pull request #72704 from myaaaaaaaaa/single-main-thread
Partial fixes for `threading/worker_pool/max_threads` = 0
2023-05-12 15:09:50 +02:00
Pedro J. Estébanez
123ba9d464 WorkerThreadPool: Handle exit signal in the tentative scheduling done during waits 2023-05-12 13:31:04 +02:00