summaryrefslogtreecommitdiffstats
path: root/platform/javascript
Commit message (Collapse)AuthorAgeFilesLines
* [HTML5] Implement get_processor_count.Fabio Alessandrelli2021-02-174-0/+11
|
* [HTML5] Fix compilation issues in 4.0Fabio Alessandrelli2021-02-171-3/+11
| | | | | More memory is needed, and a Workaround to avoid undefined symbol due to dead code elimination.
* Add cwrap to EXTRA_EXPORTED_RUNTIME_METHODSQuadtree2021-02-161-1/+1
|
* [HTML5] Detect screen scale and DPI.Fabio Alessandrelli2021-02-124-2/+35
| | | | | | | | `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).
* Merge pull request #45888 from Faless/js/4.x_xhr_fixRémi Verschelde2021-02-113-29/+18
|\ | | | | [HTML5] Fix HTTPClient request_raw.
| * [HTML5] Fix HTTPClient request_raw.Fabio Alessandrelli2021-02-113-29/+18
| | | | | | | | | | Now send data according to the spec, properly handle null data. Simplify JS code since we are at it.
* | [HTML5] Handle contextmenu, webglcontextlost internally.Fabio Alessandrelli2021-02-114-11/+16
|/ | | | | This way they are automatically cleaned up when the engine exits, landing a hand to browsers garbage collectors.
* [HTML5] Make home path persistent in editor.Fabio Alessandrelli2021-02-031-0/+7
| | | | | | | | | 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.
* [HTML5] Fix mouse_mode and fullscreen detection.Fabio Alessandrelli2021-02-021-2/+2
| | | | | | | 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).
* Merge pull request #45315 from RandomShaper/modernize_threadRémi Verschelde2021-01-313-9/+6
|\ | | | | Modernize Thread
| * Modernize ThreadPedro J. Estébanez2021-01-293-9/+6
| | | | | | | | | | | | | | | | | | - 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)
* | Don't handle BaseException in JavaScript build scriptMarcel Admiraal2021-01-281-6/+5
| |
* | [HTML5] Builtin HTTP server disable browsers cacheFabio Alessandrelli2021-01-251-0/+1
| | | | | | | | | | We don't want browsers to cache our temporary exports (since they will always differ).
* | [HTML5] Better editor HTML, small refactor.Fabio Alessandrelli2021-01-255-8/+28
| | | | | | | | | | Side and GDNative libraries are now added by engine.js , the dynlink pre js had been deleted.
* | [HTML5] Fix "initial_memory" build option parsingFabio Alessandrelli2021-01-251-2/+5
|/
* [HTML5] Custom Gamepad library to allow remapping.Fabio Alessandrelli2021-01-184-47/+213
| | | | | | | 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.
* 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
|