Commit graph

961 commits

Author SHA1 Message Date
Haoyu Qiu
51fd1c27aa Fix String::word_wrap() for long words 2022-08-18 16:56:38 +08:00
Marcel Admiraal
cdd60416ed Fix axis mapped to DPad buttons not releasing opposite button 2022-08-17 09:10:36 +01:00
Haoyu Qiu
eb176b135a Make theme tests compile in Visual Studio 2017 2022-08-06 16:06:38 +08:00
Rémi Verschelde
daa5b542b4
Merge pull request #56765 from madmiraal/fix-45592-2-3.x
[3.x] Fix mouse speed not changing fast enough
2022-08-05 22:37:44 +02:00
Rémi Verschelde
5ed5bb2a5e Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@4896d2de6b

(cherry picked from commit 86647c9e42)
2022-08-05 03:03:48 +02:00
Fabio Alessandrelli
fbc7fc44ae Fix some array size function definition mismatch.
(cherry picked from commit 55845bac26)
2022-08-04 15:18:43 +02:00
Rémi Verschelde
818f1eed31 Code quality: Fix header guards consistency
Adds `header_guards.sh` bash script, used in CI to validate future
changes. Can be run locally to fix invalid header guards.
2022-07-25 14:53:37 +02:00
Rémi Verschelde
1f79b9dad5 Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@880abd09c9

(cherry picked from commit b70e4fc0f3)
2022-07-18 16:05:43 +02:00
Jan Haller
861e155543 Fix exit code of --help and --version, and test them in CI
Corrects prior regression which caused ERROR output and exit code of 1.

(cherry picked from commit d38d76d039)
2022-07-08 14:54:16 +02:00
Jan Haller
da78e92321 Command line arguments '--version' and '--help' return exit code 0 instead of 255
Allows to detect whether those commands executed successfully, which makes integration with shell scripts/CI/bindings straightforward.

(cherry picked from commit e3a8edf536)
2022-07-08 14:54:10 +02:00
Rémi Verschelde
d6bcdd18c3 Input: Re-enable input accumulation disabled by error in 3.4
Input accumulation was implemented and enabled by default in 3.1, and
I don't recall major complaints around it (or bugs were fixed).

In 3.4, #42220 added input buffering and apparently toggled input
accumulation off by mistake.

