Commit Graph

773 Commits

Author SHA1 Message Date
Rémi Verschelde
b076150b08
Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@01dce71403.

(cherry picked from commit f83486b430)
2021-04-06 22:53:20 +02:00
Rémi Verschelde
69e6ba1591
Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@807ac1fbf9.

(cherry picked from commit cde67f0315)
2021-03-23 13:41:06 +01:00
Fabio Alessandrelli
8b904e7d66
[HTML5] Logitech Dual Action Gamepad FF/Linux
(cherry picked from commit 70d5f652a2)
2021-03-23 13:16:23 +01:00
Hugo Locurcio
79f8b5eff1
Tweak the editor splash screen color to better match the default theme
This helps achieve a visually "smoother" transition between the splash
screen and the editor.

(cherry picked from commit ff2871f9ac)
2021-03-19 10:51:39 +01:00
lawnjelly
20f7037edb Add GLOBAL_DEF_ALIAS and alias for rename of pixel_snap
Having to rename project settings is rare, but when it does occur it can cause user confusion. In order to make compatibility more seamless this PR introduces two new GLOBAL_DEF functions,

GLOBAL_DEF_ALIAS(new_name, old_name, default)
GLOBAL_DEF_ALIAS_RST(new_name, old_name, default)

These are the same as the existing GLOBAL_DEF functions except that if the new setting is not found, it attempts to load from the old setting name. If the old setting is found, it stores it into the new setting, and then calls the regular GLOBAL_DEF functions.
2021-03-09 15:16:24 +00:00
Rémi Verschelde
118567ca28
Merge pull request #46657 from lawnjelly/revert_snapping
Revert backport of 2D transform and camera snapping options
2021-03-08 14:49:41 +01:00
Johannes
36bec6677e Move cursor shape loading after module loading
fixes #46685

(cherry picked from commit 2ac9f37b17)
2021-03-05 22:45:49 +01:00
lawnjelly
bf1de6bbfa Revert backport of 2D transform and camera snapping options
More work is needed to make sure that those options actually solve users' issues, so we prefer to remove the options for 3.2.4 and revisit for a future release.
2021-03-05 14:20:31 +00:00
Pop0p
07fc567d03 Fix a crash when using Input.get_joy_button_index_from_string()
There was a missing comma between two elements in the _buttons array
2021-03-05 11:17:18 +01:00
Mateo Kuruk Miccino
04fefed904 Logger: Cache 'flush_stdout_on_print' to improve performance, and works before ProjectSettings starts.
ProjectSetting: Now 'application/run/flush_stdout_on_print' requires a restart of the Editor to take effect

(cherry picked from commit 89283b7b53)
2021-03-02 10:26:14 +01:00
lawnjelly
b1e24597e7 Renaming rendering/2d project settings.
The rendering/quality/2d section of project settings is becoming considerably expanded in 3.2.4, and arguably was not the correct place for settings that were not really to do with quality.

3.2.4 is the last sensible opportunity we will have to move these settings, as the only existing one likely to break compatibility in a small way is `pixel_snap`, and given that the whole snapping area is being overhauled we can draw attention to the fact it has changed in the release notes.

Class reference is also updated and slightly improved.

`pixel_snap` is renamed to `gpu_pixel_snap` in the project settings and code to help differentiate from CPU side transform snapping.
2021-03-01 11:38:46 +00:00
Liz Haas
8a1f8a68fb Input: Throw error if action doesn't exist
Thow errors if requesting an unexisting InputMap action.
Makes `Input.is_action_*` methods consistents with `Event.is_action_*` which already throw errors.

fixes #33303

(cherry picked from commit 2aee71d52d)
2021-02-25 14:30:25 +01:00
Pedro J. Estébanez
6f4f49c1d5 Make glue generation shutdown more graceful
(cherry picked from commit 23907e6f19)
2021-02-22 21:40:16 +01:00
Pedro J. Estébanez
55b5f98402 Improve robustness of atomics
And fix increment in `CowData` not being conditional anymore after the recent changes.

Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
2021-02-19 11:48:30 +01:00
Hein-Pieter van Braam
220f24c191
Merge pull request #45618 from RandomShaper/modernize_mt_3.2
Backport of all the multi-threading modernization (3.2)
2021-02-18 20:47:24 +01:00
Fredia Huya-Kouadio
ef9d945e16 Disable engine splash logic on Android; this is now handled by the Android theme api.
In addition, add support for scaling and applying filter to the splash screen on Android.
One limitation of the api being used is that the splash screen aspect ratio is not maintained when it's scaled up.
2021-02-18 03:17:58 -08:00
Pedro J. Estébanez
6d89f675b1 Modernize Thread
- Based on C++11's `thread` and `thread_local`
- No more need to allocate-deallocate or check for null
- No pointer anymore, just a member variable
- Platform-specific implementations no longer needed (except for the few cases of non-portable functions)
- Simpler for `NO_THREADS`
- Thread ids are now the same across platforms (main is 1; others follow)
2021-02-18 11:58:08 +01:00
Pedro J. Estébanez
b450036120 Modernize RWLock
- Based on C++14's `shared_time_mutex`
- No more need to allocate-deallocate or check for null
- No pointer anymore, just a member variable
- Platform-specific implementations no longer needed
- Simpler for `NO_THREADS`
2021-02-18 11:41:07 +01:00
Hugo Locurcio
15d9f77f97
Add a project setting to enable stdout flushing in release builds
This can be used in server builds for journalctl compatibility.

