Commit graph

703 commits

Author SHA1 Message Date
Fabio Alessandrelli
dc8b7b3b17 Move frame delaying functions from Main to OS.
Will allow specific platforms to override it and avoid blocking on the
main/GUI thread.

(cherry picked from commit 1b6e3458b2)
2020-07-02 13:52:02 +02:00
Hugo Locurcio
087a83fd54 Improve the low processor mode sleep precision
The Low Processor Usage Mode Sleep Usec setting is now used as a
FPS limiter rather than a constant sleep duration.

This will increase CPU/GPU usage slightly due to the higher
effective FPS, but the increase in overall smoothness is worth it.

If both Force Fps and Low Processor Usage Mode settings are enabled
in the project settings, only the setting that causes the highest
sleep duration will be retained.

This closes #11030.

(cherry picked from commit 1c28b269d8)
2020-06-24 23:15:53 +02:00
Rémi Verschelde
530307e7ec Main::cleanup: Move MessageQueue deletion further down where it's safer
Partial revert of #15702 which triggered the issue.

Fixes #39786.

(cherry picked from commit 6480efba45)
2020-06-24 22:52:05 +02:00
Ev1lbl0w
17c87d2ec1
Expose disable_render_loop property to GDScript 2020-06-18 11:59:29 +01:00
Andrea Catania
74d10e766e - Added more euler rotation orders support.
- Fixed floating point issue on the old one.
- Fixed the equation on the get_euler_yxz function.
- Added unit tests.

This work has been kindly sponsored by IMVU.

(cherry picked from commit 2331300989)
2020-06-18 11:29:28 +02:00
Hugo Locurcio
a6a29f97fe Add a suffix to the window title when running from a debug build
Since projects started from the editor or exported in debug mode
run slower than those exported in release mode, this should be
clearly presented to the user.

This partially addresses #20219.

(cherry picked from commit a9c60007a9)
2020-06-18 10:46:01 +02:00
Rémi Verschelde
7bf9787921 SCons: Format buildsystem files with psf/black
Configured for a max line length of 120 characters.

psf/black is very opinionated and purposely doesn't leave much room for
configuration. The output is mostly OK so that should be fine for us,
but some things worth noting:

- Manually wrapped strings will be reflowed, so by using a line length
  of 120 for the sake of preserving readability for our long command
  calls, it also means that some manually wrapped strings are back on
  the same line and should be manually merged again.

- Code generators using string concatenation extensively look awful,
  since black puts each operand on a single line. We need to refactor
  these generators to use more pythonic string formatting, for which
  many options are available (`%`, `format` or f-strings).

- CI checks and a pre-commit hook will be added to ensure that future
  buildsystem changes are well-formatted.

(cherry picked from commit cd4e46ee65)
2020-06-10 15:30:52 +02:00
Rémi Verschelde
15b4192ec6 Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@6191f6333b.

(cherry picked from commit 938334cc9e)
2020-06-05 12:46:28 +02:00
Andrii Doroshenko (Xrayez)
133997654c Add custom_modules build option to compile external user modules
This patch adds ability to include external, user-defined C++ modules
to be compiled as part of Godot via `custom_modules` build option
which can be passed to `scons`.

```
scons platform=x11 tools=yes custom_modules="../project/modules"
```

Features:

- detects all available modules under `custom_modules` directory the
same way as it does for built-in modules (not recursive);
- works with both relative and absolute paths on the filesystem;
- multiple search paths can be specified as a comma-separated list.

Module custom documentation and editor icons collection and generation
process is adapted to work with absolute paths needed by such modules.
Also fixed doctool bug mixing absolute and relative paths respectively.

Implementation details:

- `env.module_list` is a dictionary now, which holds both module name as
  key and either a relative or absolute path to a module as a value.
- `methods.detect_modules` is run twice: once for built-in modules, and
  second for external modules, all combined later.
- `methods.detect_modules` was not doing what it says on the tin. It is
  split into `detect_modules` which collects a list of available modules
  and `write_modules` which generates `register_types` sources for each.
