summaryrefslogtreecommitdiffstats
path: root/platform/javascript
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #44514 from madmiraal/split-os-executeRémi Verschelde2021-01-122-3/+8
|\ | | | | Split OS::execute into two methods
| * Split OS::execute into two methodsMarcel Admiraal2021-01-092-3/+8
| | | | | | | | | | 1. execute(): Executes a command and returns the results. 2. create_process(): Creates a new process and returns the new process' id.
* | [HTML5] Reorganize build script.Fabio Alessandrelli2021-01-103-17/+11
| | | | | | | | | | Simplify helper functions, fix env/sys_env confusion and depends for externs and pre-js.
* | Fix JavaScript platform after MainLoop methods rename.Fabio Alessandrelli2021-01-102-3/+3
|/
* Merge pull request #44154 from dsnopek/webxr-masterRémi Verschelde2021-01-054-1/+28
|\ | | | | Add WebXR support (for Godot 4.0)
| * Add support for WebXRDavid Snopek2021-01-044-1/+28
| |
* | Update copyright statements to 2021Rémi Verschelde2021-01-0131-62/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* | Fix missed renamings from empty() to is_empty()Rémi Verschelde2020-12-293-7/+7
| | | | | | | | Those were missed in #44401 or added by later PRs.
* | Rename empty() to is_empty()Marcel Admiraal2020-12-281-6/+6
| |
* | Make tool menu plugins use Callables for callbackkobewi2020-12-162-10/+1
|/
* Merge pull request #44315 from madmiraal/fix-handles-baseexceptionRémi Verschelde2020-12-121-3/+1
|\ | | | | Don't handle BaseException in build scripts
| * Don't handle BaseException in build scriptsMarcel Admiraal2020-12-121-3/+1
| |
* | HTML5: Code style cleanup for export codeRémi Verschelde2020-12-102-20/+13
|/
* [HTML5] Fix errors when Mic is not allowed.Fabio Alessandrelli2020-12-093-12/+20
|
* [HTML5] Improve platform buildsystem.Fabio Alessandrelli2020-12-091-7/+48
| | | | | Check emcc version requirements when building GDNative. Add more build options (sanitizers, initial memory).
* [HTML5] Add logo and favicon to editor html.Fabio Alessandrelli2020-12-091-0/+6
|
* Merge pull request #44161 from Faless/fix/fa_buffered_removeRémi Verschelde2020-12-091-2/+0
|\ | | | | Remove unused FileAccessBuffered
| * Remove now unused FileAccessBuffered.Fabio Alessandrelli2020-12-061-1/+0
| |
| * [HTML5] Use regular unix FileAccess implementation.Fabio Alessandrelli2020-12-061-1/+0
| |
* | [HTML5] Make GDNative support feature-based.Fabio Alessandrelli2020-12-053-2/+21
| | | | | | | | | | This is suboptimal as it requires adding an extra compile flag, but rewriting how feature tags work is beyond the scope of this work.
* | [HTML5] Allow selecting the export type.Fabio Alessandrelli2020-12-051-8/+32
| | | | | | | | | | | | | | Available types: - Regular - GDNative (support dynamic linking and thus GDNative WASM files) - Threads (uses WebAssembly Threads)
* | [HTML5] EditorRunNative works with GDNative.Fabio Alessandrelli2020-12-055-16/+62
| | | | | | | | | | | | This "breaks" our loading bar logic (libraries are not counted). Fixing it is non trivial and probably deserves investigating a different strategy.
* | [HTML5] GDNative support via SIDE_MODULE.Fabio Alessandrelli2020-12-057-28/+104
| | | | | | | | Working with emscripten >= 2.0.10
* | [HTML5] Add function signatures to JS libraries.Fabio Alessandrelli2020-12-048-2/+59
|/
* [HTML5] Fix broken layout on load in HiDPI screensFabio Alessandrelli2020-11-301-2/+2
| | | | | | | | | | | | | This was caused by the devicePixelRatio being applied twice, once by the HTML code, once by the OS code. More specifically, OS.get_window_size() would return the canvas element size, while OS.set_window_size() would set the element size to the specified value times the devicePixelRatio. Calling OS.set_window_size(OS.get_window_size()) would reapply the devicePixelRatio every time. This commit changes the behaviour so that OS.set_window_size() do not apply the devicePixelRatio to the canvas element size, by it divides the CSS size instead.
* [HTML5] Remove file flags from writeFile in setup.Fabio Alessandrelli2020-11-301-1/+1
| | | | Flags where deprecated and partly in removed in emscripten 2.0.9.
* [Complex Text Layouts] Add third-party TextServer dependencies (ICU, ↵bruvzg2020-11-261-0/+2
| | | | HarfBuzz, Graphite).
* [HTML5] Run eslint --fix.Fabio Alessandrelli2020-11-2311-384/+392
| | | | Should I write a poem about this whole new world? ;)
* [HTML5] Enforce JavaScript style with eslint.Fabio Alessandrelli2020-11-235-0/+1704
| | | | | | | | Applies to javascript files inside the platform library folder, the exposed Engine code, and any javascript files in modules. Files ending with ".externs.js" will be ignored, you can create a ".eslintignore" file to specify extra files to be ignored.
* [HTML5] Libraries refactor for linting.Fabio Alessandrelli2020-11-2114-312/+413
| | | | | | | | | | | | 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.
* Export: Reorder options for consistency across platformsRémi Verschelde2020-11-201-2/+4
|
* SCons: Remove unnecessary $LINK overridesRémi Verschelde2020-11-191-1/+0
| | | | | | | | | | As of SCons 4.0.1, the default value for $LINK is $SMARTLINK, which itself is a function that will use $CXX as linker for C++: https://github.com/SCons/scons/blob/4.0.1/SCons/Tool/link.py#L327-L328 https://github.com/SCons/scons/blob/4.0.1/SCons/Tool/link.py#L54-L76 So we don't need to manually specify the same value as $CXX for $LINK.
* Add missing javascript semi-colons.Marcel Admiraal2020-11-171-2/+2
|
* Remove empty lines around braces with the formatting scriptAaron Franke2020-11-1610-20/+0
|
* [HTML5] AudioWorklet API implementation.Fabio Alessandrelli2020-11-108-202/+717
| | | | | | | | | | | | 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-1021-889/+1233
| | | | | | | | | 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] Update syntax for lto.Fabio Alessandrelli2020-11-101-1/+2
|
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-074-5/+5
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* [HTML5] Fix audio buffer size and latency hint.Fabio Alessandrelli2020-11-062-2/+2
| | | | | | | | | | 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.
* Refactor MethodBind to use variadic templatesreduz2020-10-181-1/+1
| | | | Removed make_binders and the old style generated binders.
* [HTML5] Add JavaScriptToolsEditorPlugin.Fabio Alessandrelli2020-10-144-0/+218
| | | | | | | | | 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).
* Add JavaScript editor html file.Fabio Alessandrelli2020-10-141-1/+1
|
* [HTML5] Close IDBFS database on exit.Fabio Alessandrelli2020-10-142-3/+19
| | | | | | | 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.
* Increase HTML5 THREADPOOL size.Fabio Alessandrelli2020-10-141-1/+1
| | | | | | | This fixes a "random" deadlock when quitting the editor. I still haven't figure out the root cause, but having a bigger seems to greatly mitigate the issue. The new pool size (pre-allocated threads) is now 8.
* [HTML5] Scons now expects "emcc" to be in PATH.Fabio Alessandrelli2020-10-042-25/+6
| | | | | | 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.
* [HTML5] Run Audio process in thread when availableFabio Alessandrelli2020-10-025-185/+314
| | | | | | | | | 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).
* Add extra suffix for HTML5 thread builds.Fabio Alessandrelli2020-10-021-0/+1
|
* Add COOP/COEP headers to HTML5 "run" server.Fabio Alessandrelli2020-10-021-0/+3
| | | | | | This allow the page to be considered a SecureContext if the address is localhost (127.0.0.1/::1) and let Firefox (and future Chrome versions) enable extra features needed for the HTML5 threaded export.
* JS synchronous start, better persistent FS sync.Fabio Alessandrelli2020-09-235-73/+107
| | | | | | | | | | | | | | 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).