Commit graph

3267 commits

Author SHA1 Message Date
Rémi Verschelde 0e8fae1038
Merge pull request #46457 from m4gr3d/fix_invalid_missing_templates_error_master
Fix invalid missing template error when the Android build template is not installed
2021-02-27 16:52:25 +01:00
Fredia Huya-Kouadio 6f0ca6c9f7 Fix invalid missing template error when the Android build template is not installed. 2021-02-26 12:31:12 -08:00
Fredia Huya-Kouadio 6fd881e43c Update the logic to load Godot Android plugins packaged into the binary.
The previous logic had the side effect of imposing a limit of one plugin per `aar` binary. The update lifts that restriction.
2021-02-26 08:38:39 -08:00
Rémi Verschelde 75d03f1fbd
Merge pull request #46446 from Faless/js/4.x_jsdoc
[HTML5] Document Engine and EngineConfig (jsdoc).
2021-02-26 15:31:44 +01:00
Fabio Alessandrelli 4404eb57e4 [HTML5] Make editor HTML build tag scons4-proof.
We used to have it like `$GODOT_VERSION` which caused inconsistencies
between different scons versions when substituting it.
It's now `@GODOT_VERSION@`, which is safe on both scons3 and scons4.
2021-02-26 15:08:47 +01:00
Fabio Alessandrelli 472482013e [HTML5] Add jsdoc2rst tool.
A template for `jsdoc` that generat the HTML5 public classref.

The script can be run via `npm run docs` to print to stdout.

You can dry run via `npm run docs -- --d dry-run` or write to file via
`npm run docs -- -d /path/to/file.rst`

Also update Makefile in `doc/` and add dry run test to CI.
2021-02-26 11:33:59 +01:00
Fabio Alessandrelli 018ee5a4dc [HTML5] Document Engine and EngineConfig (jsdoc).
This commit also removes the utils.js engine file, moving some of it's
content to config.js and some to engine.js .
2021-02-26 11:33:59 +01:00
Rémi Verschelde 2032960a09
Merge pull request #46403 from m4gr3d/fix_android_resources_inclusion_master
Update the filtering logic to properly handle directories with `.gdignore` files
2021-02-25 14:14:47 +01:00
Rémi Verschelde 2adacd751c
Merge pull request #46402 from nekomatata/natvis-local-vector
Added LocalVector to Visual Studio debugger visualization
2021-02-25 07:22:08 +01:00
Fredia Huya-Kouadio eda18fcc1f Update the filtering logic to properly handle directories with .gdignore files. 2021-02-24 18:40:36 -08:00
PouleyKetchoupp 27d5e1fff0 Added LocalVector to Visual Studio debugger visualization 2021-02-24 18:35:39 -07:00
Rémi Verschelde 7f8bfd6ed1
Merge pull request #46381 from m4gr3d/update_godot_fragment_lifecycle_master
Update the initialization timeline for the Godot fragment
2021-02-24 16:14:16 +01:00
Fredia Huya-Kouadio 3ce7678374 Update the initialization timeline for the Godot fragment to be more consistent with the previous activity based timeline. 2021-02-24 06:16:07 -08:00
Fredia Huya-Kouadio bc5120eb97 Add logic to record the version of the Godot engine for the Android platform. 2021-02-24 04:23:46 -08:00
Hein-Pieter van Braam-Stewart 0dc368f9f9 Allow static linking with libatomic using clang
When using use_static_cpp we want to statically link with atomic as well
to make sure we don't incur any new runtime dependencies.

Scons doesn't quite support this so we do this little trick.
2021-02-23 14:51:44 +01:00
Hein-Pieter van Braam-Stewart 6a146d405c Use -latomic when using clang (server platform)
version of c9b3a00a63 for the server
platform
2021-02-22 17:09:30 +01:00
Hein-Pieter van Braam d4d7535524
Merge pull request #46256 from hpvb/dri-prime-amd-master
Add 'AMD' GPU vendor name to PRIME detector
2021-02-20 17:18:46 +01:00
Hein-Pieter van Braam-Stewart e6a5899646 Add 'AMD' GPU vendor name to PRIME detector
Apparently some recent Mesa version also changed AMD's vendor string. In
addition I found a small uninitialized variable that's corrected now.
2021-02-20 16:49:06 +01:00
Hein-Pieter van Braam-Stewart c9b3a00a63 Use -latomic when linking whe using clang on Linux
According to the LLVM documentation when using GNU's libstdc++ clang
will not automatically link with -latomic. This is necessary since we
merged c++11 atomics support.