- whether a module is built-in or external is distinguished by relative
  or absolute paths respectively. `custom_modules` scons converter
  ensures that the path is absolute even if relative path is supplied,
  including expanding user paths and symbolic links.
- treats the parent directory as if it was Godot's base directory, so
  that there's no need to change include paths in cases where custom
  modules are included as dependencies in other modules.

(cherry picked from commit a96f0e98d7)
2020-05-25 17:08:38 +03:00
bruvzg
28aabf4f73
[3.2] Block WM_MOUSEMOVE during Windows Ink pen handling. 2020-05-22 14:05:53 +03:00
Rémi Verschelde
b6c551e864
Merge pull request #38875 from bruvzg/tab_drv_sel_32
[Windows, 3.2] Add tablet driver selection.
2020-05-20 13:58:26 +02:00
Hugo Locurcio
a785641196 Allow .res and .tres extensions in the scene CLI positional argument
This closes #35709.

(cherry picked from commit 653334cc8d)
2020-05-20 12:07:08 +02:00
bruvzg
71b2abbfa3
[Windows, 3.2] Add tablet driver selection. 2020-05-20 09:36:56 +03:00
Pedro J. Estébanez
8349635ffc Fix leaks and crashes in OAHashMap
This changes the way the lifespan of items is managed to be consistent.

Bonus: Simplify cases of destroy-then-emplace.
2020-05-18 14:02:49 +02:00
Rémi Verschelde
a5a7b1d462 Input: Readd 'Default Android Gamepad' magic binding
Removed by mistake in #38292 like the Windows `__XINPUT_DEVICE__`,
this magic binding is referenced directly in our code.

(cherry picked from commit 1c61b31109)
2020-05-11 11:22:21 +02:00
hoontee
8d0a925419 Re-add __XINPUT_DEVICE__
Required for `JoypadWindows::probe_joypads`.
Partially reverts 510e83498e. Fixes #38554.

(cherry picked from commit 9aa29b85a8)
2020-05-11 11:04:21 +02:00
lawnjelly
dcb19ed735 Add Nvidia Workaround for GLES3
Ported GLES2 workaround code to GLES3.
2020-05-07 14:54:14 +01:00
bruvzg
78266c09c4
Add support for the WinTab API for pen input. (3.2) 2020-05-05 14:56:02 +03:00
Rémi Verschelde
9b636a2ccd Input: Drop obsolete versions of SDL gamecontrollerdb
The 204 and 205 are the older, SDL 2.0.4 and 2.0.5 compatible mappings,
but since all new mappings have only been added to the main
gamecontrollerdb.txt which overrides the older entries, it doesn't make
much sense for us to keep the old databases.

We do not support the SDL2 half axes and inverted axes features from
gamecontrollerdb.txt, but this only impacts the specific controllers
which can use those features, the rest are parsed and used properly.

As for godotcontrollerdb.txt, it doesn't make sense for us to maintain
our own custom mappings instead of submitting them upstream. The only
exception is the Javascript and UWP platforms for which no bindings are
available upstream, so we keep those entries.

(cherry picked from commit 510e83498e)
2020-05-01 10:56:58 +02:00
punto-
cc08101d50 Input: make VibrationInfo protected to allow implementors to use it
(cherry picked from commit 41a7d07095)
2020-05-01 10:56:58 +02:00
Rémi Verschelde
253fc093b8 DocData: Skip unexposed classes
Properly expose classes that we actually want accessible.

(cherry picked from commit 0ef8bcac4d)
2020-04-21 14:15:34 +02:00
Rémi Verschelde
008e0748c1
Merge pull request #37349 from lawnjelly/kessel32_1
GLES2 2d Batch rendering (across items)
2020-04-17 12:55:33 +02:00
Hugo Locurcio
25b353fd32 Tweak the error message when trying to run an invalid script from CLI
(cherry picked from commit 2ab9515b07)
2020-04-16 12:57:22 +02:00
lawnjelly
b6d652367b Items and draw calls added to IDE Monitor in '2d' section
This adds 2 new values (items and draw calls) to the performance monitor in a '2d' section, rather than reusing the 3d values in the 'raster' section.

