Age | Commit message (Collapse) | Author |
|
Ensure better compatibility when emcc which may run some tools from
different paths (e.g. closure compiler).
This fixes externs include issues with modern emcc using the closure
compiler.
|
|
This makes us more independent from emscripten libraries, giving us more
control on the application lifecycle.
|
|
New `JavaScript.download_buffer` method to create a prompt that let the
user download a file.
|
|
[HTML5] Implement Godot <-> JavaScript interface.
|
|
|
|
Add `WARN_ON_UNDEFINED_SYMBOLS=0` for the main module (which defines
`godot_js_main` as extern coming from the "side" module, i.e. the main
Godot binary).
|
|
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.
|
|
This has some advantages:
- Streaming/chunked response support.
- Broader headers support.
|
|
[HTML5] Document Engine and EngineConfig (jsdoc).
|
|
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.
|
|
This commit also removes the utils.js engine file, moving some of it's
content to config.js and some to engine.js .
|
|
|
|
Side and GDNative libraries are now added by engine.js , the dynlink pre
js had been deleted.
|
|
Simplify helper functions, fix env/sys_env confusion and depends for
externs and pre-js.
|
|
|
|
|
|
This is suboptimal as it requires adding an extra compile flag, but
rewriting how feature tags work is beyond the scope of this work.
|
|
Working with emscripten >= 2.0.10
|
|
Initial work to make liniting easier.
This includes:
- Rename http_request.js to library_godot_http_request.js.
- Rename externs.js to engine.externs.js.
- New library_godot_runtime.js (GodotRuntime) wraps around emscripten
functions.
- Refactor of XMLHttpRequest handler in engine/preloader.js.
- Few fixes to bugs spotted by early stage linting.
|
|
Rewrote AudioDriverJavaScript to support multiple processor nodes.
The old (and deprecated) ScriptProcessorNode when threads are not
available, and the new AudioWorklet API when threads are enabled.
The new implementation uses two ring buffers and a shared state to
communicated with the AudioWorklet thread.
The audio.worklet.js JavaScript file is always added to the export
template, but only really used (and downloaded) in the thread build.
|
|
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).
|
|
A new editor plugin, specific to HTML5, that provide some extra features
needed to make the editor usable on that platform.
For now, it adds a "Download project sources" option in the "Tool" menu,
so the user can download the work done as a zip file (from the browser
storage).
|
|
|
|
This should fix some of the audio stuttering issues when the HTML5
export is compiled with threads support.
The API should be ported to AudioWorklet to (hopefully) be perfect.
That though, cannot be backported to 3.2 due to extra restriction of
AudioWorklet (which only runs in SecureContext, and needs a polyfill for
Safari).
|
|
Using codespell 1.17.1.
Method:
```
$ cat > ../godot-word-whitelist.txt << EOF
ang
curvelinear
dof
doubleclick
fave
findn
leapyear
lod
merchantibility
nd
numer
ois
ony
que
seeked
synching
te
uint
unselect
webp
EOF
$ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"
$ git diff // undo unwanted changes
```
|
|
Move copyToFS into utils.js library included with '--pre-js'.
|
|
|
|
Add missing semicolumns in engine.js
Add optional extra args to JS Engine.startGame
Remove loader.js, explicit noExitRuntime.
Also add onExit callback (undocumented in emscripten)
|
|
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.
|
|
- 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.
|
|
|
|
|
|
Drop logic for non-existent 'profile' target
|
|
|
|
Emscripten's meta DCE changes in 1.37.27(/28?) make it impossible to
keep using --pre-js for this
|
|
|
|
Since WebGL 2.0 is required, requiring WebAssembly support as well has
little impact on compatibility.
|
|
Limitations:
- Subject to same-origin policy
- No persistent connection (but simulated for compatibility)
- No blocking mode
- No StreamPeer access
- No chunked responses
- Cannot disable host verification
|
|
|
|
|
|
- Implement promise-based JS interface for custom HTML page
integration
- Add download progress callback
- Add progress bar and indeterminate spinner to default HTML page
- Try downloading files multiple times when failing
- Get rid of godotfs.js
- Separate steps for engine initialization, game initialization and game
start
- Allow multiple games on one HTML page
- Substitution placeholders only used in .html file
- Placeholders renamed: $GODOT_BASE => $GODOT_BASENAME,
$GODOT_TMEM -> $GODOT_TOTAL_MEMORY
- Emscripten Module is now Engine.RuntimeEnvironment (no longer a global)
|
|
- Key and mouse events are only consumed if canvas is focused
- NOTIFICATION_WM_MOUSE_ENTER, _MOUSE_EXIT, _FOCUS_IN and _FOCUS_OUT are
emitted
|
|
|
|
|
|
|
|
Also fix web builds on Windows and clean up
|
|
Emscripten injects its loader script when linking, so force relinking
whenever the HTML shell changes.
Also remove useless FULL_ES2 flag, which should be a linker flag, but
would impact performance too much.
|
|
Done with `autopep8 --select=E2,W2`, fixes:
- E201 - Remove extraneous whitespace.
- E202 - Remove extraneous whitespace.
- E203 - Remove extraneous whitespace.
- E211 - Remove extraneous whitespace.
- E221 - Fix extraneous whitespace around keywords.
- E222 - Fix extraneous whitespace around keywords.
- E223 - Fix extraneous whitespace around keywords.
- E224 - Remove extraneous whitespace around operator.
- E225 - Fix missing whitespace around operator.
- E226 - Fix missing whitespace around operator.
- E227 - Fix missing whitespace around operator.
- E228 - Fix missing whitespace around operator.
- E231 - Add missing whitespace.
- E231 - Fix various deprecated code (via lib2to3).
- E241 - Fix extraneous whitespace around keywords.
- E242 - Remove extraneous whitespace around operator.
- E251 - Remove whitespace around parameter '=' sign.
- E261 - Fix spacing after comment hash.
- E262 - Fix spacing after comment hash.
- E265 - Format block comments.
- E271 - Fix extraneous whitespace around keywords.
- E272 - Fix extraneous whitespace around keywords.
- E273 - Fix extraneous whitespace around keywords.
- E274 - Fix extraneous whitespace around keywords.
- W291 - Remove trailing whitespace.
- W293 - Remove trailing whitespace.
|
|
Done with `autopep8 --select=E1`, fixes:
- E101 - Reindent all lines.
- E112 - Fix under-indented comments.
- E113 - Fix over-indented comments.
- E115 - Fix under-indented comments.
- E116 - Fix over-indented comments.
- E121 - Fix a badly indented line.
- E122 - Fix a badly indented line.
- E123 - Fix a badly indented line.
- E124 - Fix a badly indented line.
- E125 - Fix indentation undistinguish from the next logical line.
- E126 - Fix a badly indented line.
- E127 - Fix a badly indented line.
- E128 - Fix a badly indented line.
- E129 - Fix a badly indented line.
|
|
WebAssembly is still experimental, so disabled by default.
The HTML shell file now uses $GODOT_BASE, a placeholder for the
base filename, instead of $GODOT_JS, $GODOT_MEM and $GODOT_FS.
|