Commit Graph

111 Commits

Author SHA1 Message Date
Micky 503dc95d71
Add documentation to EditorExportPlatformWeb
(cherry picked from commit 7ffacb5d49)
2024-03-11 15:05:13 +01:00
Adam Scott b11c95dc98
Add `WASM_BIGINT` linker flag to the web build
(cherry picked from commit 3ae524fa9e)
2024-03-11 15:01:22 +01:00
Rémi Verschelde 193592d532
Web: Bump closure compiler spec to ECMASCRIPT_2021
Fixes #88008.

(cherry picked from commit d29b0d90e0)
2024-03-09 23:37:49 +01:00
Fabio Alessandrelli 5b4c5c4118
[Web] Fix closure compiler builds using BIGINT
When using proxy_to_pthread we add BIGINT support (to support exchanging
64 bits integers between wasm and JS).

Bigint though, is part of ECMAScript 2020, and the closure compiler was
using ECMAScript 6 instead.

This commit update the CC configuration to use ECMAScript 2020 instead.

(cherry picked from commit e9df955e39)
2024-03-09 23:37:30 +01:00
Rémi Verschelde 1e1d91df6a
SCons: Re-disable exceptions for Android, iOS, and Web
We made a mistake when cherry-picking #80612 with 269b115d9c,
where the global flag was defaulted to false to preserve the 4.1-stable behavior for desktop
platforms, but we forgot that the refactoring removed the force disabling of exceptions for
Android, iOS, and Web.

This reintroduces this behavior so it should be back to the same as in 4.1/4.1.1, and the
export templates should get back to their original size.

Only difference, the old code used to keep exceptions for the Web editor, but I see no reason
for it, so I disable them like with the templates.
2023-11-01 22:16:17 +01:00
Adam Scott 21e1148cc5 Fix godot_js_wrapper_create_cb regression
(cherry picked from commit 8447cbc16d)
2023-10-24 17:25:07 +02:00
SysError99 55ae5b0a78 Fix JavaScript callback memory leak issue
Typo fix

(cherry picked from commit 6a90164a03)
2023-10-24 17:25:07 +02:00
Mario Liebisch 5bb54d3184 Updated compiler version detection
This fixes multiple issues/inconsistencies around  `get_compiler_version()`:
* With no shell allocated, launching the compiler could fail even
  with proper paths being set.
* The return value was described as "an array of version numbers as ints",
  but the function actually returned a `Dictionary` (or `None`).
* Not all calls were properly handling a `None` return value in case of errors.
  On Windows this broke compiling for me since #81869 with default settings.
* Some calls defined inconsistent defaults/fallbacks (`0` or `-1`).

(cherry picked from commit 426e18fd37)
2023-10-24 17:08:57 +02:00
Hugo Locurcio 67e1849bd4 Add missing tutorials to documentation classes
(cherry picked from commit 469c462b76)
2023-10-19 21:59:32 +02:00
Rémi Verschelde aae20e5b10
Fix various typos with codespell
Also includes typo fixes from #79993, #80068, #80276, and #80303.

Co-authored-by: betalars <contact@betalars.de>
Co-authored-by: spaceyjase <429978+spaceyjase@users.noreply.github.com>
Co-authored-by: Swarkin <102416174+Swarkin@users.noreply.github.com>
Co-authored-by: Raul Santos <raulsntos@gmail.com>

(cherry picked from commit faaf27f284)
2023-10-03 20:45:35 +02:00
Rémi Verschelde 6b37ad40d7
Web: Disable raycast module by default (no occlusion culling)
This means no CPU occlusion culling (and not compiling Embree), unless
you compile custom export templates with `module_raycast_enabled=yes`.

This reduces the memory footprint significantly, and binary size.

Fixes #70621.

Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
(cherry picked from commit 8c40edf8c0)
2023-10-03 20:45:35 +02:00
Fabio Alessandrelli 4355bf9cf3 [Web] Update npm packages
(cherry picked from commit 61e7d47344)
2023-09-21 15:39:16 +02:00
Emmanouil Papadeas 252d816459 Fix `JavaScriptBridge.eval()` never returning PackedByteArray
It wrongly returned 20 on array buffers, which used to be the enumerator
value of Godot 3.x's type PoolByteArray, and now is the value of type Color,
while it should return 29 which is the enumerator value for PackedByteArray.

(cherry picked from commit c662491bd4)
2023-09-21 14:57:13 +02:00
Rémi Verschelde 269b115d9c 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.

