summaryrefslogtreecommitdiffstats
path: root/platform/javascript/engine
Commit message (Collapse)AuthorAgeFilesLines
* [HTML5] Libraries refactor for linting.Fabio Alessandrelli2020-11-214-460/+0
| | | | | | | | | | | | 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.
* Remove empty lines around braces with the formatting scriptAaron Franke2020-11-162-6/+0
|
* [HTML5] AudioWorklet API implementation.Fabio Alessandrelli2020-11-101-0/+2
| | | | | | | | | | | | 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.
* [HTML5] Port JavaScript inline code to libraries.Fabio Alessandrelli2020-11-101-13/+23
| | | | | | | | | 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).
* [HTML5] Close IDBFS database on exit.Fabio Alessandrelli2020-10-141-0/+1
| | | | | | | This should be made available in emscripten in a decent way. Possibly after unmount, to free the database lock and allow performing operations on it from javascript after the Emscripten Runtime has exited.
* [HTML5] Expose request_quit via Engine class.Fabio Alessandrelli2020-10-141-0/+7
| | | | So it can be called when closure compiler is enabled.
* JS synchronous start, better persistent FS sync.Fabio Alessandrelli2020-09-231-6/+14
| | | | | | | | | | | | | | The engine now expects to emscripten FS to be setup and sync-ed before main is called. This is exposed via `Module["initFS"]` which also allows to setup multiple persistence paths (internal use only for now). Additionally, FS syncing is done **once** for every loop if at least one file in a persistent path was open for writing and closed, and if the FS is not syncing already. This should potentially fix issues reported by users where "autosave" would not work on the web (never calling `syncfs` because of too many writes).
* Explicitly add implicitly added semicolons.Marcel Admiraal2020-09-091-4/+4
|
* Fix Closure compiler build, python style.Fabio Alessandrelli2020-05-102-21/+3
| | | | Move copyToFS into utils.js library included with '--pre-js'.
* DisplayServerJavaScript implementation.Fabio Alessandrelli2020-05-101-0/+9
|
* [HTML5] Locale, input fix, context, exit.Fabio Alessandrelli2020-05-102-90/+109
| | | | | | | 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)
* [HTML5] Refactor JS, threads support, closures.Fabio Alessandrelli2020-03-115-0/+428
- 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.