`WebAssembly.instantiateStreaming` requires the mime-type to be
`application/wasm`, but some servers (including most debug servers) do
not provide the content-type header.
This commit forces it via JavaScript, by creating a `Response` object
with the `wasm` content, and explicitly defined `content-type` header.
(cherry picked from commit 778ef4e217)
Exposes AddressSanitizer support in MSVC compiler. Can be installed via individual
components in the Visual Studio 2019 Installer.
Disabled by default. Compile the engine with `scons use_asan=yes`.
(cherry picked from commit 53901d870b)
With a very nice hack, a new hidden configuration option that delays
dropped files removal at exit.
This still leaks while the project manager is running, but will clear
memory as soon as it exits or load something.
(reminder, dropped files are reguarly removed after the signal is
emitted specifically to avoid leaks, but I prefer hacking the HTML5
config then the project manager).
(cherry picked from commit f1e810adcb)
It used to be updated before the first iteration, causing the
window/viewport size values to be incorrect during the initialization
phase (e.g. during the first `_ready` notification).
(cherry picked from commit 3f059b90d6)
Added as an export option "Experimental Virtual Keyboard".
There is no zoom, so text/line edit must be in the top part of the
screen, or it will get hidden by the virtual keyboard.
UTF8/Latin-1 only (I think regular UTF-8 should work out of the box in
4.0 but I can't test it).
It uses an hidden textarea or input, based on the multiline variable,
and only gets activated if the device has a touchscreen.
This could cause problems on devices with both touchscreen and a real
keyboard (although input should still work in general with some minor
focus issues). I'm thinking of a system to detect the first physical
keystroke and disable it in case, but it might do more harm then good,
so it must be well thought.
This allows to install it as an app, and provide offline support (after
the first run).
Practically, this boils down to adding a JSON file as a manifest, an
offline page to be displayed when the cached files are not avaialble,
and a JS file to cache resources and return them.
The reason for the "first run requirements" is that some browsers, will
emit an "install" by just visiting the page (to see if the JS code is
compatibile), and we do not want to force casual visitors to just
download the 10 MiB+ compressed editor WebAssembly file without pressing
the start button.
Special thanks to Hugo Locurcio (Calinou) for the initial work.
To avoid trying to do PRIME detection on fake `libGL.so` as used by e.g.
Renderdoc or Primus, we skip detection if there's a `libGL.so` in
`LD_LIBRARY_PATH`... and our luck is that Steam defines it and includes
system paths too, thus the actual system `libGL`... 🤦
So if we detect Steam, we skip this check.
Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
(cherry picked from commit 562b1cd2cda2098e62c7501dae87393def99c23a)
This allow the loading bar to be much more reliable, even in cases where
realible stream loading status is not detectable (server-side
compression, chunked encoding).
The problem happened on methods `get_screen_position`, `get_screen_size`
and `set_current_screen` when they were passed a negative screen value.
Fixes:
- #46184
- #46185
- #46186
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.
(cherry picked from commit 472482013e)
This commit also removes the utils.js engine file, moving some of it's
content to config.js and some to engine.js .
(cherry picked from commit 018ee5a4dc)
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.
(cherry picked from commit 4404eb57e4)
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.
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
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.
This helps resolve issues where the project ndk version differs from the one pointed by the `ANDROID_NDK_ROOT` environment variable (if it exists).
(cherry picked from commit edeca16fb6)