Commit graph

173 commits

Author SHA1 Message Date
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
Rémi Verschelde 68d71f88f5
Improve DisplayServer message for video card drivers failure
And remove leftover duplicated message on Android.
2023-01-17 15:41:54 +01:00
Yuri Sizov 4c1f11944e Update all outdated online documentation links 2023-01-14 19:38:00 +03:00
Rémi Verschelde 8716c12ead
Merge pull request #71325 from reduz/refactor-project-setting-overrides
Refactor ProjectSetting overrides
2023-01-13 18:03:15 +01:00
Rémi Verschelde 3dffe0b967
Merge pull request #63312 from bruvzg/one_click
[Export] Add one-click deploy over SSH for the desktop exports.
2023-01-13 18:00:18 +01:00
Juan Linietsky 6f0e210093 Refactor ProjectSetting overrides
* Overrides no longer happen for set/get.
* They must be checked with a new function: `ProjectSettings::get_setting_with_override()`.
* GLOBAL_DEF/GLOBAL_GET updated to use this

This change solves many problems:
* General confusion about getting the actual or overriden setting.
* Feature tags available after settings are loaded were being ignored, they are now considered.
* Hacks required for the Project Settings editor to work.

Fixes #64100. Fixes #64014. Fixes #61908.
2023-01-13 15:13:56 +01:00
Fabio Alessandrelli 6b2abf4605
Merge pull request #70626 from Faless/web/4.x_expose_force_fs_sync
[Web] Expose API to force file system sync.
2023-01-09 21:18:47 +01:00
dependabot[bot] a20c8443af
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>
2023-01-09 13:40:10 +00:00
Juan Linietsky 2b815df3c1 Use BitField<> in core type masks
* All core types masks are now correctly marked as bitfields.
* The enum hacks in MouseButtonMask and many other types are gone. This ensures that binders to other languages non C++ can actually implement type safe bitmasks.
* Most bitmask operations replaced by functions in BitField<>
* Key is still a problem because its enum and mask at the same time. While it kind of works in C++, this most likely can't be implemented safely in other languages and will have to be changed at some point. Mostly left as-is.
* Documentation and API dump updated to reflect bitfields in core types.
2023-01-08 22:17:40 +01:00
bruvzg 2718a7b7d3
Add support for the custom initial screen for the main window, fix primary screen detection. 2023-01-07 11:14:35 +02:00
Rémi Verschelde d95794ec8a
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".
2023-01-05 13:25:55 +01:00
bruvzg cebefc9f5d
[Export] Add one-click deploy over SSH for the desktop exports.
Add one-click deploy over SSH for the desktop exports.
Add ZIP export option for Linux and Windows.
Change export plugin icons to SVG format.
2022-12-29 09:42:00 +02:00
Fabio Alessandrelli 615fd98620 [Web] Expose API to force file system sync.
Mostly useful for modules and extensions that can't use FileAccess to
write files.
2022-12-27 12:33:41 +01:00
Rémi Verschelde f1edd03d4c
Merge pull request #69718 from groud/finally_rename_gdnative_to_gdextension
Rename all gdnative occurences to gdextension
2022-12-12 11:43:59 +01:00
Gilles Roudière be1c9d677d Rename all gdnative occurences to gdextension
Non-exhaustive list of case-sensitive renames:

