Commit graph

11 commits

Author SHA1 Message Date
Rémi Verschelde 16f49d4b29
HTML5: Handle GODOT_VERSION_STATUS env var in @GODOT_VERSION@
Follow-up to #51002.
2021-08-19 15:01:30 +02:00
Fabio Alessandrelli 88c060b00d [HTML5] Export as Progressive Web App.
Adds possibility to export as a progressive web app.
Allows customizing base icons, display mode, orientation and offline
page.
2021-04-27 14:44:31 +02:00
Fabio Alessandrelli 60f2166c27 [HTML5] Fix editor version numbering.
Should not write patch version when it's `0`.
2021-03-20 14:35:28 +01:00
Fabio Alessandrelli d8bd54fbf2 [HTML5] Add PWA support to the editor page.
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.
2021-03-08 17:06:24 +01:00
Fabio Alessandrelli 4e09453407 [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:15:57 +01:00
Fabio Alessandrelli c327f42b0a [HTML5] Reorganize build script.
Simplify helper functions, fix env/sys_env confusion and depends for
externs and pre-js.
2021-01-10 12:24:40 +01:00
David Snopek a54a2d65e1 Add support for WebXR 2021-01-04 17:02:37 -06:00
Fabio Alessandrelli e2083871eb [HTML5] Port JavaScript inline code to libraries.
The API is implemented in javascript, and generates C functions that can
be called from godot.
This allows much cleaner code replacing all `EM_ASM` calls in our C++
code with plain C function calls.
This also gets rid of few hacks and comes with few optimizations (e.g.
custom cursor shapes should be much faster now).
2020-11-10 11:42:51 +01:00
Fabio Alessandrelli 7998745237 [HTML5] Scons now expects "emcc" to be in PATH.
No longer parse emscripten/emsdk config to detect emcc/node paths.
Use WhereIs to find "emcc" and "node", look for "node_modules" in "emcc"
path.
2020-10-04 14:26:44 +02:00
Rémi Verschelde cd4e46ee65 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.
2020-03-30 09:05:53 +02:00
Fabio Alessandrelli 919bbf8077 [HTML5] Refactor JS, threads support, closures.
- Refactored the Engine code, splitted across files.
- Use MODULARIZE option to build emscripten code into it's own closure.
- Enable lto support (saves ~2MiB in release).
- Enable optional closure compiler pass for JS and generated code.
- Enable optional pthreads support.
- Can now build with tools=yes (not much to see yet).
- Dropped some deprecated code for older toolchains.
2020-03-11 16:09:31 +01:00