Commit Graph

64 Commits

Author SHA1 Message Date
d977ed360e Ported: 2D Fixed Timestep Interpolation
Adds support to canvas items and Camera2D.
- lawnjelly
5162efbfe9
2023-08-27 18:48:25 +02:00
d4175f9676 Ported parts of : Refactor Node Processing
* Node processing works on the concept of process groups.
* A node group can be inherited, run on main thread, or a sub-thread.
* Groups can be ordered.
* Process priority is now present for physics.
This is the first steps towards implementing godotengine/godot-proposals#6424.
No threading or thread guards exist yet in most of the scene code other than Node. That will have to be added later.
- reduz
98c655ec8d
- Only got the smaller improvements, and the thread safety for Node and SceneTree. I'm planning to implement a similar system, but I have a different way of doing it in mind.
2023-06-12 21:13:26 +02:00
bb753653dd Don't print an error in ThreadPoolJob's _execute, as it's probably more intuitive this way. 2023-06-05 14:17:50 +02:00
4873a3429d Don't bind _execute() method in ThreadPoolJob derived classes, as it's not needed anymore. 2023-06-05 14:15:49 +02:00
642b5b7159 Use call_deferred when emitting the completed signal, so the handlers run on the main thread. 2023-06-05 09:11:39 +02:00
6dc774cf5c Emit the completed signal automatically in ThreadPoolJob. 2023-06-05 09:08:22 +02:00
9a2a39923a Added virtual _execute to threadPoolJob. 2023-06-05 09:05:16 +02:00
ca982ac507 Ported: Add benchmark logic
Add benchmarking measuring methods to `OS` to allow for platform specific overrides (e.g: can be used to hook into platform specific benchmarking and tracing capabilities).
- m4gr3d
Also contains some mouse pointer improvements.
2023-05-01 15:32:01 +02:00
326bd9a1e9 Added HAS_TRIVIAL_CONSTRUCTOR, HAS_TRIVIAL_DESTRUCTOR, and HAS_TRIVIAL_COPY macros to typedefs to fix new clang deprecations. 2023-04-16 15:42:57 +02:00
79842beb9a Ported: Expose OS.read_string_from_stdin() to the scripting API
This can be used in scripts to read user input in a blocking manner.
This also removes the unused `block` argument, which is always `true`.
- Calinou
badcfa2523
2023-02-07 01:07:31 +01:00
b240df7df6 Updated more copyright headers for 2023. 2022-12-31 21:07:05 +01:00
91e598aa7b Ported: SCons: Cleanup DEBUG, _DEBUG and NDEBUG defines
- `_DEBUG` is MSVC specific so it didn't make much sense to define for
  Android and iOS builds.
- iOS was the only platform to define `DEBUG`. We don't use it anywhere
  outside thirdparty code, which we usually don't intend to debug, so it
  seems better to be consistent with other platforms.
- Consistently define `NDEBUG` to disable assert behavior in both `release`
  and `release_debug` targets. This used to be set for `release` for all
  platforms, and `release_debug` for Android and iOS only.
- Due to the above, I removed the only use we made of `assert()` in Godot
  code, which was only implemented for Unix anyway, should have been
  `DEV_ENABLED`, and is in PoolAllocator which we don't actually use.
- The denoise and recast modules keep defining `NDEBUG` even for the `debug`
  target as we don't want OIDN and Embree asserting all over the place.
- akien-mga
b0b759e6da
2022-12-22 17:42:54 +01:00
Hugo Locurcio
fe010a1efe Silence Input.vibrate_handheld() warning as it's already documented
The warning causes messages to be spammed if you are calling this
method in a game that runs on both desktop and mobile platforms,
unless you guard all calls to `Input.vibrate_handheld()` with
`OS.has_feature("mobile") or OS.has_feature("web")`.