GDExtension -> GDNative
GDNATIVE -> GDEXTENSION
gdextension -> gdnative
ExtensionExtension ->Extension (for where there was GDNativeExtension)
EXTENSION_EXTENSION ->EXTENSION (for where there was GDNATIVE_EXTENSION)
gdnlib -> gdextension
gdn_interface -> gde_interface
gdni -> gde_interface
2022-12-12 11:04:57 +01:00
Rémi Verschelde 0a3f66471e
Merge pull request #69712 from bruvzg/real_size
Rename `window_get_real_size`, add position counterpart.
2022-12-07 14:29:46 +01:00
bruvzg edf13eb5a6
Rename window_get_real_size to window_get_size_with_decorations, add window_get_position_with_decorations. 2022-12-07 11:07:30 +02:00
Markus Sauermann e18107a57c Fix Determining Window for Touchscreen
DisplayServer::screen_is_touchscreen will likely never utilize its
parameter p_screen.
This PR replaces this function by DisplayServer::is_touchscreen_available()
with the same functionality.
This solves the problem, that a SubViewport was used for determining
the screen, which resulted in error messages.
2022-12-07 09:54:29 +01:00
Rémi Verschelde 7ef9947d0e
Merge pull request #68870 from dsnopek/master-webxr-input
Get WebXR fully working in Godot 4!
2022-12-02 12:24:40 +01:00
David Snopek 310bf39cd3 Get WebXR fully working in Godot 4! 2022-12-01 21:46:30 -06:00
Rémi Verschelde 23f3adb7a0
Merge pull request #67815 from Calinou/html5-improve-feature-errors
Improve feature errors in HTML5 for easier understanding
2022-11-28 08:40:39 +01:00
Zae bc9bf00e4a Fix viewport doesn't auto-resize on Web. 2022-11-08 18:33:24 +08:00
Fabio Alessandrelli 3ff7964145 [Web] Force WebGL2 when supported. 2022-11-05 14:06:09 +01:00
Fabio Alessandrelli cece83fdf2 [Web] Improve Godot shutdown and cleanup. 2022-11-05 14:06:09 +01:00
Rémi Verschelde f7c611ab71
Style: Misc docs and comment style and language fixes
- Removed empty paragraphs in XML.
- Consistently use bold style for "Example:", on a new line.
- Fix usage of `[code]` when hyperlinks could be used (`[member]`, `[constant]`).
- Fix invalid usage of backticks for inline code in BBCode.
- Fix some American/British English spelling inconsistencies.
- Other minor fixes spotted along the way, including typo fixes with codespell.
- Don't specify `@GlobalScope` for `enum` and `constant`.
2022-11-02 19:01:18 +01:00
Rémi Verschelde 90e337e081
CI: Update minimatch npm dependency to silence security report
No risk for us as this is only used for static checks on CI.
2022-10-31 11:52:52 +01:00
Clay John 04ac91f786
Merge pull request #67790 from kdada/fix-flash-window
Make creating window do not flicker when specify custom position
2022-10-28 13:02:58 -07:00
Wei Guo d7e39e313b Make window creation with custom position do not flash 2022-10-24 13:50:25 +08:00
Hugo Locurcio 8fcd54d13e
Improve feature errors in HTML5 for easier understanding 2022-10-23 19:13:42 +02:00
David Snopek 398ee08375 Add multiview to the opengl3 driver 2022-10-21 21:00:32 -05:00
Fabio Alessandrelli 40d60ca6ae [WebSocket] Fix debugger implementation.
Register module during core initialization so the remote debugger can
properly handle the "wss://" protocol.
2022-10-13 17:25:29 +02:00
Fabio Alessandrelli a06602363c [Web] Add the "serve" and "run" scons targets.
You can now run the test HTTP server by calling:

scons p=web serve

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

scons p=web 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.
2022-10-12 22:29:35 +02:00
Rémi Verschelde 06dc4648bf Merge pull request #67252 from zaevi/web_fix_export_file_locked
[Web] Fix file locked issue when exporting to Web.
2022-10-12 14:44:32 +02:00
Fabio Alessandrelli 9a653ebeac [Web] Add auto-formatting to HTML files.
Uses html-eslint for HTML file and eslint-plugin-html for inline
JavaScript.

Use HTML5 (not XHTML), remove CDATA and trailing slashes for self
closing tags.