This fixes linking using Clang on Linux
2021-02-20 16:40:55 +01:00
Hein-Pieter van Braam-Stewart 5233d78f49 An update to the dylibloader for older inttypes
This #define's older inttypes to their newer versions and #includes
<stdint.h> in the generated files. This will help with older
glibc/compiler versions using headers generated on newer systems.

This closes #46223
2021-02-20 01:24:30 +01:00
Rémi Verschelde 480c5f28ab
Merge pull request #46200 from Faless/js/4.x_canvas_size_pr
[HTML5] Easier HTML templates, better canvas size handling
2021-02-19 15:16:23 +01:00
Fabio Alessandrelli 65abf94675 [HTML5] Better fullscreen, canvas resizing.
Three canvas resize policies:
- `None`: Godot window settings are ignored.
- `Project`: Godot handles the canvas like a native app (resizing it
  when setting the window size).
- `Adaptive`: Canvas size will always adapt to browser window size.

Use `None` if you want to control the canvas size with custom JavaScript
code.
2021-02-19 05:12:32 +01:00
Fabio Alessandrelli 2972ea3229 [HTML5] Easier HTML templates, better deinit/cleanup. 2021-02-19 05:12:32 +01:00
Rémi Verschelde 247b7e2448
Merge pull request #46131 from bruvzg/move_tablet_to_ds
Move tablet driver API from OS to DisplayServer
2021-02-18 20:36:46 +01:00
Rémi Verschelde 310496a89f
Merge pull request #45617 from RandomShaper/modernize_atomics
Modernize atomics (and fix `volatile`)
2021-02-18 19:40:31 +01:00
Pedro J. Estébanez 8e128726f0 Modernize atomics
- Based on C++11's `atomic`
- Reworked `SafeRefCount` (based on the rewrite by @hpvb)
- Replaced free atomic functions by the new `SafeNumeric<T>`
- Replaced wrong cases of `volatile bool` by the new `SafeFlag`
- Platform-specific implementations no longer needed

Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
2021-02-18 17:12:46 +01:00
bruvzg 3e0262509f
Move tablet driver API from OS to DisplayServer. 2021-02-18 17:12:24 +02:00
reduz 64140eaf42 Reorganize Project Settings
-Advanced Settings toggle also hides advanced properties when disabled
-Simplified Advanced Bar (errors were just plain redundant)
-Reorganized rendering quality settings.
-Reorganized miscelaneous settings for clean up.
2021-02-18 11:23:34 -03:00
Fredia Huya-Kouadio 526b99ee36 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:20:49 -08:00
Rémi Verschelde 8870f43d74
Merge pull request #46161 from akien-mga/linux-joypads-udev-fallback
Linux: Fix fallback logic when udev fails creating a context
2021-02-18 11:30:12 +01:00
Rémi Verschelde e26a1f807b
Linux: Fix fallback logic when udev fails creating a context
Thanks to Noshyaar for pointing out the bug.
2021-02-18 10:28:37 +01:00
Fredia Huya-Kouadio edeca16fb6 Override ANDROID_NDK_ROOT based on the project ndk version.
This helps resolve issues where the project ndk version differs from the one pointed by the `ANDROID_NDK_ROOT` environment variable (if it exists).
2021-02-17 19:11:05 -08:00
Fredia Huya-Kouadio 9418197081 Add missing ndkVersion to the library gradle build config. 2021-02-17 16:31:31 -08:00
Fredia Huya-Kouadio e5311f3523 Revert AGP to version 4.0.1 as a workaround to https://issuetracker.google.com/issues/171235570 in version 4.1.x 2021-02-17 15:39:53 -08:00
Rémi Verschelde 327ac7c375
Merge pull request #46143 from hpvb/dont-clobber-symbols
Don't clobber original library symbols
2021-02-18 00:38:48 +01:00
Rémi Verschelde c730da8b20
Android: Bump NDK version to 21.4.7075529
This is what GitHub Actions now provide and they removed the previous 21.3.6528147.
A bit annoying to have our hand forced this way but it's still 21.x so should be good
to upgrade.
2021-02-18 00:28:51 +01:00
Hein-Pieter van Braam-Stewart 8d36b17343 Don't clobber original library symbols
It appears that we can get a fun circle dependency on a shared object on
some system configurations causing issues with our 'fake' function
pointer names. This can lead to a crash.

