summaryrefslogtreecommitdiffstats
path: root/platform/javascript/native
Commit message (Collapse)AuthorAgeFilesLines
* [HTML5] Libraries refactor for linting.Fabio Alessandrelli2020-11-217-1596/+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.
* Add missing javascript semi-colons.Marcel Admiraal2020-11-171-2/+2
|
* Remove empty lines around braces with the formatting scriptAaron Franke2020-11-167-12/+0
|
* [HTML5] AudioWorklet API implementation.Fabio Alessandrelli2020-11-102-94/+449
| | | | | | | | | | | | 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-106-353/+932
| | | | | | | | | 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] Fix audio buffer size and latency hint.Fabio Alessandrelli2020-11-061-1/+1
| | | | | | | | | | The size of the audio buffer was incorrectly doubled when creating the script processor. latencyHint is expressed in seconds, not milliseconds. Additionally, on some browsers it actually affect the performance and stability of the audio driver. For this reason it has been completely disabled (interactive) and a not has been left for future reference.
* [HTML5] Close IDBFS database on exit.Fabio Alessandrelli2020-10-141-3/+18
| | | | | | | 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] Run Audio process in thread when availableFabio Alessandrelli2020-10-021-0/+173
| | | | | | | | | 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).
* JS synchronous start, better persistent FS sync.Fabio Alessandrelli2020-09-231-1/+33
| | | | | | | | | | | | | | 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).
* Small refactor to JavaScript handlers.Fabio Alessandrelli2020-09-231-0/+41
| | | | | Crated helper class in native/utils.js. Simplify code in OS/DisplayServer.
* Add drop files functionFabio Alessandrelli2020-05-101-0/+156
|
* Fix Closure compiler build, python style.Fabio Alessandrelli2020-05-103-0/+257
Move copyToFS into utils.js library included with '--pre-js'.