Commit graph

599 commits

Author SHA1 Message Date
Rémi Verschelde
ece8b38dd1
Merge pull request #91610 from bruvzg/web_ime_3
[Web, 3.x] Add IME input support.
2024-06-25 08:59:43 +02:00
bruvzg
5f628f2e20
[3.x, Web] Fix TTS configuration loaded too early. 2024-05-22 19:47:25 +03:00
bruvzg
bbe8a66a2d
[Web, 3.x] Add IME input support. 2024-05-09 09:07:58 +03:00
Adam Scott
a671234483
Add workaround for emscripten >= 3.1.47 LTO build
(cherry picked from commit 656bc22e28)
2024-05-01 12:01:12 +02:00
Rémi Verschelde
246b85c686
Web: Bump closure compiler spec to ECMASCRIPT_2021
Fixes #88008.

(cherry picked from commit d29b0d90e0)
2024-04-25 16:24:36 +02:00
Adam Scott
32fcc88c23
Fix emscripten 3.1.51 breaking change about *glGetProcAddress()
(cherry picked from commit 5922ac0fb1)
2024-04-25 16:24:36 +02:00
Adam Scott
9bcdcccb36
Add WASM_BIGINT linker flag to the web build
(cherry picked from commit 3ae524fa9e)
2024-04-25 16:24:36 +02:00
Rémi Verschelde
4206975e3a
SCons: Fix Web build when compiler version isn't properly detected
Quick fix for #82585.

A better fix requires refactoring the way we detect the compiler version
to make it more reliable, and get a consistent output. But I prefer to
keep changes minimal for 3.x branches at this point.

Also set CI version to 3.1.39, which is what we use for official 3.6 builds
since 3.6-beta4.
2024-01-30 14:54:49 +01:00
Rémi Verschelde
f706a3bd54
Web: Clarify that OS.get_unique_id is not supported
Remove the base error message in `OS`, we no longer really error out this
way for not implemented methods. Instead, each platform should override them
to provide the context they want.

Fixes #82439.

(cherry picked from commit 0a10f09ce4)
2024-01-18 16:19:43 +01:00
nikitalita
267063268b
SCons: Add stack_size and default_pthread_stack_size options to Web target
(cherry picked from commit 6788bc6bc2)
2024-01-18 16:10:45 +01:00
Adam Scott
4a02e6159d
Set what were default values for some emscripten linkflags
- Set `-sSTACK_SIZE` to what it was before emscripten 3.1.27.
  It was renamed in 3.1.25 so also set `-sTOTAL_SIZE` for older
  versions for consistency.
- Set `-sDEFAULT_PTHREAD_STACK_SIZE` to what it was before 3.1.30.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
(cherry picked from commit 8e5fbd4348)
2024-01-18 16:10:45 +01:00
Rémi Verschelde
0a81659d9b
Web: Fix version check for missing scalbnf LTO workaround
The check needs to happen after we set `env["CXX"]`.
Follow-up to #81340.

(cherry picked from commit 50161808c2)
2023-10-30 14:49:14 +01:00
Rémi Verschelde
c88a8f96b4
Web: Workaround Emscripten 3.1.42+ LTO regression
Fixes #80010.

(cherry picked from commit b064008c07)
2023-10-30 14:49:13 +01:00
SysError99
8ac91f813f [3.x] Fix JavaScript callback memory leak 2023-08-29 03:12:53 +07:00
Rémi Verschelde
55550da68b
SCons: Disable C++ exception handling
Upon investigating the extremely slow MSVC build times in #80513, I noticed
that while Godot policy is to never use exceptions, we weren't enforcing it
with compiler flags, and thus still included exception handling code and
stack unwinding.

This is wasteful on multiple aspects:

- Binary size: Around 20% binary size reduction with exceptions disabled
  for both MSVC and GCC binaries.
- Compile time:
  * More than 50% build time reduction with MSVC.
  * 10% to 25% build time reduction with GCC + LTO.
- Performance: Possibly, needs to be benchmarked.

