summaryrefslogtreecommitdiff
path: root/platform/javascript
AgeCommit message (Collapse)Author
2020-11-07Reorganized core/ directory, it was too fatty alreadyreduz
-Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
2020-11-06[HTML5] Fix audio buffer size and latency hint.Fabio Alessandrelli
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.
2020-10-18Refactor MethodBind to use variadic templatesreduz
Removed make_binders and the old style generated binders.
2020-10-14[HTML5] Add JavaScriptToolsEditorPlugin.Fabio Alessandrelli
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).
2020-10-14Add JavaScript editor html file.Fabio Alessandrelli
2020-10-14[HTML5] Close IDBFS database on exit.Fabio Alessandrelli
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.
2020-10-14[HTML5] Expose request_quit via Engine class.Fabio Alessandrelli
So it can be called when closure compiler is enabled.
2020-10-14Increase HTML5 THREADPOOL size.Fabio Alessandrelli
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.
2020-10-04[HTML5] Scons now expects "emcc" to be in PATH.Fabio Alessandrelli
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-02[HTML5] Run Audio process in thread when availableFabio Alessandrelli
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).
2020-10-02Add extra suffix for HTML5 thread builds.Fabio Alessandrelli
2020-10-02Add COOP/COEP headers to HTML5 "run" server.Fabio Alessandrelli
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.
2020-09-23JS synchronous start, better persistent FS sync.Fabio Alessandrelli
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).
2020-09-23Make canvas resize optional in HTML5.Fabio Alessandrelli
2020-09-23Better HiDPI support in HTML5.Fabio Alessandrelli
2020-09-23Window event listener do not use capture.Fabio Alessandrelli
2020-09-23Small refactor to JavaScript handlers.Fabio Alessandrelli
Crated helper class in native/utils.js. Simplify code in OS/DisplayServer.
2020-09-23Expose request_quit method to JS in HTML5 export.Fabio Alessandrelli
2020-09-18[HTML5] Add override keyword, cleanup methods.Fabio Alessandrelli
2020-09-18Fix typos with codespellRémi Verschelde
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 ```
2020-09-09Explicitly add implicitly added semicolons.Marcel Admiraal
2020-07-27Merge pull request #40755 from Faless/js/fix_and_cancel_swapRémi Verschelde
Cancel/OK swap on HTML5 platform, small fixes.
2020-07-27Implement HTML5 cancel/ok button swap on Windows.Fabio Alessandrelli
Platform is detected on init via the `navigator.platform` string.
2020-07-27Correctly include <stdlib.h> in javascript main.Fabio Alessandrelli
Already fixed in 3.2, this header is needed since it's where setenv is declared and we should not assume it to be already included.
2020-07-27Properly set HTML5 DisplayServer init error value.Fabio Alessandrelli
Checked in main.cpp, would cause the engine to not load.
2020-07-24t Add unit testing to Godot using DocTest and added to GitHub Actions CIRevoluPowered
Implements exit codes into the engine so tests can return their statuses. Ideally we don't do this, and we use FIXUP logic to 'begin' and 'end' the engine execution for tests specifically. Since realistically we're initialising the engine here we don't want to do that, since String should not require an engine startup to test a single header. This lowers the complexity of running the unit tests and even for physics should be possible to implement such a fix.
2020-07-10Add override keywords.Marcel Admiraal
2020-07-01Use dummy driver when JS AudioContext is unavailable.Fabio Alessandrelli
2020-07-01Limit FPS in JS by skipping iterations.Fabio Alessandrelli
2020-07-01[JS] Check canvas size each loop, force redraw.Fabio Alessandrelli
Fix compatibility issues, achieve smoother resizing.
2020-07-01More static methods in DisplayServerJavaScript.Fabio Alessandrelli
Were static functions in cpp file, polluting global namespace.
2020-07-01Refactor canvas ID and locale handling.Fabio Alessandrelli
2020-07-01Fix FS error on JS startup due to existing folder.Fabio Alessandrelli
2020-06-14Immediately run first iteration after JS FS sync.Fabio Alessandrelli
Which is now run inside an animation frame. This avoid a 1 frame black screen when setting up the canvas.
2020-06-04Swtich HTML5 key detection from keyCode to code.Fabio Alessandrelli
The value of this, does not include the layout. The code has extra logic to map the unicode value to our keylist, supporting ASCII and Latin-1. Also add support for `physical_keycode` in HTML5 platform.
2020-05-25Fix JS audioContext parameters.Fabio Alessandrelli
Were not passed along correctly. `latencyHint` is supposed to be in seconds, not milliseconds.
2020-05-18Move mix_rate, ouput_latency to AudioDriverManagerFabio Alessandrelli
Each driver used to define the (same) project settings values `audio/mix_rate` and `audio/output_latency`, but the setting names are not driver specific. Overriding is still possible via platform tags.
2020-05-18AudioDriverJavaScript now compute buffer size.Fabio Alessandrelli
Based on mix rate and expected latency.
2020-05-14Style: Enforce braces around if blocks and loopsRémi Verschelde
Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14Style: Enforce separation line between function definitionsRémi Verschelde
I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
2020-05-14Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde
Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
2020-05-14Style: Fix missing/invalid copyright headersRémi Verschelde
2020-05-14Port member initialization from constructor to declaration (C++11)Rémi Verschelde
Using `clang-tidy`'s `modernize-use-default-member-init` check and manual review of the changes, and some extra manual changes that `clang-tidy` failed to do. Also went manually through all of `core` to find occurrences that `clang-tidy` couldn't handle, especially all initializations done in a constructor without using initializer lists.
2020-05-13Update game controller enums.Marcel Admiraal
2020-05-12Add WebSocket debugger, use it for Javascript.Fabio Alessandrelli
2020-05-10Add drop files functionFabio Alessandrelli
2020-05-10Fix Closure compiler build, python style.Fabio Alessandrelli
Move copyToFS into utils.js library included with '--pre-js'.
2020-05-10DisplayServerJavaScript implementation.Fabio Alessandrelli
2020-05-10[HTML5] Locale, input fix, context, exit.Fabio Alessandrelli
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)
2020-05-10Style: clang-format: Disable AllowShortCaseLabelsOnASingleLineRémi Verschelde
Part of #33027.