Commit graph

2921 commits

Author SHA1 Message Date
Fredia Huya-Kouadio 64f5a7b8ca Expose GodotPlugin's utility methods used for registration and signal emitting.
This enables creation and use of a plugin like class by composition rather than inheritance.
2021-02-15 15:57:36 -08:00
Rémi Verschelde 40c30adf04
Merge pull request #46034 from bruvzg/ignore_warp_on_mode_change_3
[macOS, 3.2] Ignore mouse move event caused by mouse mode switch.
2021-02-15 11:09:28 +01:00
bruvzg bc04bbbe2a
[macOS] Ignore mouse move event caused by mouse mode switch. 2021-02-15 00:19:47 +02:00
Fabio Alessandrelli b3f78687de [HTML5] Detect screen scale and DPI.
`OS.get_screen_scale` will now return the `window.devicePixelRatio`
value, `OS.get_screen_dpi` uses CSS media queries to find approximate
DPI value for the current display.
`OS.get_screen_size` also return the actual screen size (not the CSS
pixel size).
2021-02-12 12:02:30 +01:00
Rémi Verschelde b2f925ea42
Merge pull request #45889 from Faless/js/3.x_xhr_fix
[3.2] [HTML5] Fix HTTPClient request_raw.
2021-02-11 11:08:14 +01:00
Rémi Verschelde 6f26df58a8
Merge pull request #45884 from Faless/js/3.x_more_handlers
[3.2] [HTML5] Handle contextmenu, webglcontextlost internally.
2021-02-11 10:53:41 +01:00
Fabio Alessandrelli 4086a123b9 [HTML5] Fix HTTPClient request_raw.
Now send data according to the spec, properly handle null data.
Simplify JS code since we are at it.
2021-02-11 09:32:17 +01:00
Fabio Alessandrelli 8c9a503bde [HTML5] Handle contextmenu, webglcontextlost internally.
This way they are automatically cleaned up when the engine exits,
landing a hand to browsers garbage collectors.
2021-02-11 08:00:53 +01:00
Rémi Verschelde 5bec2cf3d4
Merge pull request #45772 from CherokeeLanguage/3.2
[3.2] Fix issue with NVIDIA and axis mapping for joysticks.
2021-02-10 17:04:05 +01:00
Michael Conrad 8777282c40 Fix joystick axis mapping issues with NVIDIA shield. Probably others.
Issues addressed:

a) Axis mappings were including virtual mouse axes on NVIDIA Shield TV.

The virtual mouse axes have the same axis numbers as the normal analog stick numbers. This was completely breaking joypad support on NVIDIA Shield TV.

b) Joypads were being tracked in a List with the index in the list being treated as the Godot device id.

If a device were to be removed, any device later in the list would be shifted, potentially causing future events with the shifted joypads to have incorrect IDs according to the Godot engine.

c) Unnecessary events were being sent to the Godot engine.

A check was added (per Joystick) that will prevent sending events for all axes when only a single axis value changed.
A similar check was added for "HATs".

See #45712
2021-02-09 08:33:42 -05:00
Bastiaan Olij 6afb9d327e
Use /Zi and /FS for including debugger symbols on Windows with MSVC
(cherry picked from commit 4946ae16fc)
2021-02-08 22:36:37 +01:00
Rémi Verschelde 42d3d9c345
SCons: Fix debug_symbols tests after switch to BoolVariable
Bug introduced in #45679.

Fixes part of #45816.

(cherry picked from commit 849c090343)

Also removes useless `debug_symbols=full` mode.
2021-02-08 22:36:32 +01:00
Marcel Admiraal 4e833b2e28 Fix used uninitialized warning in os_x11.cpp 2021-02-06 10:43:02 +00:00
Fredia Huya-Kouadio 5886d09521 Improve the logic to compile for Android by automatically detecting and setting up the Android NDK if needed.
(cherry picked from commit eee213e01a)
2021-02-05 13:29:02 +01:00
Sergey Minakov 518ba25fae [iOS] Remove remote notifications code
Using any remote notification method (even indirectly) causes App Store to trigger APNS warning email.

(cherry picked from commit 4fda1ae6b8)
2021-02-05 09:26:09 +01:00
Rémi Verschelde f3c030aa47 SCons: Add production=yes option to use production defaults
This is meant for users making custom builds to match the options used on
optimized, official builds.