Since users may want to re-enable exceptions in their own thirdparty code
or the libraries they compile with Godot, this behavior can be toggled with
the `disable_exceptions` SCons option, which defaults to true.
2023-08-16 10:34:10 +02:00
Fabio Alessandrelli
8fb47d6b3e [JS] Update npm packages 2023-08-01 11:51:41 +02:00
bruvzg
18ee8da7d6
Add audio/general/text_to_speech project setting to enable/disable TTS. 2023-05-26 20:57:29 +03:00
dependabot[bot]
90132061f5
Bump json5 from 1.0.1 to 1.0.2 in /platform/web
Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit a20c8443af)
2023-01-11 14:24:29 +01:00
Rémi Verschelde
1426cd3b3a
One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".

Backported from #70885.
2023-01-10 15:26:54 +01:00
Fabio Alessandrelli
d0ba1517a7 [Web] Expose API to force file system sync. 2023-01-09 21:30:42 +01:00
Fabio Alessandrelli
eda014197f
[Web] Add the "serve" and "run" scons targets.
You can now run the test HTTP server by calling:

scons p=javascript serve

If you also wish to run the browser, call instead:

scons p=javascript run

The default listen port is 8060, but can be overriden via the env
variable GODOT_WEB_TEST_PORT which must be a valid integer.

(cherry picked from commit a06602363c)
2022-12-12 14:49:22 +01:00
Hugo Locurcio
816db5c215
Replace local web server setup for web editor with a Python-based solution
This makes it easier to set up, as you always have Python installed
when building Godot. On the other hand, you don't always have Node.js
+ npm installed (and you may not want to spend time running `npm install`).

Co-authored-by: Fabio Alessandrelli <fabio.alessandrelli@gmail.com>
(cherry picked from commit 1be1b15a57)
2022-12-12 14:49:22 +01:00
Jason Knight
6812e66f33 Change auto to default in cursor css settings. 2022-10-07 12:17:15 -06:00
Rémi Verschelde
6f6c8b114b HTML5: Add missing OS::get_cursor_shape() implementation
Fixes #66835.
2022-10-04 12:49:16 +02:00
Rémi Verschelde
d5c1baa288 SCons: Refactor handling of production flag and per-platform LTO defaults
Fixup to #63288.
See #65583 for the bug report.

Co-authored-by: Cyberrebell <chainsaw75@web.de>
(cherry picked from commit 35a15e6191)
2022-09-20 10:26:17 +02:00
Fredia Huya-Kouadio
1f23bac645 Disable menus and functionality that are not relevant on the Android Editor port 2022-09-13 07:38:07 -07:00
Rémi Verschelde
953dea1227
Merge pull request #63309 from akien-mga/3.x-scons-refactor-lto 2022-09-08 11:24:54 +02:00
Rémi Verschelde
5271d69909 HTML5: Fix warning with Emscripten 3.1.20
And use that version for CI.
2022-09-05 15:37:33 +02:00
Rémi Verschelde
570e6c1730 SCons: Refactor LTO options with lto=<none|thin|full>
Adds support for LTO on macOS and Android.
Disable LTO by default on iOS even if `production=yes` is set.

Also add `linker` option to `server` platform missed in #63283.

Refactor code handling old arguments to make it simpler (breaks compat,
but is explicit enough about it and scripts are easy to fix).
2022-09-05 14:45:12 +02:00
Jamie Pate
562d7c616d Improve performance of screen_get_dpi() in Javascript
Replace a bisect with a single multiplication when calling
screen_get_dpi() in Javascript

Tested the value of
window.matchMedia(`(resolution:${(window.devicePixelRatio*96).toFixed(100)}dpi)`).matches
which is true except for values that cause a lot of rounding errors
(e.g. dpr : 0.3  => resolution: 28.799999999999997dpi)

Even in these cases the value matches the result of the previous
`findDPI()` method.

See also:

