summaryrefslogtreecommitdiff
path: root/platform/javascript
AgeCommit message (Collapse)Author
2019-12-03Emscripten: Re-add BINARYEN_TRAP_MODE='clamp' for fastcompRémi Verschelde
The option is needed when using the 'fastcomp' backend (default before 1.39.0), and must not be defined when using 'upstream' (new default). So we define it conditionally to support both backends. Follow-up to #30751.
2019-12-01iOS modular build and export implementation.bruvzg
2019-11-24Add download_chunk_size property to HTTPRequest.Fabio Alessandrelli
This allows setting the `read_chunk_size` of the internal HTTPClient. This is important to reduce the allocation overhead and number of file writes when downloading large files, allowing for better download speed.
2019-11-20pcre2: Use scons option to disable JIT on some platformsRémi Verschelde
Third-party platforms (e.g. console ports) need to be able to disable JIT support in the regex module too, so it can't be hardcoded in the module SCsub. This is cleaner this way anyway. Fixes #19316.
2019-11-19HTML5: Explicitly link idbfs.js for IDBFS supportRémi Verschelde
Upstream Emscripten changed this in 1.39.1+, so IDBFS is no longer included by default and has to be linked manually. The explicit linking doesn't seem to be problematic on earlier versions (tested `1.38.47-upstream`). Fixes #33724.
2019-11-15HTML5: Fix support for Emscripten 1.39.1+Rémi Verschelde
A change in upstream Emscripten 1.39.1+ made our buildsystem error out where it was previously only issuing a warning: ``` [ 5%] Linking Static Library ==> main/libmain.javascript.opt.bc shared:WARNING: Assuming object file output in the absence of `-c`, based on output filename. Please add with `-c` or `-r` to avoid this warning Ranlib Library ==> main/libmain.javascript.opt.bc /opt/emsdk/upstream/bin/llvm-ranlib: error: unable to load 'main/libmain.javascript.opt.bc': file too small to be an archive ``` As advised on emscripten-core/emscripten#9806, we should be using `emar` here to create the static library and not `emcc`. This was apparently done to workaround Emscripten issues in the past, but evidently this is no longer necessary. The rest of the `env` redefinitions should probably be re-assessed against the current state of Emscripten. Fixes #33374.
2019-10-24Remove ECMAScript 6 "arrow operator".Fabio Alessandrelli
We don't need it, it's not well supported by compilers, and it was a mistake in the first place.
2019-10-23Implement HTTP server for HTML5 exportFabio Alessandrelli
Since most browsers no longer allow making async requests from a page loaded from `file://`, we now need a proper HTTP server to load the exported HTML5 game. This should also allow us to get the debugger to work over a WebSocket connection.
2019-10-23Improve EditorExportPlatform interface.Fabio Alessandrelli
Convert all get_device* methods to get_option* and normalize their usage as icon, label, tooltip.
2019-10-12Optimize images losslessly using `oxipng -o6 --strip all --zopfli`Hugo Locurcio
2019-10-10Remove dependency on the editor directory being in the build's include path.Marcel Admiraal
- Add or remove the necessary subdirectorires to the includes to remove dependency on the editor directory being in the build's include path. - Ensure includes in modified files conform to style guideline. - Remove editor from the build include path.
2019-10-03Properly revert cursor when using set_custom_mouse_cursor with nullPouleyKetchoupp
Fixes #32486
2019-10-01Fixed running the export templates with newer emscripten versions.Relintai
2019-09-25Added some obvious errors explanationsqarmin
2019-08-12https://github.com/godotengine/godot/issues/31297 - HTML5: ↵mellondill
this.rtenv.callMain is not a function when using latest-upstream backend Added needed changed for normal compiling with emscripten 1.38.41 and later
2019-08-12Export: Remove temp files from cache after exportRémi Verschelde
So far we left most temporary files lying around, so this attempts to fix that. I added a helper method to DirAccess to factor out the boilerplate of creating a DirAccess, checking if the file exists, remove it or print an error on failure.
2019-08-09Fix audio capture naming in JavascriptSaracen
2019-08-09Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in "platform", ↵Robin Hübner
"modules/gdnative", "modules/gdscript" directories.
2019-07-22Emscripten: Do not define BINARYEN_TRAP_MODE='clamp'Rémi Verschelde
It is not supported in Emscripten's `latest-upstream` LLVM backend, and doesn't seem necessary in the `latest` backend either. It was initially added in #22857 to solve a compilation error with the latter. Part of #30270.
2019-07-10Merge pull request #30465 from guilhermefelipecgs/cursor_blinkingRémi Verschelde
Fix cursor blinking in integrated GPUs
2019-07-09Fix cursor blinking in integrated GPUsGuilherme Felipe
Optimization for Input::set_custom_mouse_cursor when used inside _process function. (Avoids cursor blinking in low end devices)
2019-07-09Better detect Emscripten toolchain.Fabio Alessandrelli
Emscripten is apparently changing the variables in its config file, causing potential breakage of our build system. Binaries of the latest/latest-upstream releases are located in a subfolder of BINARYEN_ROOT called emscripten. Binaries of the other releases (e.g. sdk-1.38.31-64bit) are instead placed under the EMSCRIPTEN_ROOT folder. This PR checks if BINARYEN_ROOT has a subfolder called emscripten, if that does not exists, it falls back to checking the EMSCRIPTEN_ROOT. This way we give precedence to the new releases, given that activating multiple releases sequentially might result in having mismatching BINARYEN_ROOT and EMSCRIPTEN_ROOT.
2019-07-01Merge pull request #29482 from Calinou/html5-fix-emscripten-rootRémi Verschelde
Fix Emscripten root directory detection when building for HTML5
2019-06-19Fix Emscripten root directory detection when building for HTML5Hugo Locurcio
Recent Emscripten SDK versions seem to only include the `BINARYEN_ROOT` variable in the Emscripten configuration file, whereas the platform's `detect.py` only looked at `EMSCRIPTEN_ROOT`.
2019-06-19Made use of semicolons more consitent, fixed formattingJohnJLight
2019-06-17Add script to fix style issues and copyright headersRémi Verschelde
This is only meant to check the validity of the whole codebase every now and then, or to apply clang-format config changes when relevant.
2019-06-16Merge pull request #10643 from BastiaanOlij/camera_serverRémi Verschelde
CameraServer class
2019-06-15Merge pull request #29786 from dotdigitalgroup/hidpi-javascript-fix-masterRémi Verschelde
Fix pointer position in hidpi-corrected resolutions on web
2019-06-15Fix compilation warnings in JS and Windows buildsRémi Verschelde
Warnings raised by Emscripten 1.38.0 and MinGW64 5.0.4 / GCC 8.3.0. JS can now build with `werror=yes warnings=extra`. MinGW64 still has a few warnings to resolve with `warnings=extra`, and only one with `warnings=all`. Part of #29033 and #29801.
2019-06-15Adding a new Camera Server implementation to Godot.BastiaanOlij
This is a new singleton where camera sources such as webcams or cameras on a mobile phone can register themselves with the Server. Other parts of Godot can interact with this to obtain images from the camera as textures. This work includes additions to the Visual Server to use this functionality to present the camera image in the background. This is specifically targetted at AR applications.
2019-06-14Fix pointer position in hidpi-corrected resolutions on webLeonardo Giovanni Scur
2019-06-11Fix error macro calls not ending with semicolonRémi Verschelde
It's not necessary, but the vast majority of calls of error macros do have an ending semicolon, so it's best to be consistent. Most WARN_DEPRECATED calls did *not* have a semicolon, but there's no reason for them to be treated differently.
2019-05-29Implement Clipboard API read when supported.Fabio Alessandrelli
Being async, the first time a value is pasted GUI elements will still return the previous one. This at least until 'clipboardchange' window event gets implemented by user agents.
2019-05-29Kinda working HTML5 clipboard paste.Fabio Alessandrelli
Listen to paste events to update local clipboard. CTRL+V still not working out of the box. To do that, We would need to change how we handle keypress, most likely making it worse and less safe. In the end, I'm not sure we can fix it properly for now. Maybe in the future, with the Clipboard API, support of which is still pretty limited on chrome, and only available to extensions in Firefox. For now, you can paste via: - Browser bar -> Edit -> Paste. - Middle mouse click (Linux only, copies secondary clipboard). And THEN press CTRL+V
2019-05-28Add OS clipboard set support to OS JavascriptFabio Alessandrelli
2019-05-21Merge pull request #29032 from akien-mga/tools-exceptions-rttiRémi Verschelde
SCons: Keep exceptions and rtti on Android, iOS and HTML5 tools build
2019-05-21added a const keyword for a methods that return constant literal...hbina085
2019-05-20SCons: Keep exceptions and rtti on Android, iOS and HTML5 tools buildRémi Verschelde
Those were disable to keep size small, and on Android avoid the dependency on the STL, but for tools build (editor) this is not really a concern. Note: as of today it's not possible to build tools=yes for those platforms, but this change is one of the necessary steps to enable it. Fixes #25262.
2019-05-15Fix OS_Javascript execute methodFabio Alessandrelli
Signature was changed in OS via: cd4449e7abe97b2bc883e2d182db2cc41eb35f8c
2019-04-30SCons: Always use env.Prepend for CPPPATHRémi Verschelde
Include paths are processed from left to right, so we use Prepend to ensure that paths to bundled thirdparty files will have precedence over system paths (e.g. `/usr/include` should have lowest priority).
2019-04-12Move IDHandler JS module to platform from WebsockFabio Alessandrelli
2019-04-06Remove unused importsHendrikto
2019-03-11HTML5: Fix ETC export for GLES2 fallback on mobileRémi Verschelde
2019-03-06Fix directory check when exporting projectvolzhs
Fix #26702
2019-03-06Merge pull request #26633 from akien-mga/driver-fallback-etcRémi Verschelde
Disable driver fallback to GLES2 by default
2019-03-05Merge pull request #26626 from rluders/misleading-error-message-exportRémi Verschelde
Fixing misleading error message when trying to export
2019-03-05Fixes misleading error message when trying to exportRicardo Lüders
This patch fixes the misleading error message when users try to "export all" into an invalid destination path. Closes #26539
2019-03-05Disable driver fallback to GLES2 by defaultRémi Verschelde
GLES2 is not designed to be a drop-in replacement for the GLES3 backend, so the fallback mode has to be used knowingly. It *can* make sense for simple projects which make sure to handle the differences between both rendering backends, but most users should stick to one supported backend. By making it opt-in, we can now use this parameter to define whether to export ETC textures to Android and iOS when using GLES3 + Fallback. When using GLES3 without Fallback on Android, set the proper min GLES version in the AndroidManifest. Also made the option boolean and renamed it for clarity and to avoid conflict with the previous String option (which would always evaluate as "true" otherwise). Fixes #26569.
2019-03-05Fix HTML5 quick preview URLbruvzg
2019-03-03Improve VRAM texture compression checks for mobile/webRémi Verschelde
For HTML5, we need to support S3TC if running on desktop, and ETC or ETC2 for mobile, so make this explicit. Add logic to check for ETC2 support on GLES3, and remove incorrect ETC feature for GLES3 on Android. Fix ETC check invalidating templates on HTML5. Fixes #26476.