Add format checks to CI.
2022-10-11 19:42:12 +02:00
Zae 55a491114a Fix file locked issue when exporting to Web. 2022-10-11 20:49:51 +08:00
Zae bf61af6ae9 Fix Object type in GodotJSWrapper. 2022-10-10 19:28:43 +08:00
Jason Knight c2d7f7fb4c Change auto to default in cursor css settings. 2022-10-07 10:53:49 -06:00
Rémi Verschelde 4bf3199000 Merge pull request #64886 from Calinou/web-editor-add-local-web-server-2
Replace local web server setup for web editor with a Python-based solution
2022-10-05 08:36:19 +02:00
Hugo Locurcio 1be1b15a57
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>
2022-10-04 19:39:27 +02:00
Hugo Locurcio 1c6c72caf1
Rename Engine.target_fps and associated project setting to max_fps
This makes the setting easier to find, as research has found there are
numerous use cases to limiting FPS. This also improves documentation
related to the Engine property and project setting.

The project setting also works in projects exported in release mode,
so its location in the `debug/` section was misleading.
2022-10-03 23:54:36 +02:00
Rémi Verschelde 54418ea659 Remove NO_THREADS fallback code, Godot 4 requires thread support
This also removes `OS::can_use_threads` from the public API since it's always
true.
2022-10-03 11:23:26 +02:00
Jiri Suchan c5bd2f9dce ci: add Python static analysis check via mypy 2022-09-30 19:03:17 +07:00
Rémi Verschelde 39facb35a0 SCons: Unify tools/target build type configuration
Implements https://github.com/godotengine/godot-proposals/issues/3371.

New `target` presets
====================

The `tools` option is removed and `target` changes to use three new presets,
which match the builds users are familiar with. These targets control the
default optimization level and enable editor-specific and debugging code:

- `editor`: Replaces `tools=yes target=release_debug`.
  * Defines: `TOOLS_ENABLED`, `DEBUG_ENABLED`, `-O2`/`/O2`
- `template_debug`: Replaces `tools=no target=release_debug`.
  * Defines: `DEBUG_ENABLED`, `-O2`/`/O2`
- `template_release`: Replaces `tools=no target=release`.
  * Defines: `-O3`/`/O2`

New `dev_build` option
======================

The previous `target=debug` is now replaced by a separate `dev_build=yes`
option, which can be used in combination with either of the three targets,
and changes the following:

- `dev_build`: Defines `DEV_ENABLED`, disables optimization (`-O0`/`/0d`),
  enables generating debug symbols, does not define `NDEBUG` so `assert()`
  works in thirdparty libraries, adds a `.dev` suffix to the binary name.

Note: Unlike previously, `dev_build` defaults to off so that users who
compile Godot from source get an optimized and small build by default.
Engine contributors should now set `dev_build=yes` in their build scripts or
IDE configuration manually.

Changed binary names
====================

The name of generated binaries and object files are changed too, to follow
this format:

`godot.<platform>.<target>[.dev][.double].<arch>[.<extra_suffix>][.<ext>]`

For example:
- `godot.linuxbsd.editor.dev.arm64`
- `godot.windows.template_release.double.x86_64.mono.exe`

Be sure to update your links/scripts/IDE config accordingly.

More flexible `optimize` and `debug_symbols` options
====================================================

The optimization level and whether to generate debug symbols can be further
specified with the `optimize` and `debug_symbols` options. So the default
values listed above for the various `target` and `dev_build` combinations
are indicative and can be replaced when compiling, e.g.:

`scons p=linuxbsd target=template_debug dev_build=yes optimize=debug`
will make a "debug" export template with dev-only code enabled, `-Og`
optimization level for GCC/Clang, and debug symbols. Perfect for debugging
complex crashes at runtime in an exported project.
2022-09-26 16:31:46 +02:00
Rémi Verschelde aa553f4030 Merge pull request #65745 from akien-mga/scons-production-lto-earlier
Refactor handling of `production` flag and per-platform LTO defaults
2022-09-20 09:45:33 +02:00
Rémi Verschelde 7da532275b Merge pull request #65541 from clayjohn/renderer-setting
Split rendering driver project setting into renderer_name and rendering_driver
2022-09-20 09:43:59 +02:00
clayjohn 4a1c7de57c Split rendering driver project setting into renderer_name and rendering_driver. To differentiate between a driver (e.g. Vulkan or D3D12) and a renderer (e.g. clustered or mobile renderer). 2022-09-19 10:26:10 -07:00
Rémi Verschelde 35a15e6191 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>
2022-09-19 18:11:29 +02:00
Fabio Alessandrelli 6bbde346ab [Web] Add feature detection helpers to JS Engine class. 2022-09-17 11:21:17 +02:00
Fredia Huya-Kouadio 9d5e48f873 Disable menus and functionality that are not relevant on the Android Editor port 2022-09-13 20:48:33 -07:00
Rémi Verschelde 1513d76cb9 Fix some errors affecting the Web editor
- Don't warn about minimized/maximized modes not being available.
- Blender and FBX export both depend on running thirdparty applications,
  which can't be done (easily at least) for Web and Android editors.