6cff589b5b (r81273660)
(cherry picked from commit c2e3971013)
2022-08-24 17:16:33 +02:00
Fredia Huya-Kouadio
d2213f76a9 Refactor the export checking logic to improve separation of concerns 2022-08-14 08:47:09 -07:00
Rémi Verschelde
7dc8ec0c61
Merge pull request #63643 from aaronfranke/3.x-mouse-mode-ch 2022-08-08 14:36:45 +02:00
Rémi Verschelde
0bed7ea63f
Merge pull request #61316 from bruvzg/tts_3x
[3.x] Backport text-to-speech support.
2022-08-05 23:45:51 +02:00
Rémi Verschelde
26762a71b6
Merge pull request #58537 from winterpixelgames/feature/virtual-keyboard-types-3.x 2022-08-05 19:37:13 +02:00
Aaron Franke
0d6e2d1090
Add MOUSE_MODE_CONFINED_HIDDEN to MouseMode enum 2022-07-29 13:46:04 -05:00
pattlebass
fb7ecc748f [3.x] HTML5: Add support for Input.vibrate_handheld() 2022-07-28 13:20:05 +03:00
Rémi Verschelde
818f1eed31 Code quality: Fix header guards consistency
Adds `header_guards.sh` bash script, used in CI to validate future
changes. Can be run locally to fix invalid header guards.
2022-07-25 14:53:37 +02:00
pattlebass
82c3e6229b HTML5: Make OS.get_locale() match other platforms
Fixes #63029.

(cherry picked from commit d57a76c809)
2022-07-15 23:25:01 +02:00
Brian Semrau
ce24b48e50 Add support for multiple virtual keyboard types 2022-07-07 14:22:28 -04:00
Raffaele Picca
3f8830ec50 Fix default cursor in html5 export. 2022-07-01 20:46:58 +02:00
bruvzg
6489fe890e
Backport text-to-speech support. 2022-07-01 11:04:50 +03:00
Hugo Locurcio
786ff06ed7
Fix window maximize error message appearing when starting the web editor
An error message is no longer printed when trying to maximize the window
in HTML5. This behavior is consistent with Android and iOS.
2022-07-01 01:54:15 +02:00
Jiri Suchan
daf6fdf0b7 refactoring: simplify compiler version check
(cherry picked from commit 8d94d26caf)
2022-06-17 10:08:49 +02:00
Fabio Alessandrelli
65dc01bd8e [HTML5] Add GDNative+Threads build. 2022-06-13 11:46:08 +02:00
bruvzg
f5fa1ca944
Add readable export errors. Add RTL image vertical alignment support. 2022-06-08 17:56:28 +03:00
Rémi Verschelde
f880904c7a HTML5: Run npm audit fix
And re-add `node_modules` to `.gitignore` which I mistakenly removed
with an earlier cleanup.

(cherry picked from commit 6aa7449d60)
2022-05-25 14:59:03 +02:00
Rémi Verschelde
9d1d386bd0 HTML5: Enable mbedTLS module for Crypto object
Increases the size of the wasm by around 3% (~300-350 KiB).

This enables using the Crypto object for hashing, signing and encryption,
and therefore reduces the gap between the features of the HTML5 platform
and other platforms.

Closes https://github.com/godotengine/godot-proposals/issues/3574.

(cherry picked from commit 3ff6d794c0)
2022-05-25 14:52:57 +02:00
Haoyu Qiu
4c70c5b0cd Swap the meaning of CURSOR_WAIT and CURSOR_BUSY 2022-05-14 10:24:25 +08:00
mdavisprog
53fb0440d3 Add OS::is_process_running function.
Adds the is_process_running function to the native OS class and exposes it to script.

This is implemented on Windows and Unix platforms. A stub is provided for other platforms that do not support this function.

Documentation is updated to reflect new API function.

(cherry picked from commit f3c1232c59)
2022-05-05 15:02:46 +02:00
Fabio Alessandrelli
cc12c69ea1 [JS] Add flag to disable weak symbols in ZSTD.
Weak symbols are currently broken in upstream emscripten.

(cherry picked from commit 070bd87aaa)
2022-05-05 14:07:56 +02:00