(cherry picked from commit 3907e53ff6)
2023-09-20 22:44:05 +02:00
Rémi Verschelde 12aeb83043 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-09-20 22:44:04 +02:00
Rémi Verschelde 6122cf3178 Web: Workaround Emscripten 3.1.42+ LTO regression
Fixes #80010.

(cherry picked from commit b064008c07)
2023-09-20 22:44:04 +02:00
Fabio Alessandrelli 5eabd5e04a [Web] Always return -1 as body length in HTTPClientWeb.
Body length cannot be reliably retrieved from the web.
Reading the "content-length" value will return a meaningless value when
the response is compressed, as reading will return uncompressed chunks
in any case, resulting in a mismatch between the detected body size and
the actual size returned by repeatedly calling read_response_body_chunk.

Additionally, while "content-length" is considered a safe CORS header,
"content-encoding" is not, so using the "content-encoding" to decide if
"content-length" is meaningful is not an option either.

We simply must accept the fact that browsers are awful when it comes to
networking APIs.

(cherry picked from commit f4713d235a)
2023-09-20 18:40:36 +02:00
Kamil Brzoskowski 6becf94f49 Fix formatting of dlopen error message on Windows
And harmonize the format for all platforms.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
(cherry picked from commit 3cd865dbe8)
2023-07-10 18:09:57 +02:00
Septian add7c218d1 fix typo on TLSOptions.xml and library_godot_display.js
(cherry picked from commit b88b6b4f48)
2023-07-10 17:46:09 +02:00
Hugo Locurcio 0b19ec3498
Display a message about missing C# support on Android/iOS/Web platforms
When trying to export a C# project, this displays an error message after
creating a export preset for an unsupported platform.

Support for these platforms is planned for a future release.
2023-06-24 00:09:06 +02:00
Rémi Verschelde 90446fe9f3
SCons: Move platform logo/run icon to `export` folder
Follow-up to #75932.
Since these icons are only used by the export plugin, it makes sense to
move them and generate the headers there.

The whole `detect.is_active()` logic seems to be a leftover from before
times, as far back as 1.0-stable it already wasn't used for anything.

So I'm removing it and moving the export icon generation to
`platform_methods`, where it makes more sense.
2023-06-20 13:16:37 +02:00
Michael Alexsander 41a75cfa4f
Allow exporting release Android builds without a debug keystore 2023-06-19 01:00:13 -03:00
bruvzg 28db3c7158 [DisplayServer] Add method to check if native window is focused. 2023-06-16 10:27:52 +03:00
Rémi Verschelde 9e4315bb50
Style: Harmonize header includes in platform ports
This applies our existing style guide, and adds a new rule to that style
guide for modular components such as platform ports and modules:

Includes from the platform port or module should be included with relative
paths (relative to the root folder of the modular component, e.g.
`platform/linuxbsd/`), in their own section before Godot's "core" includes.

The `api` and `export` subfolders also need to be handled as self-contained
(and thus use relative paths for their "local" includes) as they are all
compiled for each editor platform, without necessarily having the api/export
matching platform folder in the include path.
E.g. the Linux editor build will compile `platform/android/{api,export}/*.cpp`
and those need to use relative includes for it to work.
2023-06-08 15:19:19 +02:00
hlutor a932c5e81d Added override for window_get_vsync_mode in display_server_web.cpp 2023-05-31 18:23:06 -06:00
Zae 14908140ea Fix `HTTPClient.get_response_body_length()` incorrect on Web 2023-05-30 15:22:51 +08:00
bruvzg 5b9984b5a2
Add `audio/general/text_to_speech` project setting to enable/disable TTS. 2023-05-18 20:16:03 +03:00
HolonProduction ddcb2d157d Don't expose mac specific display server. 2023-05-11 11:02:08 +02:00
Samuele Panzeri 4aaa2e6477 Fix wait for thread not started 2023-04-27 20:28:22 +02:00
Rémi Verschelde 8f7b09916d
Merge pull request #76026 from YuriSizov/editor-running-up-that-gui
Extract editor run toolbar into its own component
2023-04-26 12:15:29 +02:00
Rémi Verschelde b58873b98a
Merge pull request #69833 from Eoin-ONeill-Yokai/audio_invalid_mixrate
Fix crash caused by invalid mix_rate assignment due to bogus project settings.
2023-04-26 11:35:37 +02:00
Eoin O'Neill 5a08091168 Fix crash caused by invalid mix_rate assignment due to bogus
project settings.

We'll default to a sensible value in the case that a user has
somehow managed to modify the configuration file incorrectly.