Since the limitation is already documented (and is obvious enough
given the method's name), the warning message is redundant.

(cherry picked from commit 4a991887bf3dd5fbb687fb379f06ac85aa4a6245)
2022-12-22 14:08:01 +01:00
Rafał Mikrut
5d6b2de1f3 Fix exporting big templates
(cherry picked from commit 86fa3ba56015b0fb6f282277b37c211fe803c6f9)
2022-11-30 19:23:35 +01:00
voidshine
840c537d89 Fix MIDI note-on events being converted to note-off events
Update documentation with note about MIDI velocity interpretation

(cherry picked from commit f0f72b313236b3cd8793e6fe7487094d9a04694a)
2022-11-30 19:11:21 +01:00
89cba992ba Now the target fps is customizable for ThreadPool when threading is not enabled. 2022-09-17 23:25:47 +02:00
099b05380e Fix race condition. 2022-09-17 22:35:42 +02:00
48d26e9400 Fix setter parameter types for ThreadPool. 2022-09-17 22:23:29 +02:00
Fredia Huya-Kouadio
a6a5b60235 Additional fixes to the Android get_current_dir() implementation. 2022-09-16 22:45:21 +02:00
Pedro J. Estébanez
c91198b335 Add FileAccess::get_access_type()
(cherry picked from commit 8c6b2fbb908261d29a6692dd7a816464c28520d2)
2022-09-16 22:13:21 +02:00
7dd2bce61b Now ThreadPool should properly handle when use_threads changes. 2022-09-10 04:34:36 +02:00
27316923d3 Moved ThreadPool to core. Also it can change it's thread count now when it has time for it. 2022-09-10 04:16:50 +02:00
58da70524b Ported: Add support for multiple virtual keyboard types - brianwinterpixel
ce24b48e50
2022-08-19 16:18:53 +02:00
6be9bf5dfe Cleaned up and added the skeleton modification stack implementations to the build. Also smaller fixes. 2022-08-18 15:41:28 +02:00
9757c39f05 Moved a few more core classes. 2022-08-17 17:43:49 +02:00
99e94b08c4 Moved base input related classes to core/input. 2022-08-17 17:02:24 +02:00
04feb63860 Moved Engine and projectSettings. 2022-08-17 15:35:28 +02:00
be16fe23ad Moved the error macros. 2022-08-17 15:14:19 +02:00
220b2db443 Moved String and related classes under a string folder in core. 2022-08-17 14:19:55 +02:00
dc9cc716c7 Moved Object related classes under core/object. 2022-08-17 13:45:14 +02:00
9555ee56b9 Moved Variant related classes under a variant folder in core. 2022-08-17 13:17:12 +02:00
388b88678e Moved container related classes in core under a new containers directory. 2022-08-17 12:53:49 +02:00
220954cf08 Backported most of the improvements to String from Godot4. 2022-08-15 22:54:03 +02:00
e15630d7f2 Added more helper methods to DirAccessRef and FileAccessRef. Also smaller cleanups. 2022-08-07 21:16:11 +02:00
Rémi Verschelde
2ca1470010 File: Re-add support to skip CR (\r) in File::get_as_text
This was removed in #63481, and we confirmed that it's better like this,
but we add back the possibility to strip CR as an option, to optionally
restore the previous behavior.

For performance this is done directly in `String::parse_utf8`.

Also fixes Android `FileAccess::get_line()` as this one _should_ strip CR.

Supersedes #63717.

(cherry picked from commit 1418f97c70a5551bdbfeea853cbc479b32ea9e08)
2022-08-02 17:58:32 +02:00
641c15f906 Ported: [3.x] HTML5: Add support for Input.vibrate_handheld() - pattlebass
fb7ecc748f
2022-07-30 00:29:14 +02:00
Fredia Huya-Kouadio
361b5b23f7 Address slow copy performance when using the FileAccessFilesystemJAndroid implementation.
Read/write ops for this implementation are done through the java layer via jni, and so for good performance, it's key to avoid numerous repeated small read/write ops due the jni overhead.

The alternative is to allocate a (conversatively-sized) large buffer to reduce the number of read/write ops over the jni boundary.
2022-07-29 22:35:08 +02:00
88fe196e79 Ported: [3.x, macOS, Windows, X11] Add stylus inverted/eraser support to InputEventMouseMotion event.
- hansemro
193d5c11f3
2022-07-29 20:31:16 +02:00
9d76074b58 Ported: Add full support for Android scoped storage.
This was done by refactoring directory and file access handling for the Android platform so that any general filesystem access type go through the Android layer.
This allows us to validate whether the access is unrestricted, or whether it falls under scoped storage and thus act appropriately.
- m4gr3d
24e3b3b88d
2022-07-29 19:24:07 +02:00
Estelle Linkpy Reid
6c65c86669 Corrected InputEventKey::as_text to return a non-empty string for physical keys. 2022-07-29 16:42:10 +02:00
802779db24 Ported: Use ThreadWorkPool instead of thread_process_array in NavMap - adamscott
7749346f48
2022-07-28 22:33:00 +02:00
152f9728b0 Ported: [Windows, 3.x] Add support for handling network share paths. - bruvzg
11a7997a67
2022-07-28 19:33:43 +02:00
942b6d9938 Ported: Make Input mouse_mode and use_accumulated_input properties - fire-forge, timothyqiu
53c01540d9
2022-07-28 18:54:48 +02:00
Aaron Franke
9a35bce6cb Improve architectures in OS::has_feature and make it work on MSVC 2022-07-28 13:43:46 +02:00
Nicholas Huelin
c1010f7d1b Fix inconsistent naming in Time
(cherry picked from commit 8409d92282e71f8ad479f48d6b1f6d52eb73ae39)
2022-07-27 18:28:47 +02:00
850a84584d ported: Add OS::is_process_running function.
Adds the is_process_running function to the native OS class and exposes it to script.
This is implemented on Windows and Unix platforms. A stub is provided for other platforms that do not support this function.
Documentation is updated to reflect new API function. - mdavisprog
53fb0440d3
I did change it a bit.
2022-07-27 14:46:53 +02:00
lawnjelly
da628411d2 Physics Interpolation - Flush transforms after physics tick
Leftover transforms from the physics tick were being flushed during idle, which was causing problems for physics interpolation.

This PR flushes the transforms at the end of the physics tick when physics interpolation is active.
2022-07-27 14:14:36 +02:00
b26a1cd3b4 Ported: [3.x] Improve embedded PCK loading and exporting. - bruvzg
bea7c9be5d
2022-07-27 09:33:39 +02:00
laws65
1ec045e2f1 Proper validation of negative values in datetime strings and datetime dicts
(cherry picked from commit cf9fc0b93609abd52e0f9fe8cd425fef012b6b46)
2022-07-27 01:25:11 +02:00
Oğuzhan Eroğlu
49a98d13a0 Quick fix: Crash when parsing invalid datetime string #60189
(cherry picked from commit 2b8eb126b4dfaa6b3217adef96dca5ed03708de1)
2022-07-27 01:24:52 +02:00