This enables, on the platforms which support them:
- `use_static_cpp=yes` (portable binaries for Linux and Windows)
- `use_lto=yes` (link time optimizations - note: requires a lot of RAM!)
- `debug_symbols=no` (no debug symbols, smaller binaries)

Also abort when using MSVC with `production=yes`, as:
- It cannot optimize the GDScript VM like GCC or Clang do, leading to
  significant performance drops.
- Its LTO support is unreliable, at least used to trigger crashes last
  we tried it extensively.

All options can still be overridden if specified, and the `dev=yes` option
was changed to also support overrides.

(cherry picked from commit db26871210)
2021-02-05 09:26:09 +01:00
Rémi Verschelde f9bf6fc3f3
Merge pull request #45706 from Faless/js/3.x_editor_preload
[3.2] [HTML5] Better editor persistent folders, automatically open zip import popup
2021-02-04 14:54:04 +01:00
Rémi Verschelde cdb5ac52f5
Merge pull request #45685 from naithar/feature/extend-plugin-params
[3.2] [iOS] Additional 'linker_flags' plugin parameter
2021-02-03 18:37:47 +01:00
Rémi Verschelde 92859d7b2b
Merge pull request #45693 from naithar/feature/ios-loading_screen-3.2
[3.2] [iOS] Native loading screen implementation
2021-02-03 18:37:06 +01:00
Sergey Minakov fdec8d726d iOS: Use storyboard as loading screen
If 'Launch Screen' storyboard is present it will be used as loading screen.
2021-02-03 20:01:05 +03:00
Fabio Alessandrelli 2668ca7a8c [HTML5] Make home path persistent in editor.
We used to only persist specific sub-folder of /home/web_user/ when
running the Web Editor. This resulted in bad UX about default project
creation path etc.
This PR makes the whole folder persistent, move the zip preloading to a
different folder (to avoid persisting it), and automatically prompt the
user to import it if present.
2021-02-03 17:18:28 +01:00
Sergey Minakov 309835b917 [iOS] Additional 'linker_flags' plugin parameter 2021-02-03 18:22:17 +03:00
Samuele Zolfanelli 36635c8357 Added atom checks to x11 XChangeProperty and XGetWindowProperty 2021-02-03 16:08:37 +01:00
Fabio Alessandrelli 08efe327b6 [HTML5] Fix mouse_mode and fullscreen detection.
The canvas_id is `#`-prefixed to work with emscripten as a CSS selector.
When comparing to an event target ID (e.g. when checking if the canvas
is fullscreen, or is locking the mouse) we need to skip the first char
(the hash).
2021-02-02 20:03:39 +01:00
Rémi Verschelde 3115ac4b60
Merge pull request #45663 from akien-mga/3.2-cherrypicks
Cherry-picks for the 3.2 branch (future 3.2.4) - 19th batch
2021-02-02 19:19:31 +01:00
Rémi Verschelde 5506143522
Linux: Enable udev support by default
This has been enabled for years in official binaries, and users making custom builds
may end up not enabling it unknowingly, so it's best if we default to the same as
what official builds do.

The original reason for having it opt-in was likely the addition of a dependency on
libudev, but that should be fairly ubiquitous by now.

(cherry picked from commit e8b69fccbe)
2021-02-02 13:30:54 +01:00
Rémi Verschelde 43ab32ae7e
Linux: Build with use_static_cpp=yes by default for x86_64
This enables `-static-libgcc -static-libstdc++` which help make custom Linux
builds more portable (official builds have been using this option for years).

For some obscure reason Ubuntu 18.04 i386 crashes when using the option for
i386 builds, so let's play it safe and enable for x86_64 only for now.

(cherry picked from commit 1ebd66daff)
2021-02-02 13:30:54 +01:00
zaevi 56535539d4
add search extensions for scons' path
(cherry picked from commit befbfecd4d)
2021-02-02 13:02:47 +01:00
Jari Ronkainen 299769a99a
Go through all event devices, not just event[0-32]
There are no guarantees that joypads are in event0-event32
range.  Some devices, such as laptops with detachable keyboards
and wacom can reserve events all the way up to 32.