(cherry picked from commit 341b9cf15a)

Fixes crash when exiting with --verbose with leaked resources

(cherry picked from commit 25c4dacb88)
2021-02-16 14:27:38 +01:00
Rémi Verschelde
398a625a9f
Merge pull request #39421 from RandomShaper/pause_aware_picking_3.2
Implement pause-aware picking (3.2)
2021-02-09 10:43:48 +01:00
Rémi Verschelde
395afe9363
Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@f72b68b8b0.

Partial revert of #45790.

(cherry picked from commit 5eb46ab616)
2021-02-08 22:36:36 +01:00
Rémi Verschelde
31109c4611
Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@c7cf1397c1.

(cherry picked from commit 2c2fffcb02)
2021-02-08 22:36:36 +01:00
Pedro J. Estébanez
745c711289 Implement pause-aware picking
This adds a new project setting (`physics/common/enable_pause_aware_picking`). It's disabled by default.

When enabled, it changes the way 2D & 3D physics picking behaves in relation to pause:
- When pause is set, every collision object that is hovered or captured (3D only) is released from that condition, getting the relevant mouse-exit callback., unless its pause mode makes it immune from pause.
- During the pause. picking only considers collision objects immune from pause, sending input events and enter/exit callbacks to them as expected.
- When pause is left, nothing happens. This is a big difference with the classic behavior, which at this point would process all the input events that have been queued against the current state of the 2D/3D world (in other words, checking them against the current position of the objects instead of those at the time of the events).
2021-02-08 20:48:13 +01:00
Marcel Admiraal
3dd57a22df Add support for new SDL gamecontroller keywords. 2021-02-07 16:41:23 +00:00
Fabio Alessandrelli
860be94246 Add some HTML5 controllers mapping. 2021-02-06 11:09:01 +01:00
Rémi Verschelde
0c45011779 Main: Load translations and remaps before scene types
This ensures that settings like `gui/theme/custom_font` handle resource
remappings properly, as they load resources in `register_scene_types()`.