- Editor theme complained about not being able to retrieve texture data
  for an icon. It was only used once so instead of flipping at runtime,
  let's just add a flipped icon.

Part of #65702.
2022-09-12 16:29:45 +02:00
Fabio Alessandrelli 27f22b29f8 [Web] Small fixes and enhancements.
- "Definitive" fix for ENOENT randomly disappearing from emscripten.
- Proper shutdown when setup fails.
- Re-enable WebGL explicit buffer swap.
- Re-enable optional per-pixel transparency.
- Add type cast to make closure compiler happy.
- Remove emscripten Safari WebGL workaround.
- Improve AudioWorklet cleanup.
2022-09-11 09:45:09 +02:00
Rémi Verschelde c2c659db32 SCons: Refactor LTO options with lto=<none|thin|full>
Adds support for LTO on macOS and Android. We don't have much experience
with LTO on these platforms so for now we keep it disabled by default
even when `production=yes` is set.

Similarly for iOS where we ship object files for the user to link in
Xcode so LTO makes builds extremely slow to link.

`production=yes` defaults to full LTO.
ThinLTO is much faster for LLVM-based compilers but seems to produce
bigger binaries (at least for the Web platform).
2022-09-08 10:00:02 +02:00
Rémi Verschelde a51dc70dfb Merge pull request #65460 from Faless/net/4.x_ssl_to_tls_more
[Net] Rename "ssl" references to "tls" in methods and members.
2022-09-08 09:20:19 +02:00
Fabio Alessandrelli a95d792420 [Net] Rename "ssl" references to "tls" in methods and members. 2022-09-08 03:24:23 +02:00
Fabio Alessandrelli 86dd3f312c [Web] Enable Web exporter in non-dev mode.
We now have a working OpenGL3/WebGL2 renderer, but extra work is needed
in project manager and editor to simplify the creation of OpenGL3
projects.
2022-09-07 11:58:30 +02:00
Fabio Alessandrelli fffdbb38e3
Merge pull request #65239 from Geequlim/js2web
Rename JavaScript singleton to JavaScriptBridge
2022-09-07 09:29:42 +02:00
Fabio Alessandrelli 528e791a5f [Net] Rename StreamPeerSSL to StreamPeerTLS.
SSL has been deprectated almost 10 years ago.
2022-09-07 07:38:50 +02:00
Geequlim 48f9069f3a Rename JavaScript singleton to JavaScriptBridge 2022-09-02 21:11:15 +08:00
Rémi Verschelde 87f9038ca0
Merge pull request #65094 from Faless/web/4.x_templates_refactor
[Web] Require threads, rtti, allow optimize=speed.
2022-08-30 23:57:02 +02:00
Fabio Alessandrelli f958f00283 [Web] Require threads, rtti, allow optimize=speed.
Update export names (web[_dlink]_[release|debug].zip).

The Build with dynamic linking is broken due to high number of imports
in output wasm (likely emscripten regression issue 15487).
2022-08-30 20:01:19 +02:00
Aaron Franke 10a56981dc
Rename String plus_file to path_join 2022-08-29 19:38:13 -05:00
Fabio Alessandrelli d20b32186f [Web] Rename JavaScript platform to Web.
Also rename export name from "HTML5" to "Web".
2022-08-29 11:52:00 +02:00