Some udev rules with e.g. custom controller firmwares may
load the device as /dev/input/eventX, where X is greater than
32.

This patch uses POSIX dirent to enumerate the event devices, so
entries outside 0-32 range are not skipped.

(cherry picked from commit 01c030f9b7)
2021-02-02 13:02:45 +01:00
Sergey Minakov 19d240c8a7 [iOS] Initialize plugins earlier
Initialize iOS plugins before 'Main::setup' call to have access to them in script's '_init' function.
2021-02-01 15:28:14 +03:00
Marcel Admiraal 4616d843ba Don't handle BaseException in JavaScript build script 2021-01-28 19:43:08 +00:00
Rémi Verschelde c2ea80348c
Revert "[3.2] Add separate simulator flag for iOS build, change main library to xcframework." 2021-01-27 21:53:16 +01:00
Sergey Minakov d2af815039
[iOS] Rework push notification methods usage
Moved AppDelegate push notifications methods implementation to 'GODOT_ENABLE_PUSH_NOTIFICATIONS'
which can be used in plugins to implement APNS plugins.

(cherry picked from commit 366ce084f4)
2021-01-26 22:11:10 +01:00
Sergey Minakov 7c076fbd0b
[iOS] Fix embedding of plugin libraries
(cherry picked from commit 6d67827f4e)
2021-01-26 17:00:15 +01:00
Sergey Minakov 7689f05786
[iOS] Added support for '.xcframework' in plugins
(cherry picked from commit 01d513f3ca)
2021-01-26 17:00:15 +01:00
Rémi Verschelde c5a22d7284
Merge pull request #45480 from bruvzg/ios_arm64_sim_3
[3.2] Add separate `simulator` flag for iOS build, change main library to `xcframework`.
2021-01-26 15:20:27 +01:00
Rémi Verschelde 061f87e064
Merge pull request #45336 from naithar/feature/plugins-migration-3.2
[3.2] [iOS] iOS Plugins Migration
2021-01-26 15:06:46 +01:00
bruvzg 389a4bfa59
[3.2] Add separate simulator flag for iOS build, change main library to xcframework format. 2021-01-26 16:00:26 +02:00
Fabio Alessandrelli f8d7067bf7 [HTML5] Builtin HTTP server disable browsers cache
We don't want browsers to cache our temporary exports (since they will
always differ).
2021-01-25 20:16:44 +01:00
Fabio Alessandrelli 276b831c45 [HTML5] Better editor HTML, small refactor.
Side and GDNative libraries are now added by engine.js , the dynlink pre
js had been deleted.
2021-01-25 20:16:44 +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
Sergey Minakov d4096285b6 [iOS] Remove plugins from modules. 2021-01-17 14:46:03 +03:00
Rémi Verschelde 7e207cfd48
i18n: Sync translations with Weblate 2021-01-15 16:49:47 +01:00
Rémi Verschelde c47ad12e80
Merge pull request #43557 from naithar/feature/pluggable_app_delegates_3.2
[3.2] [iOS] Pluggable application delegate
2021-01-15 16:14:21 +01:00
Sergey Minakov 64923945b3 [Plugins] Rename 'PluginConfig' struct to platform specific name 2021-01-15 02:12:53 +03:00
Sergey Minakov cb15abda29 iOS Export: support multi-target plugin
Plugins can use 'binary_name.a' or 'binary_name.release.a' and 'binary_name.debug.a' for plugin library.
2021-01-14 15:38:16 +03:00
Sergey Minakov d5047603a3 iOS Export: export modification to support plugins
Added plugin configuration.
Export options now use plugins that could be enabled/disabled.
Plugin changes are observed at runtime.
2021-01-14 15:38:05 +03:00
Sergey Minakov 03cf3d5d4b iOS: change platform code to support plugins 2021-01-14 15:30:09 +03:00
Sergey Minakov 614f701373 iOS Modules: separate main platform code from modules
Moved previously builtin modules 'GameCenter', 'AppStore', 'iCloud' to separate modules to be represented as plugin.
Modified 'ARKit' and 'Camera' to not be builtin into engine and work as plugin.
Changed platform code so it's not affected by the move.
Modified Xcode project file to remove parameters that doesn't make any effect.
Added basic '.gdip' plugin config file.
2021-01-14 15:30:00 +03: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