summaryrefslogtreecommitdiff
path: root/platform/javascript
AgeCommit message (Collapse)Author
2021-02-26Merge pull request #46446 from Faless/js/4.x_jsdocRémi Verschelde
[HTML5] Document Engine and EngineConfig (jsdoc).
2021-02-26[HTML5] Make editor HTML build tag scons4-proof.Fabio Alessandrelli
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.
2021-02-26[HTML5] Add jsdoc2rst tool.Fabio Alessandrelli
A template for `jsdoc` that generat the HTML5 public classref. The script can be run via `npm run docs` to print to stdout. You can dry run via `npm run docs -- --d dry-run` or write to file via `npm run docs -- -d /path/to/file.rst` Also update Makefile in `doc/` and add dry run test to CI.
2021-02-26[HTML5] Document Engine and EngineConfig (jsdoc).Fabio Alessandrelli
This commit also removes the utils.js engine file, moving some of it's content to config.js and some to engine.js .
2021-02-19[HTML5] Better fullscreen, canvas resizing.Fabio Alessandrelli
Three canvas resize policies: - `None`: Godot window settings are ignored. - `Project`: Godot handles the canvas like a native app (resizing it when setting the window size). - `Adaptive`: Canvas size will always adapt to browser window size. Use `None` if you want to control the canvas size with custom JavaScript code.
2021-02-19[HTML5] Easier HTML templates, better deinit/cleanup.Fabio Alessandrelli
2021-02-18Reorganize Project Settingsreduz
-Advanced Settings toggle also hides advanced properties when disabled -Simplified Advanced Bar (errors were just plain redundant) -Reorganized rendering quality settings. -Reorganized miscelaneous settings for clean up.
2021-02-17[HTML5] Implement get_processor_count.Fabio Alessandrelli
2021-02-17[HTML5] Fix compilation issues in 4.0Fabio Alessandrelli
More memory is needed, and a Workaround to avoid undefined symbol due to dead code elimination.
2021-02-16Add cwrap to EXTRA_EXPORTED_RUNTIME_METHODSQuadtree
2021-02-12[HTML5] Detect screen scale and DPI.Fabio Alessandrelli
`OS.get_screen_scale` will now return the `window.devicePixelRatio` value, `OS.get_screen_dpi` uses CSS media queries to find approximate DPI value for the current display. `OS.get_screen_size` also return the actual screen size (not the CSS pixel size).
2021-02-11Merge pull request #45888 from Faless/js/4.x_xhr_fixRémi Verschelde
[HTML5] Fix HTTPClient request_raw.
2021-02-11[HTML5] Fix HTTPClient request_raw.Fabio Alessandrelli
Now send data according to the spec, properly handle null data. Simplify JS code since we are at it.
2021-02-11[HTML5] Handle contextmenu, webglcontextlost internally.Fabio Alessandrelli
This way they are automatically cleaned up when the engine exits, landing a hand to browsers garbage collectors.
2021-02-03[HTML5] Make home path persistent in editor.Fabio Alessandrelli
We used to only persist specific sub-folder of /home/web_user/ when running the Web Editor. This resulted in bad UX about default project creation path etc. This PR makes the whole folder persistent, move the zip preloading to a different folder (to avoid persisting it), and automatically prompt the user to import it if present.
2021-02-02[HTML5] Fix mouse_mode and fullscreen detection.Fabio Alessandrelli
The canvas_id is `#`-prefixed to work with emscripten as a CSS selector. When comparing to an event target ID (e.g. when checking if the canvas is fullscreen, or is locking the mouse) we need to skip the first char (the hash).
2021-01-31Merge pull request #45315 from RandomShaper/modernize_threadRémi Verschelde
Modernize Thread
2021-01-29Modernize ThreadPedro J. Estébanez
- Based on C++11's `thread` and `thread_local` - No more need to allocate-deallocate or check for null - No pointer anymore, just a member variable - Platform-specific implementations no longer needed (except for the few cases of non-portable functions) - Simpler for `NO_THREADS` - Thread ids are now the same across platforms (main is 1; others follow)
2021-01-28Don't handle BaseException in JavaScript build scriptMarcel Admiraal
2021-01-25[HTML5] Builtin HTTP server disable browsers cacheFabio Alessandrelli
We don't want browsers to cache our temporary exports (since they will always differ).
2021-01-25[HTML5] Better editor HTML, small refactor.Fabio Alessandrelli
Side and GDNative libraries are now added by engine.js , the dynlink pre js had been deleted.
2021-01-25[HTML5] Fix "initial_memory" build option parsingFabio Alessandrelli
2021-01-18[HTML5] Custom Gamepad library to allow remapping.Fabio Alessandrelli
No longer use emscripten functions for gamepads, implement them as library functions in library_godot_display.js instead. This allows us to do a better job at "guessing" vendorId, productId, OS, etc. thus allowing us to better find the remapping for the controller.
2021-01-12Merge pull request #44514 from madmiraal/split-os-executeRémi Verschelde
Split OS::execute into two methods
2021-01-10[HTML5] Reorganize build script.Fabio Alessandrelli
Simplify helper functions, fix env/sys_env confusion and depends for externs and pre-js.
2021-01-10Fix JavaScript platform after MainLoop methods rename.Fabio Alessandrelli
2021-01-09Split OS::execute into two methodsMarcel Admiraal
1. execute(): Executes a command and returns the results. 2. create_process(): Creates a new process and returns the new process' id.
2021-01-05Merge pull request #44154 from dsnopek/webxr-masterRémi Verschelde
Add WebXR support (for Godot 4.0)
2021-01-04Add support for WebXRDavid Snopek
2021-01-01Update copyright statements to 2021Rémi Verschelde
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 🎆
2020-12-29Fix missed renamings from empty() to is_empty()Rémi Verschelde
Those were missed in #44401 or added by later PRs.
2020-12-28Rename empty() to is_empty()Marcel Admiraal
2020-12-16Make tool menu plugins use Callables for callbackkobewi
2020-12-12Merge pull request #44315 from madmiraal/fix-handles-baseexceptionRémi Verschelde
Don't handle BaseException in build scripts
2020-12-12Don't handle BaseException in build scriptsMarcel Admiraal
2020-12-10HTML5: Code style cleanup for export codeRémi Verschelde
2020-12-09[HTML5] Fix errors when Mic is not allowed.Fabio Alessandrelli
2020-12-09[HTML5] Improve platform buildsystem.Fabio Alessandrelli
Check emcc version requirements when building GDNative. Add more build options (sanitizers, initial memory).
2020-12-09[HTML5] Add logo and favicon to editor html.Fabio Alessandrelli
2020-12-09Merge pull request #44161 from Faless/fix/fa_buffered_removeRémi Verschelde
Remove unused FileAccessBuffered
2020-12-06Remove now unused FileAccessBuffered.Fabio Alessandrelli
2020-12-06[HTML5] Use regular unix FileAccess implementation.Fabio Alessandrelli
2020-12-05[HTML5] Make GDNative support feature-based.Fabio Alessandrelli
This is suboptimal as it requires adding an extra compile flag, but rewriting how feature tags work is beyond the scope of this work.
2020-12-05[HTML5] Allow selecting the export type.Fabio Alessandrelli
Available types: - Regular - GDNative (support dynamic linking and thus GDNative WASM files) - Threads (uses WebAssembly Threads)
2020-12-05[HTML5] EditorRunNative works with GDNative.Fabio Alessandrelli
This "breaks" our loading bar logic (libraries are not counted). Fixing it is non trivial and probably deserves investigating a different strategy.
2020-12-05[HTML5] GDNative support via SIDE_MODULE.Fabio Alessandrelli
Working with emscripten >= 2.0.10
2020-12-04[HTML5] Add function signatures to JS libraries.Fabio Alessandrelli
2020-11-30[HTML5] Fix broken layout on load in HiDPI screensFabio Alessandrelli
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.
2020-11-30[HTML5] Remove file flags from writeFile in setup.Fabio Alessandrelli
Flags where deprecated and partly in removed in emscripten 2.0.9.
2020-11-26[Complex Text Layouts] Add third-party TextServer dependencies (ICU, ↵bruvzg
HarfBuzz, Graphite).