The new wrapper generator renames all the symbols so this can't happen
anymore. See https://github.com/hpvb/dynload-wrapper/commit/704135e

This closes #46140
2021-02-18 00:21:10 +01:00
Fredia Huya-Kouadio 9714abf8cb Add verbose logging to help with troubleshooting the Android build/export process. 2021-02-17 13:18:41 -08:00
Rémi Verschelde ab4f5c0668
Merge pull request #46117 from akien-mga/dynamic-load-libudev
Dynamically load libudev.so.1 on Linux
2021-02-17 13:40:15 +01:00
Rémi Verschelde a10c259c1d
Dynamically load libudev.so.1 on Linux if udev=yes
This makes it possibly to run Linux binaries compiled with udev support on
Linux systems which do not provide udev (typically systemd-less distros).

If udev is missing, we fall back to parsing `/dev/input` like when compiled
without udev support (`udev=no`).

Also adding some verbose debug statements to know which method we're using
when debugging Linux joypad issues.

The libudev so wrappers were generated on Mageia 8 with libudev 246.9 using
https://github.com/hpvb/dynload-wrapper:
```
./generate-wrapper.py --include /usr/include/libudev.h --sys-include '<libudev.h>' \
  --soname libudev.so.1 --init-name libudev --omit-prefix gnu_ \
  --output-header libudev-so_wrap.h --output-implementation libudev-so_wrap.c
```
2021-02-17 13:14:59 +01:00
Fabio Alessandrelli 26ec6ca576 [HTML5] Implement get_processor_count. 2021-02-17 13:03:52 +01:00
Fabio Alessandrelli 1446cfd13d [HTML5] Fix compilation issues in 4.0
More memory is needed, and a Workaround to avoid undefined symbol due to
dead code elimination.
2021-02-17 13:03:52 +01:00
Fabio Alessandrelli a3c52b62db
Merge pull request #46087 from Quadtree/add_cwrap_to_runtime_methods
Add cwrap to EXTRA_EXPORTED_RUNTIME_METHODS
2021-02-17 12:30:40 +01:00
Hein-Pieter van Braam-Stewart 09f82fa6ea Dynamically load libpulse.so.0 and libasound.so.1 on Linux
By generating stubs using https://github.com/hpvb/dynload-wrapper we
can dynamically load libpulse and libasound on systems where it is available.
Both are still a build-time requirement but no longer a run-time dependency.

For maintenance purposes the wrappers should not need to be re-generated
unless we want to bump pulse or asound to an incompatible version. It is
unlikely we will want to do this any time soon.

This closes #20978
2021-02-16 20:31:49 +01:00
Quadtree d2c34e83b5 Add cwrap to EXTRA_EXPORTED_RUNTIME_METHODS 2021-02-16 01:04:44 -08:00
Fredia Huya-Kouadio fe9f0758db 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:55:59 -08:00
bruvzg d756f6a294
[macOS] Ignore mouse move event caused by mouse mode switch. 2021-02-15 00:20:50 +02:00
Fabio Alessandrelli 6cff589b5b [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:01:44 +01:00
Rémi Verschelde ab4c3ddf32
Merge pull request #45888 from Faless/js/4.x_xhr_fix
[HTML5] Fix HTTPClient request_raw.
2021-02-11 11:08:08 +01:00
Fabio Alessandrelli 75c4e2c5fa [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 10:03:36 +01:00