summaryrefslogtreecommitdiffstats
path: root/platform/javascript
Commit message (Collapse)AuthorAgeFilesLines
* [HTML5] Fix multi-touch input handling.Fabio Alessandrelli2021-11-301-3/+3
| | | | | | The code to populate the input data for WebAssembly was incorrectly overriding values when multiple touches were present due to wrong indexing.
* [HTML5] Use absolute path for JS lib/pre/externs.Fabio Alessandrelli2021-11-261-3/+3
| | | | | | | | Ensure better compatibility when emcc which may run some tools from different paths (e.g. closure compiler). This fixes externs include issues with modern emcc using the closure compiler.
* [HTML5] Fix focus (again) in Firefox's iframes.Fabio Alessandrelli2021-11-261-2/+6
| | | | | | | | This actually makes sense(?), when running inside an iframe the active element might be our canvas, while the iframe itself is not active in the parent window. Since we consume the event, the iframe does not get focused in Firefox (but does in Chromium-based browsers), so we must always call focus to handle such occasions.
* [HTML5] Add WebGL2 (GLES3) support using the OpenGL renderer.Fabio Alessandrelli2021-11-194-64/+67
| | | | | | | Note, the editor build requires the mbedtls module to be manually enabled, as it is currently needed as a ResourceUID dependency. This will need to be addressed in a separate PR.
* Merge pull request #54499 from Faless/threads/4.x_work_pool_defaultRémi Verschelde2021-11-191-0/+1
|\
| * [OS] Add ThreadWorkPool default size to OS.Fabio Alessandrelli2021-11-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some platforms (*cough* web *cough*) have hard limits on the number of threads that can be spawned. Currently, ThreadPoolWork (mostly used in rendering/physics servers) will spawn as many threads as CPUs available causing exception on machines with high CPU count. This commit adds a new overridable method to OS that returns the default thread pool size (still the CPU count by default), and overrides it for the JavaScript platform so it always allocate only one thread. We can likely improve the whole ThreadPoolWork in the future to always allocate X amount of threads, and assign jobs to them on the fly, but that will require some more architectural changes.
* | [HTML5] Add checks to Gamepad API events.Fabio Alessandrelli2021-11-191-2/+6
| | | | | | | | | | | | In some conditions the events might be generated even when the `gamepad` object is not accessible due to Security Context requirements. This commit adds a check to avoid firing the handler in those cases.
* | [HTML5] Fix input not focusing canvas.Fabio Alessandrelli2021-11-191-0/+6
| | | | | | | | | | mousedown and touchstart should focus the canvas to ensure correct application lifecycle.
* | Use "enum class" for input enumsAaron Franke2021-11-123-38/+39
| |
* | Modules: Make sure to include modules_enabled.gen.h where neededRémi Verschelde2021-11-121-1/+1
|/
* Fix new projects always being created with OpenGLHugo Locurcio2021-11-011-2/+2
| | | | | | | | Only Vulkan is fully implemented for now, so OpenGL isn't available in the project manager yet. This also makes the rendering driver checks use lowercase names everywhere for consistency.
* Use OpenGL 3.3 core profile instead of compatibility profileClay John2021-10-313-676/+4
| | | | | | | | | | - Rename OpenGL to GLES3 in the source code per community feedback. - The renderer is still exposed as "OpenGL 3" to the user. - Hide renderer selection dropdown until OpenGL support is more mature. - The renderer can still be changed in the Project Settings or using the `--rendering-driver opengl` command line argument. - Remove commented out exporter code. - Remove some OpenGL/DisplayServer-related debugging prints.
* Rename GLES2 driver to OpenGL to prepare for the upgrade to GLES3Hugo Locurcio2021-10-303-6/+6
| | | | | - Use lowercase driver names for the `--rendering-driver` command line argument.
* Add GLES2 2D renderer + Linux display managerlawnjelly2021-10-301-0/+672
| | | | | | | | | First implementation with Linux display manager. - Add single-threaded mode for EditorResourcePreview (needed for OpenGL). Co-authored-by: clayjohn <claynjohn@gmail.com> Co-authored-by: Fabio Alessandrelli <fabio.alessandrelli@gmail.com>
* clang-format: Disable alignment of operands, too unreliableRémi Verschelde2021-10-281-1/+1
| | | | | | | | | Sets `AlignOperands` to `DontAlign`. `clang-format` developers seem to mostly care about space-based indentation and every other version of clang-format breaks the bad mismatch of tabs and spaces that it seems to use for operand alignment. So it's better without, so that it respects our two-tabs `ContinuationIndentWidth`.
* JS: Bump ansi-regex version for linterRémi Verschelde2021-10-221-3/+3
| | | | Silences warning about a moderate security vulnerability (which doesn't affect us).
* SCons: Set `DEBUG_ENABLED` and `DEV_ENABLED` in SConstructRémi Verschelde2021-10-151-3/+0
| | | | | They're the same for all platforms so they don't need to be repeated in all platform definitions.
* SCons: Add `DEV_ENABLED` defines for `target=debug` buildsRémi Verschelde2021-10-141-0/+1
| | | | | | | | | | | This will allow adding developer checks which will be fully compiled out in user builds, unlike `DEBUG_ENABLED` which is included in debug tempates and the editor builds. This define is not used yet, but we'll soon add code that uses it, and change some existing `DEBUG_ENABLED` checks to be performed only in dev builds. Related to godotengine/godot-proposals#3371.
* Fix some LGTM errors of "Multiplication result converted to larger type"Aaron Franke2021-10-121-2/+3
|
* Merge pull request #52711 from m4gr3d/provide_getter_for_project_data_dir_masterRémi Verschelde2021-10-051-1/+2
|\
| * Provide a getter for the project data directory.ne0fhyk2021-09-151-1/+2
| |
* | [HTML5] Refactor JS library listeners to OS.Fabio Alessandrelli2021-10-054-70/+70
| |
* | [HTML5] Refactor display/input JS library code.Fabio Alessandrelli2021-10-054-414/+435
| |
* | [HTML5] Implement Pointer Lock API in JS library.Fabio Alessandrelli2021-10-053-8/+37
| | | | | | | | Removes more emscripten HTML5 library dependencies.
* | [HTML5] Implement window blur in JS library.Fabio Alessandrelli2021-10-054-22/+12
| | | | | | | | Removes more emscripten HTML5 library dependencies.
* | [HTML5] Implement fullscreenchange in JS library.Fabio Alessandrelli2021-10-054-18/+22
| | | | | | | | Removes more emscripten HTML5 library dependencies.
* | [HTML5] Implement mouse/touch/key events in JS library.Fabio Alessandrelli2021-10-057-197/+259
| | | | | | | | | | This makes us more independent from emscripten libraries, giving us more control on the application lifecycle.
* | Use range iterators for `Map`Lightning_A2021-09-301-2/+2
| |
* | Merge pull request #52809 from selgesel/patch1Fabio Alessandrelli2021-09-292-0/+9
|\ \ | | | | | | Release pressed events when the window is blurred on HTML5 platform
| * | Release pressed events when the window is blurred on HTML5 platformSelgesel2021-09-232-0/+9
| | |
* | | HTML5: Fix minification error with Emscripten 1.39.9Rémi Verschelde2021-09-292-1/+9
|/ / | | | | | | | | | | | | It used an old vendored version of acorn.js which seems to choke on this trailing comma. This is not a problem for more recent Emscripten versions. We disable the `comma-dangle` check in ESLint to prevent this issue.
* | Merge pull request #52649 from Faless/js/4.x_audioworklet_nothreads_prRémi Verschelde2021-09-217-154/+339
|\ \ | | | | | | [HTML5] Refactor audio drivers. Implement AudioWorklet w/o threads.
| * | [HTML5] Refactor audio drivers. Implement AudioWorklet w/o threads.Fabio Alessandrelli2021-09-157-154/+339
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Performances are not great in general, bad on Firefox, on Chrome, well, it could be an improvement. Leave it as a fallback for now, but can be forced via project settings if desired (or custom JavaScript logic via the "args" option). I'm actually surprised this works, it involves so many allocations, but there's no way around it when SharedArrayBuffer is not available :(.
* | | Merge pull request #52720 from Faless/js/4.x_fix_wheelRémi Verschelde2021-09-161-5/+6
|\ \ \ | |/ / |/| | [HTML5] Fix wheel/touch callback modifying event after parse.
| * | [HTML5] Fix wheel/touch callback modifying event after parse.Fabio Alessandrelli2021-09-151-5/+6
| | | | | | | | | | | | | | | The events should be duplicated or reinstantiated without assuming that parse_input will consume them immediately.
* | | Merge pull request #52695 from Faless/js/4.x_audio_mix_rateFabio Alessandrelli2021-09-153-7/+14
|\ \ \ | |/ / |/| | [HTML5] Use browser mix rate by default on the Web.
| * | [HTML5] Use browser mix rate by default on the Web.Fabio Alessandrelli2021-09-153-7/+14
| | | | | | | | | | | | | | | | | | Browsers doesn't really like forcing the mix rate, e.g. Firefox does not allow input (microphone) if the mix rate is not the default one, Chrom* will exhibit worse performances, etc.
* | | [HTML5] Fix bug in AudioWorklet when reading output buffer.Fabio Alessandrelli2021-09-151-7/+7
|/ / | | | | | | Would attempt an out of bounds read, causing an exception.
* | Merge pull request #52604 from Faless/js/4.x_input_fixFabio Alessandrelli2021-09-142-2/+23
|\ \ | | | | | | [HTML5] Fix input not working when buffered.
| * | [HTML5] Fix input not working when buffered.Fabio Alessandrelli2021-09-121-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After input buffering was reworked, input accumulation is now handled outside of OS, and the JavaScript plaform never implemented that. Additionally, the JavaScript platform is quite obnoxious about calling specific APIs outside specific user triggered events. This commit adds event flushing during the main iteration, and forces it during keydown/keyup/mousedown/mouseup/touchstart/touchend/touchcanel events (effectively only accumulating only "move" events).
| * | [HTML5] Fix build error due to missing string cast.Fabio Alessandrelli2021-09-121-2/+2
| |/
* / Add logo attribution for Android, HTML5 and Linux platform iconsHugo Locurcio2021-09-111-0/+15
|/ | | | | - Tweak the Android platform logo to remove the Android wordmark, as it can't be used without explicit permission.
* Make platform feature tag names lowercaseHugo Locurcio2021-08-312-3/+3
| | | | | | | | | | | | | | Feature tag names are still case-sensitive, but this makes built-in feature tags more consistent. - `Windows` -> `windows` - `OSX` -> `osx` - `LinuxBSD` -> `linuxbsd` - `Android` -> `android` - `iOS` -> `ios` - `HTML5` -> `html5` - `JavaScript` -> `javascript` - `UWP` -> `uwp`
* Merge pull request #49598 from ↵Fabio Alessandrelli2021-08-311-7/+25
|\ | | | | | | | | Calinou/web-editor-improve-download-project-source-zip-name Improve the generated ZIP archive name when using Download Project Source
| * Improve the generated ZIP archive name when using Download Project SourceHugo Locurcio2021-08-161-7/+25
| | | | | | | | | | | | This makes for easier organization since downloading a project several times (or several different projects) will result in more meaningful file names.
* | HTML5: Handle GODOT_VERSION_STATUS env var in @GODOT_VERSION@Rémi Verschelde2021-08-191-1/+4
| | | | | | | | Follow-up to #51002.
* | [CI] Upgrade Emscripten to 2.0.27.Fabio Alessandrelli2021-08-181-1/+1
|/ | | | Update Godot Javascript FS library to manually depend on ERRNO_CODES.
* Split javascript export template into multiple filesSergey Minakov2021-08-125-964/+1081
|
* Use Key enum instead of plain integersAaron Franke2021-08-102-5/+5
|
* Fix various typos with codespellluz paz2021-07-251-1/+1
| | | | Found via `codespell -q 3 -S ./thirdparty,*.po,./DONORS.md -L ackward,ang,ans,ba,beng,cas,childs,childrens,dof,doubleclick,fave,findn,hist,inout,leapyear,lod,nd,numer,ois,ony,paket,seeked,sinc,switchs,te,uint`