This makes it far easier to optimize games to minimize drawcalls.
2020-04-16 11:52:22 +01:00
bruvzg
acfd8b67bd Ignore process serial number (-psn_...) command line argument passed by macOS Gatekeeper.
(cherry picked from commit e92a14ac5f)
2020-04-16 12:47:19 +02:00
Rémi Verschelde
acd14e645a Remove unused classes and stray headers
Found by reviewing headers with 1 or less matching includes:
```
find -name thirdparty -prune -o -name "*.h" -exec basename {} \; | sort -u > headers
for header in $(cat headers); do echo "$header: "; rg -l "#include \"(.*/)?$header\"" | wc -l; done > list-includes
```

(cherry picked from commit 9d24541597)
2020-03-25 11:38:54 +01:00
Hugo Locurcio
2423f75585
Improve the error message displayed when the PCK file can't be found
This explains what to do if the executable was renamed, which is helpful
for people exporting projects.
2020-01-28 00:12:32 +01:00
Rémi Verschelde
72c44bafac Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@fed28b1bf9.
2020-01-26 17:59:15 +01:00
Ignacio Etcheverry
d5122ab31c Sync pending VisualServer commands after ScriptServer finalization
This is needed as C# may free resources from the finalizer thread during
CSharpLanguage::finish(). Previously this would result in RIDs not being freed.
2020-01-13 21:46:44 +01:00
Rémi Verschelde
d88103172c Ignore command line --build-solutions when not editing project
This option is meant to use together with `--path` or from a project
folder. Otherwise the project manager is opened and the option triggers
a crash.

Fixes #25589.
2020-01-13 14:00:47 +01:00
Rémi Verschelde
ab97f78fa5 Revert "Enable Vsync via Compositor by default"
This reverts commit 9600fd5dde.

Add comment warning about possible implications of using this option.

Fixes #35038.
2020-01-13 09:33:27 +01:00
Hugo Locurcio
0218494e6b
Be stricter on what's considered a scene path in CLI argument parsing
This closes #8721.
2020-01-10 13:18:24 +01:00
Rémi Verschelde
83d950b58e
Merge pull request #34968 from Calinou/enable-vsync-via-compositor
Enable Vsync via Compositor by default
2020-01-10 10:04:55 +01:00
Rémi Verschelde
5377f062d4 Main: Prevent Project Manager-ception in editor
Fixes #34904.
2020-01-10 09:48:03 +01:00
Hugo Locurcio
9600fd5dde
Enable Vsync via Compositor by default
This feature was added in #33414 but it was disabled by default.
Now that it got some testing, it's probably safe to enable it
by default.
2020-01-09 22:22:11 +01:00
Rémi Verschelde
c456d87ee6
Merge pull request #34918 from vnen/gdscript-assign-op
GDScript: enable type checks on release mode
2020-01-08 18:22:38 +01:00
George Marques
d26414f9fe
GDScript: enable type checks on release mode
Also make builtin GDScript functions report return type as Variant in
release so type is converted when needed.
2020-01-08 12:38:18 -03:00
Rémi Verschelde
5e4d465356
Merge pull request #34913 from akien-mga/main-add-export-pack
Export: Add dedicated --export-pack option to export data pack
2020-01-08 15:43:44 +01:00
Rémi Verschelde
7c29ce4375 Export: Add dedicated --export-pack option to export data pack
The previous behavior relying on the provided extension was problematic
on macOS since .zip is the main extension used for the full project
export (binary + data pack).

We add a dedicated `--export-pack` command line option to define when
only the data pack should be exported. Its extension will still be
inferred from the path.