Path remaps used to be done before loading scene types in early Godot
versions (as hinted by the "Load Remaps" comment just before "Load Scene
Types") but this was broken when developing new localization features.

Fixes #17640.

(cherry picked from commit bb5dcb6892)
2021-02-05 09:26:09 +01:00
Fabio Alessandrelli
31b5c5ee03 [HTML5] Custom Gamepad library to allow remapping.
No longer use emscripten functions for gamepads, implement them as
library functions in library_godot_display.js instead.
This allows us to do a better job at "guessing" vendorId, productId, OS,
etc. thus allowing us to better find the remapping for the controller.
2021-01-18 13:07:37 +01:00
Fabio Alessandrelli
ea89e73a88 Better gamepad axis event injection.
In the core input handling code we have checks to make sure that if axis
rapidly change sign we inject mid-points to release any pending inputmap
action.

The function though, did not correctly insert the mid-point causing
dpads mapped to an axis that behaves like tri-state buttons (-1,0,1) to
not be released correctly.

This commit fixes that by including in the check the case where the axis
swtiches from abs(1) to 0.
2021-01-18 13:07:37 +01:00
Rémi Verschelde
49646383f1
Update copyright statements to 2021
Happy new year to the wonderful Godot community!

2020 has been a tough year for most of us personally, but a good year for
Godot development nonetheless with a huge amount of work done towards Godot
4.0 and great improvements backported to the long-lived 3.2 branch.

We've had close to 400 contributors to engine code this year, authoring near
7,000 commit! (And that's only for the `master` branch and for the engine code,
there's a lot more when counting docs, demos and other first-party repos.)

Here's to a great year 2021 for all Godot users 🎆

(cherry picked from commit b5334d14f7)
2021-01-13 16:17:06 +01:00
lawnjelly
b5edbe0301 Fix BVH physics project setting
Move the GLOBAL_DEF for the `godot_physics/use_bvh` to occur before GLOBAL_GET.

This prevents a warning occurring and the selection not being used.
2021-01-13 09:22:17 +00:00
Rémi Verschelde
d6fecf7686
Main: Create user data dir in setup()
Custom backport of #39563 with preliminary change to make
`OS::ensure_user_data_dir()` public as done in f8a79a9.

Fixes #32488.
2021-01-08 10:24:48 +01:00
Rémi Verschelde
66bfe855a8
Revert "Add a project setting to enable stdout flushing in release builds"
This reverts commit 341b9cf15a.

This makes the logger crash when used during cleanup: #44850.
2021-01-05 21:33:33 +01:00
Rémi Verschelde
3032b38b52
Merge pull request #44690 from lawnjelly/transform_snap2
[3.2] Improve 2d snapping
2021-01-05 17:19:44 +01:00
Hugo Locurcio
42053bdb66
Fix warning spam when using --help or --version command line argument
When a project setting is not found, a warning message is printed.
This moves the default value declaration so it can be found when
the `--help` or `--version` command line arguments are used.

(cherry picked from commit 5cd37de125)
2020-12-30 09:33:54 +01:00
Hugo Locurcio
f5f04a10f5
Add a project setting to enable stdout flushing in release builds
This can be used in server builds for journalctl compatibility.

(cherry picked from commit 341b9cf15a)
2020-12-29 16:02:00 +01:00
lawnjelly
a237c671bb Improve 2d snapping
Partially revert change allowing sprite get_rect snapping to be controlled by `pixel_snap` again rather than `transform_snap` (to prevent breaking compatibility). Adds a final `use_camera_snap` project setting to allow snapping viewports as in reduz original PR.
2020-12-25 18:53:00 +00:00
Rémi Verschelde
afbca1216e
Revert "Don't open editor window when using --export, --doctool, or --gdnative-generate-json-api"
This reverts commit 27393de36e.

Fixes #44403.
2020-12-16 15:02:10 +01:00
Rémi Verschelde
36662f3b4d
Don't force GLES2 in Project Manager, causes issues on macOS.
This partially reverts #44041.

Also fix the bogus label about lack of GLES3 support being always shown...
It was meant to be behind a check but I had left it out while testing, and
forgot to put it back.
2020-12-11 22:32:41 +01:00
Rémi Verschelde
0c7a9bd283
doc: Sync classref with current source
And fix broken doctool after #43948.
2020-12-10 14:22:31 +01:00
Rémi Verschelde
e8fb0c3230
Merge pull request #43948 from name-here/no-window-on-export-3.2
Don't open editor window when using --export or --doctool
2020-12-09 11:21:55 +01:00
Rémi Verschelde
218d10a6a3
Merge pull request #44041 from akien-mga/project-manager-default-gles2
Use GLES2 by default in the project manager
2020-12-07 11:30:23 +01:00
Marcel Admiraal
c3150eb783 Ignore hint entries in game controller mapping 2020-12-03 09:07:15 +00:00
Rémi Verschelde
8b1ee204cf
Use GLES2 by default in the project manager
This only applies to the project manager instance, what driver is used is otherwise
still defined by the project settings for a running game/editor.

Should help users who have issues with buggy GLES3 drivers to still use the project
manager to create and edit GLES2 projects.
2020-12-02 18:15:54 +01:00
Andrii Doroshenko (Xrayez)
c663b3d5f8
Fix doctool misleading error message
(cherry picked from commit b0e8177306)
2020-12-01 09:00:54 +01:00
name-here
27393de36e Don't open editor window when using --export, --doctool, or --gdnative-generate-json-api 2020-11-29 16:53:38 -05:00
Fabio Alessandrelli
f32c878ef7
Fix CLI export when export_path is in preset.
Export presets contains the export_path option, to specify the default
export location, but the CLI export option disregarded that, and always
required and export path to be specified.
After this commit, if the export path is not specified in the command,
the one in the preset will be used, erroring only if it's not present or
invalid.

(cherry picked from commit 032a1c5dc3)
2020-11-17 22:23:09 +01:00
Rémi Verschelde
d0a5ef9c7a
Merge pull request #43234 from madmiraal/fix-42876-3.2
[3.2] Remove unneeded filter on joy_axis()
2020-11-16 22:41:49 +01:00
Rémi Verschelde
4d667dadb9
Merge pull request #43554 from lawnjelly/refactor_pixel_snap
Add 2d snap transforms option
2020-11-16 18:24:10 +01:00
Rémi Verschelde
fc5b106369
Merge pull request #42168 from madmiraal/fix-42108-3.2
[3.2]  Remove the unnecessary sync() and the restrictions it imposes on 3D Physics.
2020-11-16 09:33:17 +01:00
lawnjelly
a79293e0fc Add 2d snap transforms option
This is a cut back backport of reduz snapping PR #43194.

It just offers a global project setting for transform snapping.
2020-11-15 09:40:07 +00:00