This led to multiple bug reports about degraded performance on Windows,
or simply unexpected behavior change (see linked issues in #55037).

Fixes #55037.
2022-07-07 23:04:51 +02:00
Rémi Verschelde
cc9dd00e1a Revert "Command line arguments '--version' and '--help' return exit code 0 instead of 255"
This reverts commit 9e165a8c2b.
See https://github.com/godotengine/godot/pull/62550#issuecomment-1172745325.
2022-07-02 00:07:14 +02:00
Jan Haller
9e165a8c2b Command line arguments '--version' and '--help' return exit code 0 instead of 255
Allows to detect whether those commands executed successfully, which makes integration with shell scripts/CI/bindings straightforward.

(cherry picked from commit e3a8edf536)
2022-06-30 19:23:01 +02:00
Hugo Locurcio
b853b8d065 Add a property hint for the iOS touch delay project setting
(cherry picked from commit 21da2fbbb0)
2022-06-16 10:20:52 +02:00
Hugo Locurcio
bec892c010 Tweak default crash handler message in exported projects
When an exported project crashes, the crash handler message
shouldn't reference the Godot issue tracker, as not all crashes
are Godot's fault.

Reporting crashes that only occur on exported projects is still allowed,
but it should not be done by people who aren't working on the project
in question.

(cherry picked from commit c850ccb7c0)
2022-06-16 10:16:32 +02:00
FireForge
53c01540d9 Make Input mouse_mode and use_accumulated_input properties
Co-authored-by: Haoyu Qiu <timothyqiu32@gmail.com>
2022-06-10 17:33:12 +08:00
Hugo Locurcio
8d813c4511 Hide the first --print-fps outputs after the engine has started
The first 2 or 3 prints are inaccurate since the engine has just
started at that point.

(cherry picked from commit 2d56dfb746)
2022-05-17 23:28:32 +02:00
kobewi
621cb8c52f Move Display settings higher in the list
(cherry picked from commit 739242dd04)
2022-05-16 17:14:43 +02:00
Fabio Alessandrelli
225e75daba [3.x] [Debugger] Add --debug-server CLI option.
Automatically starts the editor debug server at given <IP>:<PORT>.

E.g.:
 # Run editor and debug server listening on any interface, port 8080
godot3 -e --path proj/proj_empty --debug-server *:8080

 # Run the godot project connecting to that debug server.
godot3 --path proj/proj_empty --remote-debug 127.0.0.1:8080
2022-05-06 14:02:00 +02:00
Rémi Verschelde
c89c21145b Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@b7d126eb71

(cherry picked from commit 30fbb8964d)
2022-05-05 15:02:46 +02:00
lawnjelly
df7fab51a3 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-05-04 20:30:46 +01:00
Rémi Verschelde
4b6e5f5da6
Merge pull request #60530 from timothyqiu/theme-validation-3.x 2022-05-02 10:49:27 +02:00
Haoyu Qiu
767134fd8d Fix left aligned integer sign in string formatting 2022-05-01 12:43:03 +08:00
lawnjelly
ad9b2b3794 Physics Interpolation - add helper warnings
When physics interpolation is active on a node, it is essential that transforms are updated during "_physics_process()" rather than "_process()" calls, for the interpolation to give the correct result.

This PR adds optional warnings for instances, cameras and multimeshes which can flag updates being incorrectly called, and thus make these problems much easier to fix.
2022-04-26 13:56:02 +01:00
Haoyu Qiu
76343f4055 Validate theme type/item names 2022-04-26 20:09:18 +08:00
KingCakeTheFruity
198d147f8e Added p_shape check to avoid engine crush
(cherry picked from commit 29a2809d21)
2022-04-14 21:35:32 +02:00
Jason Yundt
6ca73386d1 Improve autoload inheritance error message
Autoloaded scripts should always inherit from Node. When you run a
project that tries to autoload a script which doesn’t inherit from Node,
then Godot gives an error.

Before this change, the error said “Script does not inherit a Node”.
That error message is a little bit misleading. If a class inherits a
Node, then one of its superclasses has a Node. If a class inherits
_from_ Node, then one of its superclasses is Node. This change corrects
that mistake.

Fixes #59884.

(cherry picked from commit 1cc7e7ec33)
2022-04-13 11:43:49 +02:00
snowapril
c77b710035 Fix crash on get index for non-existing string
As _buttons and _axes have both valid string and nullptr.
When iterating over them, if given key exists it will work correctly.
But if given key does not exist, it will end up with
String::operator=(nullptr). As String constructor from nullptr exists, I
use it.
2022-03-17 17:49:12 +09:00
Rémi Verschelde
ee818e1631
Merge pull request #54026 from ConteZero/primary_clipboard_linux_3.x 2022-03-14 18:52:20 +01:00
ConteZero
2ff0735329 Added primary clipboard for Linux 2022-03-14 15:28:36 +01:00
Pedro J. Estébanez
3d7821bf1f Drop mouse focus and over when gui input is globally disabled
Since some porjects may be relying on the former behavior, this is opt-in via a new project setting, disabled by default, but enabled for new projects, since it's the new standard behavior (and the only one in 4.0).
2022-03-14 11:06:26 +01:00
lawnjelly
688dc534e5 Fix get_global_transform_interpolated() with multiple ticks per frame
The previous and current transforms in the interpolation data were not being correctly updated in cases where two or more physics ticks occurred on a frame. This PR introduces a simple mechanism to ensure updates on interpolated spatials.
2022-02-25 11:22:00 +00:00
Yuri Roubinsky
4c2ffa7af3 Fix test_shader_lang (for 3.x) 2022-02-22 15:24:34 +03:00
Rémi Verschelde
c221539207
Merge pull request #58387 from lawnjelly/fti_jitter_fix 2022-02-21 12:18:26 +01:00
lawnjelly
b90f1a3ec0 Disable jitter fix when physics interpolation is enabled. 2022-02-21 10:32:42 +00:00
Rémi Verschelde
0d8fa9baca Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@94b76208bc

(cherry picked from commit e3d89a76f7)
2022-02-21 11:11:36 +01:00
Powerbyte7
52ce161787 [HTML5] Add Stadia controller to database
Add web support for the Stadia controller.

(cherry picked from commit b8a7ea034c)
2022-02-21 11:10:35 +01:00
lawnjelly
522bce1159 Fixed Timestep Interpolation (3D)
Adds fixed timestep interpolation to the visual server.
Switchable on and off with project setting.

This version does not add new API for set_transform etc, when nodes have the interpolated flag set they will always use interpolation.
2022-02-16 09:41:23 +00:00
Rémi Verschelde
7a16bb2ee4
Fix typos with codespell
Using codespell 2.2-dev from current git.

Added `misc/scripts/codespell.sh` to make it easier to run it once in a
while and update the skip and ignore lists.

(cherry picked from commit 1bdb82c64e)
2022-02-11 09:50:59 +01:00
Rémi Verschelde
f50c7f7415
Core: Move generated VERSION_HASH to a .cpp file
This lets us have its definition in `core/version.h` and avoid
rebuilding a handful of files every time the commit hash changes.

(cherry picked from commit 90162851a7)
2022-02-10 13:06:56 +01:00
Rémi Verschelde
689f59dca0
Merge pull request #53463 from lawnjelly/vital_redraws
Add editor vital redraws only option
2022-02-04 21:42:49 +01:00
Rémi Verschelde
80306cc88a
EditorProperty: Fix range hint parsing with optional step
This could lead to have a step of 0 when parsing e.g. "1,10,is_greater".
2022-02-03 12:33:37 +01:00
lawnjelly
a0c6d16c90 Add editor vital redraws only option
When editor continuous redraws is switched off, the editor only redraws when a redraw_request was issued by an element in the scene. This works well in most situations, but when scenes have dynamic content they will continuously issue redraw_requests.

This can be fine on high power desktops but can be an annoyance on lower power machines.

This PR splits redraw requests into high and low priority requests, defaulting to high priority. Requests due to e.g. shaders using TIME are assigned low priority.

An extra editor setting is used to record the user preference and an extra option is added to the editor spinner menu, to allow the user to select between 3 modes:

* Continuous
* Update all changes
* Update vital changes
2022-02-02 11:26:45 +00:00
Rémi Verschelde
ed869729ae
Merge pull request #56755 from madmiraal/fix-45592-3.x 2022-01-24 10:06:24 +01:00
Rémi Verschelde
c938104a88
Merge pull request #56630 from Pineapple/replace-find-last 2022-01-18 16:36:52 +01:00
Rémi Verschelde
1ee44b2366
ImageLoader: Remove references to unsupported svgz extension
I don't see any reference to gzip/svgz supported in the nanosvg library,
and the handful of test gzip compressed svgz files I tried failed loading.

Also cleaning a couple missing includes in platform export code.
2022-01-17 10:52:32 +01:00
Marcel Admiraal
949ea2b326 Simplify InputDefault::joy_axis code by using float instead of struct JoyAxis 2022-01-14 15:36:35 +00:00
Marcel Admiraal
3d96d7d9fb Fix mouse speed not changing fast enough
- Uses all accumulated movements when calculating speed
- Discards old accumulated movements
- Sets last mouse speed to zero when there is no movement
2022-01-13 18:52:08 +00:00
Rémi Verschelde
a627cdafc5
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-13 15:54:13 +01:00
Marcel Admiraal
b7545631de Use mouse event relative motion to calculate mouse speed 2022-01-13 10:29:57 +00:00
bruvzg
6eac65d4fe
Add joystick button index boundary check. Increase max. button number to 128 (max. buttons supported by DirectInput).
(cherry picked from commit 61ea8f8337)
2022-01-12 17:28:07 +01:00
Rémi Verschelde
8a192cd0ab
Merge pull request #55987 from bruvzg/wt🤎3 2022-01-10 16:43:56 +01:00
Bartłomiej T. Listwon
22750b1c03 Replace String::find_last with rfind where possible (backward compatible with old API) 2022-01-08 22:40:44 +01:00
Rémi Verschelde
b197de6f5f
Fix typos with codespell
Using codespell 2.1.0.

Method:
```
$ cat > ../godot-word-whitelist.txt << EOF
ang
curvelinear
dof
doubleclick
fave
findn
GIRD
leapyear
lod
merchantibility
nd
numer
ois
ony
que
readded
seeked
statics
synching
te
uint
unselect
webp
EOF

$ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"
$ git diff // undo unwanted changes
```
2022-01-07 00:14:54 +01:00
Jake Young
09bc9eb101
Backport NavigationServer with RVO2 to 3.x
Change the entire navigation system.
Remove editor prefix from nav mesh generator class. It is now used for baking
at runtime as well.
Navigation supports obstacle avoidance now with the RVO2 library.
Nav system will also automatically link all nav meshes together to form one
overall complete nav map.
2022-01-05 16:00:56 +01:00
Rémi Verschelde
9bc750da55
Merge pull request #56029 from madmiraal/revert-55997-3.x-fix-switch-controller-event-spam 2021-12-21 09:45:21 +01:00
Hugo Locurcio
20f76f2298
Print requested V-Sync mode when Print Fps is enabled
This can be used to diagnose why the printed FPS is locked to the
monitor refresh rate.
2021-12-20 21:28:06 +01:00
bruvzg
59085d5051
[Windows] Improve console handling and execute.
Always build with the GUI subsystem.
Redirect stdout and stderr output to the parent process console.
Use CreateProcessW for blocking `execute` calls with piped stdout and stderr (prevent console windows for popping up when used with the GUI subsystem build, and have more consistent behavior with non-blocking calls).
Add `open_console` argument to the `execute` to open a new console window (for both blocking and non-blocking calls).
Remove `interface/editor/hide_console_window` editor setting.
Remove `Toggle System Console` menu option.
Remove `set_console_visible` and `is_console_visible` functions.
2021-12-18 10:13:27 +02:00
Marcel Admiraal
9f250e8370
Revert "[3.x] Fixed event spam when using the Nintendo Switch controller" 2021-12-17 17:20:43 +00:00
Rémi Verschelde
ab10fa0439
Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@265b43b789.

(cherry picked from commit ed395c6b99)
2021-12-17 00:14:54 +01:00
Rémi Verschelde
b61a93d86f
Merge pull request #55997 from slouken/3.x-fix-switch-controller-event-spam
[3.x] Fixed event spam when using the Nintendo Switch controller
2021-12-16 19:51:19 +01:00
Sam Lantinga
e5b0f86260 Fixed event spam when using the Nintendo Switch controller
There is no filtering on the Nintendo Switch Pro controller thumbstick, so there will frequently be events with very slight change. These are turned into "not pressed" events, which cancel "pressed" events from keys and buttons.

This change filters out up to 5% jitter, but it might be worth revisiting whether "not pressed" events should cancel "pressed" events.
2021-12-16 09:09:06 -08:00
Haoyu Qiu
c11b1850c4 Make --doctool locale aware
* Adds `indent(prefix)` to `String`
* Moves the loading of tool/doc translation into
  `editor/editor_translation.{h,cpp}`
* Makes use of doc translation when generating XML class references, and
  setup the translation locale based on `-l LOCALE` CLI parameter.

The XML class reference won't be translated if `-l LOCALE` parameter is
not given, or when it's `-l en`.
2021-12-16 18:27:32 +08:00
Rémi Verschelde
2025648d6d
Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@348cfa347f.

(cherry picked from commit 03e105f677)
2021-12-10 11:08:30 +01:00
lawnjelly
3d981b8265 Add option to use handles to RID
Adds an option to compile an alternative implementation for RIDs, which allows checks for erroneous usage patterns as well as providing leak tests.
2021-12-06 14:43:34 +00:00
Rémi Verschelde
d5b22e614e
Merge pull request #55484 from pycbouh/theme-load-and-order-3.x 2021-12-02 17:20:31 +01:00
Rémi Verschelde
f9bafe4ba4
Remove editor splash screen with sponsors logo
The Godot Project Leadership Committe has decided to update the sponsoring
tiers so that the Platinum Sponsorship no longer includes a logo on the
editor splash screen.

This lets us reclaim the editor splash screen space for community-related
content instead of sponsors (e.g. a different community-designed splash
screen for each stable branch?).

Also removes two Platinum Sponsors whose sponsorship has expired earlier this
year.

(cherry picked from commit c283fce698)
2021-12-01 14:18:29 +01:00
Yuri Sizov
33fb44223f Make default/project theme wait for modules before initializing 2021-11-30 18:59:32 +03:00
Aaron Franke
035a84fe92
[3.x] Add a Time singleton 2021-11-29 11:00:06 -06:00
kobewi
420c351592
Ignore override.cfg when in editor
(cherry picked from commit 7dc97d6558)
2021-11-25 22:48:20 +01:00
bruvzg
2ef2879d7b
Add Input.is_physical_key_pressed method.
(cherry picked from commit 9877d91c4a)
2021-11-25 22:19:33 +01:00
Hugo Locurcio
e5593212e2
Add a project setting to disable the boot splash image
This allows disabling the boot splash image while keeping the
background color.
2021-11-23 19:06:54 +01:00
lawnjelly
211dc8cd2d BVH - add option for expanded AABBs in leaves
This PR adds a define BVH_EXPAND_LEAF_AABBS which is set, which stores expanded AABBs in the tree instead of exact AABBs.

This makes the logic less error prone when considering reciprocal collisions in the pairing, as all collision detect is now taking place between expanded AABB against expanded AABB, rather than expanded AABB against exact AABB.

The flip side of this is that the intersection tests will now be less exact when expanded margins are set.

All margins are now user customizable via project settings, and take account of collision pairing density to adjust the margin dynamically.
2021-11-20 06:45:12 +00:00
Marcel Admiraal
4d3690eba5 Remove unimplemented methods 2021-11-18 12:47:36 +00:00
Rémi Verschelde
5752457854
Merge pull request #54911 from akien-mga/3.x-modules-check-enabled 2021-11-12 14:49:39 +01:00
Rémi Verschelde
6f4858f184
Modules: Make sure to include modules_enabled.gen.h where needed
Fixes #51677.

Co-authored-by: Arkadiusz Marcin Kołek <aksoftware91@gmail.com>
2021-11-12 13:45:33 +01:00
Hugo Locurcio
4c88a82f50
Move Mono unhandled exception setting to be located within a subsection
Settings that aren't within a subsection are difficult to reach when
other settings do have a subsection.

This also adds documentation for the project setting.
2021-11-10 20:57:35 +01:00
Hugo Locurcio
b31f6f78a3
Display 2 decimals instead of 1 in editor frametime labels
When comparing different graphics settings or optimizations,
this makes precise measurements and frametime comparisons easier.

This also makes the editor FPS display use `pad_decimals()`
for consistency with the implementation in `master`.
2021-11-09 17:20:59 +01:00
Pedro J. Estébanez
4c710780d4 Implement async shader compilation plus caching for GL ES 3
Async. compilation via ubershader is currently available in the scene and particles shaders only.

Bonus:
- Use `#if defined()` syntax for not true conditionals, so they don't unnecessarily take a bit in the version flagset.
- Remove unused `ENABLE_CLIP_ALPHA` from scene shader.
- Remove unused `PARTICLES_COPY` from the particles shader.
- Remove unused uniform related code.
- Shader language/compiler: use ordered hash maps for deterministic code generation (needed for caching).
2021-11-09 12:19:12 +01:00
Rémi Verschelde
7afb784269
Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@322aac4bb7.

Also improve parser errors to allow identifying the problematic mappings.

(cherry picked from commit 4b247e7ffa)
2021-11-03 21:32:53 +01:00
Rémi Verschelde
42d385b312
clang-format: Disable alignment of operands, too unreliable
Sets `AlignOperands` to `DontAlign`.

`clang-format` developers seem to mostly care about space-based indentation and
every other version of clang-format breaks the bad mismatch of tabs and spaces
that it seems to use for operand alignment. So it's better without, so that it
respects our two-tabs `ContinuationIndentWidth`.
2021-10-28 13:23:38 +02:00
Pawel Lampe
cc0479a17e
Fix exit code for --script --check-only, fixes #54087
this commit makes godot executable to return zero exit code
once a valid script is passed via --script during --check-only

(cherry picked from commit 75ae3164a4)
2021-10-23 12:00:28 +02:00
Rémi Verschelde
c743649c0b
Merge pull request #53742 from DmitriySalnikov/exposed_sensor_setters 2021-10-18 23:01:07 +02:00
Rémi Verschelde
a5093d64ac
SCons: List .gen.cpp sources explicitly to avoid globbing errors
Whenever we change the name (or remove) generated cpp files with the `.gen.cpp`
extension, users run into build issues when switching between branches (i.e.
switching before and after the name change/removal). This is because we glob
`*.cpp` so if a now-obsolete file from a previous build is present, we'll
include it too, potentially leading to bugs or compilation failure (due to
missing headers or invalid code).

So globbing patterns in `add_source_files` will now skip files ending with
`.gen.cpp`, which should instead be passed explicitly where they're used.

(cherry picked from commit c133480531)
2021-10-16 10:59:14 +02:00
Дмитрий Сальников
5cf898b897 Exposed setters for sensor values in Input class 2021-10-12 23:09:30 +03:00
Yuri Sizov
b02c61ddb1 Ignore OS specific values (constants, project settings, properties)
Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2021-10-10 23:40:32 +03:00
Rémi Verschelde
77f52bdf99
Merge pull request #52137 from Ansraer/3.x-2d-scale-factor 2021-10-05 19:12:19 +02:00
Ansraer
d44aa61735 implement better ui scaling 2021-10-05 14:30:38 +02:00
Rémi Verschelde
7c9e06f936
Merge pull request #48686 from bruvzg/bundle_icon_3 2021-09-30 14:55:41 +02:00
Manuel Moos
f8e62424c5 Fix negative delta arguments
Three attack points, all after the regular calculations:
1. Prevent negative physics timestep counts. They could occur if
   physics_jtter_fix is changed at runtime.
2. idle_step is not allowed to go below 1/8th of the input step.
   That could happen on physics_jitter_fix changes or heavily
   fluctuating performance.
3. Prevent that the idle_step modification breaks the promise
   that Engine.get_physics_interpolation_fraction() is between
   0 and 1 by doing more physics steps than the base system wants.

Fixes #26887

Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
Cherry-Pick from 6be702bace.
2021-09-22 21:09:38 +02:00
jmb462
e7dac5da41
Adding InputMap action error suggestion for Input singleton
(cherry picked from commit a3b9842616)
2021-09-21 17:14:58 +02:00
Hugo Locurcio
b63016c571
Display an alert when attempting to run a project with no main scene
This gives visual feedback when not starting Godot from a terminal.
This could lead to confusion when placing a Godot binary within a
project folder that has no main scene defined.

(cherry picked from commit 87fb9297e3)
2021-09-21 17:14:58 +02:00
tommyZZM
f2a3af47e4 [3.x] Backport Accept global classes for MainLoop type in project settings
https://github.com/godotengine/godot/pull/41190
2021-09-06 23:18:06 +08:00
Hugo Locurcio
59f24d8867
Define a default minimum window size to workaround rendering issues
The minimum window size can still be set to `Vector2(0, 0)` in a script
if needed.
2021-08-23 04:10:24 +02:00
Rémi Verschelde
ffc372b002
Merge pull request #42220 from RandomShaper/agile_input_3.2
[3.x] Improve responsiveness on underpowered Android devices
2021-08-12 22:46:17 +02:00
lawnjelly
3025b6d299 Delta smoothing - fix overflow for long frames
Extremely long frames caused by suspending and resuming the machine could result in an overflow in the delta smoothing because it uses 32 bit math on delta values measured in nanoseconds.

This PR puts a cap of a second as the maximum frame delta that will be processed by the smoothing, otherwise it returns the frame delta 64 bit value unaltered. It also converts internal math to explicitly use 64 bit integers.
2021-08-11 09:47:23 +01:00
Pedro J. Estébanez
31a0ca2cac Add project setting for agile input event flushing
If enabled, key/touch/joystick events will be flushed just before every idle and physics frame.

Enabling this can greatly improve the responsiveness to input, specially in devices that need to run multiple physics frames per each idle frame, because of not being powerful enough to run at the target frame rate.

This will only work for platforms using input buffering (regardless event accumulation). Currenly, only Android does so, but could be implemented for iOS in an upcoming PR.
2021-08-08 12:37:55 +02:00
Pedro J. Estébanez
7be9c26e20 Add input buffering framework
Input buffering is implicitly used by event accumulation, but this commit makes it more generic so it can be enabled for other uses.

For desktop OSs it's currently not feasible given main and UI threads are the same).
2021-08-08 12:37:55 +02:00
Pedro J. Estébanez
58a54f534e Improve input event accumulation
- API has been simplified: all events now go through `parse_input_event()`. Whether they are accumulated or not depends on the `use_accumulated_input` flag.
- Event accumulation is now thread-safe (it was not needed so far, but it prepares the ground for the following changes).
- Touch drag events now support accumulation.
2021-08-08 12:37:55 +02:00
lawnjelly
37f20e1d78 Fix Transform::xform(Plane) functions, add Transform unit tests
The Transform::xform and xform_inv are made safe for Planes when using non-uniform scaling.

Basic unit tests for Transform.

Optimization of calling sites to prevent loss of performance from the changes to xform(Plane).
2021-08-07 08:05:39 +01:00