Fixes #23073.
2020-01-08 14:57:46 +01:00
Rémi Verschelde
0749906d8a Gamepad: Fix parsing order for SDL2 controller databases
We were overriding values from `gamecontrollerdb.txt` (current, updated
upstream) with `gamecontrollerdb_205.txt` (legacy, SDL 2.0.5) and then
`gamecontrollerdb_204.txt` (legacy, SDL 2.0.4).

There was a comment to warn about this but it seems it did not prevent
using the wrong order for all this time...

Now `gamecontrollerdb.txt` mappings will properly override outdated
ones present in the `204` and `205` variants.
2020-01-08 12:26:53 +01:00
Rémi Verschelde
7d0342e87d Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@67b49052b4.
2020-01-08 11:45:00 +01:00
Rémi Verschelde
0584c7f094 Gamepad: Parse SDL_GAMECONTROLLERCONFIG env after default mappings
Addresses comment https://github.com/godotengine/godot/issues/21918#issuecomment-458764923.
2020-01-08 11:43:44 +01:00
Rémi Verschelde
5011afcb6a Export: Improve usability of command line interface
I'm barely scratching the surface of the changes needed to make the
--export command line interface easy to use, but this should already
improve things somewhat.

- Streamline `can_export()` templates check in all platforms, checking
  first for the presence of official templates, then of any defined
  custom template, and reporting on the absence of any.
  Shouldn't change the actual return value much which is still true if
  either release or debug is usable - we might want to change that
  eventually and better validate against the requested target.

- Fix discrepancy between platforms using `custom_package/debug` and
  `custom_template/debug` (resp. `release`).
  All now use `custom_template`, which will break compatibility for
  `export_presets.cfg` with earlier projects (but is easy to fix).

- Use `can_export()` when attempting a command line export and report
  the same errors that would be shown in the editor.

- Improve error reporting after a failed export attempt, handling
  missing template and invalid path more gracefully.

- Cleanup of unused stuff in EditorNode around the export workflow.

- Improve --export documentation in --help a bit.

Fixes #16949 (at least many of the misunderstandings listed there).
Fixes #18470.
2020-01-07 14:25:56 +01:00
Rémi Verschelde
a7f49ac9a1 Update copyright statements to 2020
Happy new year to the wonderful Godot community!

We're starting a new decade with a well-established, non-profit, free
and open source game engine, and tons of further improvements in the
pipeline from hundreds of contributors.

Godot will keep getting better, and we're looking forward to all the
games that the community will keep developing and releasing with it.
2020-01-01 11:16:22 +01:00
Rémi Verschelde
c2066fff3d
Merge pull request #34589 from Calinou/improve-cli-export-help
Fix and improve command-line exporting help
2019-12-30 16:33:11 +01:00
Hugo Locurcio
b076b2bdd6
Fix and improve command-line exporting help
It was previously mentioning only one of the two required arguments.
This also mentions that the export path is relative to the project
directory.

This partially addresses #28646.
2019-12-24 22:20:44 +01:00
Haoyu Qiu
078c0d75f2 Cleans up headers included in editor_node.h 2019-12-24 21:46:05 +08:00
Rémi Verschelde
cf3a863fa9
Merge pull request #34229 from NoFr1ends/fix-home-indicator-ios
Allow to change the home indicator behaviour on iOS
2019-12-13 14:00:14 +01:00
Rémi Verschelde
9432520449 Update AUTHORS and DONORS list
New contributors added to AUTHORS:
@allkhor, @Eoin-ONeill-Yokai, @timothyqiu, @madmiraal, @zaksnet

Update sponsors on splash screen.

Thanks to all contributors and donors for making Godot possible!
2019-12-13 13:50:33 +01:00
Jonas Bernemann
4d61118f64 Add project setting to hide home indicator on iOS
On iOS devices without a physical home button iOS
shows a home indicator instead. This is often in the
way of the UI or the game.
Added a project setting to disable hidden home indicator.
The default value is to hide the home indicator
2019-12-13 11:00:18 +01:00