Commit Graph

6243 Commits

Author SHA1 Message Date
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
myaaaaaaaaa fcd8ce52e9 Partial fixes for threading/worker_pool/max_threads = 0 2023-05-12 07:27:35 -04:00
Rémi Verschelde 258fabdbb3
Merge pull request #76836 from Faless/tls/system_certs
[TLS] Add support for platform-specific CA bundles.
2023-05-12 11:17:31 +02:00
Rémi Verschelde ae4d469ca2
Merge pull request #76980 from m4gr3d/fix_input_anr_main
Fix input ANR in the Godot Android editor
2023-05-12 10:07:19 +02:00
Rémi Verschelde 8f17f26233
Merge pull request #76978 from raulsntos/property-hint-compat
Reorder `PropertyHint` enum to avoid breaking compat
2023-05-12 10:06:32 +02:00
Rémi Verschelde cc48827e4a
Merge pull request #76946 from AThousandShips/shadow_warning
Enable shadow warnings and fix raised errors
2023-05-12 10:04:09 +02:00
Rémi Verschelde 186aa649d2
Merge pull request #76945 from RandomShaper/fix_wtp
Fix multiple issues in `WorkerThreadPool`
2023-05-12 10:03:45 +02: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
Fabio Alessandrelli 6fd9982358 [TLS] Add support for platform-specific CA bundles.
Adds a new OS::get_system_ca_certs method which can be implemented by
platforms to retrieve the list of trusted CA certificates using OS
specific APIs.

The function should return the certificates in PEM format, and is
currently implemented for Windows/macOS/LinuxBSD(*)/Android.

mbedTLS will fall back to bundled certificates when the OS returns no
certificates.

(*) LinuxBSD does not have a standardized certificates store location.
    The current implementation will test for common locations and may
    return an empty string on some distributions (falling back to the
    bundled certificates).
2023-05-12 09:58:23 +02:00