Closes 69819
2023-04-25 23:52:50 -07:00
Hugo Locurcio 303bf247de
Add support for VRAM-compressed custom mouse cursor images
No memory is actually saved when using this, so lossless modes are
still recommended as they look better and load faster.
2023-04-21 18:01:47 +02:00
bruvzg a5128e71bb
[Export docs] Move docs to platform folders. 2023-04-20 11:02:12 +03:00
Yuri Sizov 8a74d8438f Extract editor run toolbar into its own component
- Simplify and update its logic.
- Simplify EditorScript.
- Improve EditorNode and other relevant includes.
- Fix scene-based path in the movie writer when
reloading a scene.
2023-04-19 17:12:28 +02:00
bruvzg 0088981c40
[Export] Add readable descriptions and validation warnings to the export options. 2023-04-19 08:35:59 +03:00
Rémi Verschelde f7f7250c0d
Merge pull request #75827 from Kvel2D/fix-custom-cursor-atlas-texture-bug
Fix custom cursor using atlas texture
2023-04-11 19:40:44 +02:00
Kvel2D 41f0a523db Fix custom cursor using atlas texture
Remove image.is_valid() check
There is already a fail condition and image is not used before that
Move up texture_is_valid() check
2023-04-11 19:16:24 +02:00
bruvzg a5009f4d3c
[Web] Detect host OS and use macOS keys on mac hosts. 2023-04-11 10:58:54 +03:00
bruvzg 744bf604bf [Web] Fix keycode/physical keycode mixed up. 2023-04-06 09:40:59 +03:00
ator-dev dfb405b702 Fix "Download Project Source" for Web Editor
- Correctly pass safe project name and safe datetime to `vformat`
2023-03-21 19:20:52 +00:00
bruvzg 0b0587af97
[Web] Fix some missing keycode mappings. 2023-03-06 11:55:49 +02:00
Rémi Verschelde 4574b97752
Fix crash with bogus shape index to DisplayServer.cursor_set_custom_image()
Fixes #66605.
2023-02-17 14:17:37 +01:00
bruvzg a322f3f578
[InputEventKey] Avoid setting both key and modifier to the same value. 2023-02-14 09:05:58 +02:00
Emmanouil Papadeas c36460060e
Further refactoring to AudioDriver implementations after #69120.
- Rename all instances of `capture_start()` and `capture_end()` to their new
  names. Fixes #72892.
- More internal renames to match what was started in #69120.
- Use `override` consistently so that such refactoring bugs can be caught.
- Harmonize the order of definition of the overridden virtual methods in each
  audio driver.
- Harmonize prototype for `set_output_device` and `set_input_device`.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2023-02-09 11:02:00 +01:00
Fabio Alessandrelli 7cd80e6a6d [Net] Remove StreamPeerTLS.blocking_handshake option.
Which was unused internally, and can be replaced by:

```
while tls.get_status() == tls.STATUS_HANDSHAKING:
  tls.poll()
```
2023-01-28 11:08:02 +01:00
Fabio Alessandrelli adba870534 [NET] Refactor TLS configuration.
Use a TLSOptions configuration object which is created via static
functions.

- "TLSOptions.client": uses the standard CA and common name verification.
- "TLSOptions.client_unsafe": uses optional CA verification (i.e. if specified)
- "TLSOptions.server": is the standard server configuration (chain + key)

This will allow us to expand the TLS configuration options to include
e.g. mutual authentication without bloating the classes that uses
StreamPeerTLS and PacketPeerDTLS as underlying peers.
2023-01-28 11:08:02 +01:00
bruvzg daad4aed62
Cleanup and unify keyboard input.
- Unify keycode values (secondary label printed on a key), remove unused hardcoded Latin-1 codes.
- Unify IME behaviour, add inline composition string display on Windows and X11.
- Add key_label (localized label printed on a key) value to the key events, and allow mapping actions to the unshifted Unicode events.
- Add support for physical keyboard (Bluetooth or Sidecar) handling on iOS.
- Add support for media key handling on macOS.

Co-authored-by: Raul Santos <raulsntos@gmail.com>
2023-01-23 15:08:12 +02:00
Rémi Verschelde fd314209eb
Web Editor: Fix callable binding for Download Zip menu item
Fixes #71702.
2023-01-20 12:08:00 +01:00
Fabio Alessandrelli 4707e78d6d [Web] User FS (user://) now correctly uses project name.
This allows multiple instances to co-exist in the same domain while
keeping their user data separate (each in its own folder).
2023-01-18 09:12:21 +01:00