Commit Graph

4310 Commits

Author SHA1 Message Date
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
Pedro J. Estébanez 958ecf55fe Enhance portability of threading 2022-10-04 11:43:28 +02:00
Rémi Verschelde 4eaa59d0ed Merge pull request #66773 from MladoniSzabi/numpad-no-numlock-bug-linux
Remapped the numpad keys on linux when numlock is off
2022-10-04 11:29:01 +02:00
Rémi Verschelde 68765b8831 Merge pull request #66274 from Calinou/engine-rename-max-fps
Rename `Engine.target_fps` and associated project setting to `max_fps`
2022-10-04 11:19:56 +02:00
Rémi Verschelde b7c68b343d Merge pull request #66832 from bruvzg/cmd_p_fix
[macOS] Fix ⌘ + . + other modifier triggering twice.
2022-10-04 11:19:41 +02:00
Rémi Verschelde 02e9e2d3c0 Merge pull request #66559 from zaevi/fix_ScrollContainer_touch_scroll
Fix ScrollContainer touch-scrolling not working.
2022-10-04 10:30:31 +02:00
Rémi Verschelde 9928cdc2e7 Merge pull request #66807 from akien-mga/core-unix-remove-NO_FCNTL-and-NO_STATVFS
Unix: Remove now unnecessary I/O defines, cleanup
2022-10-04 10:22:29 +02:00
Rémi Verschelde cd7f172cf8 Merge pull request #66804 from akien-mga/core-remove-NO_SAFE_CAST
Remove unsupported `NO_SAFE_CAST`/`-fno-rtti` from Android build
2022-10-04 10:22:24 +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
bruvzg bfbbe9c1d0
[macOS] Fix ⌘ + . + other modifier triggering twice. 2022-10-03 20:44:50 +03:00
MladoniSzabi cc0fd7e783 Remapped the numpad keys on linux when numlock is off
On Linux, when using the numpad while numlock is off doesn't do
anything. Made the numpad keys map to the correct control keys.

Resolves: #54814.
2022-10-03 12:53:42 +01:00
Rémi Verschelde f501e4f665 Unix: Remove now unnecessary I/O defines, cleanup
- `LIBC_FILEIO_ENABLED` wasn't defined anywhere, even in _other platforms_.
- `NO_NETWORK` is also never defined. It probably isn't enough anyway to
  disable network APIs in the current codebase.
- `UNIX_SOCKET_UNAVAILABLE` is never defined in this code but used by some
  other platforms, clarify that.
- `NO_STATVFS` can be removed as Android supports it since API level 19,
  which is our current min SDK level. It's also only used for
  `DirAccessUnix::get_space_left()` which is anyway overridden by
  `DirAccessJAndroid::get_space_left()` so it shouldn't make a difference.
  * Fixed documentation for `DirAccess.get_space_left()`.
- `NO_FCNTL` is likely also a remnant of early Android days, in current NDK
  r23 it seems to be available. Also cleaned up unused `fcntl.h` includes.
- `NO_ALLOCA` is never defined, and we use alloca in many places now.
2022-10-03 12:33:41 +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
Rémi Verschelde 82b87d7a17 Remove unsupported `NO_SAFE_CAST`/`-fno-rtti` from Android build
Android was the last platform to still attempt to disable RTTI (for binary
size), but both the Android editor and now the ICU library used by templates
need RTTI.

There could still be the possibility to support this for non-ICU template
builds (i.e. without the TextServerAdvanced module), but since this isn't one
of the build configurations we test regularly it's pretty risky to keep this
option only for that specific use case. And our code is already littered with
`dynamic_cast`s which weren't guarded with `!defined(NO_SAFE_CAST)`.
2022-10-03 11:18:31 +02:00
Matthew Munro (mam552) 0f5b448a9c Fix inconsistent window state on X11.
Fixes #66413.
DisplayServerX11 tracks some internal state about whether the window is
fullscreen, minimized, maximized or none. This commit queries the
display server when the window changes, so that this internal state can
be correctly updated.
2022-10-01 16:01:28 -06:00
Rafał Mikrut 2233624152 Remove usage of unitialized variables 2022-10-01 21:09:22 +02:00
Rémi Verschelde ef8834a642 Merge pull request #64784 from yedpodtrzitko/yed/ci-add-mypy
ci: add Python static analysis check via mypy
2022-09-30 17:44:39 +02:00
Rémi Verschelde 166df0896c Fix typos with codespell
Using codespell 2.3-dev from current git.

And fix typo in `methods.py` for `vsproj=yes` option (still won't work
though).
2022-09-30 14:23:36 +02:00
Jiri Suchan c5bd2f9dce ci: add Python static analysis check via mypy 2022-09-30 19:03:17 +07:00
Rémi Verschelde f47979f087
Merge pull request #66242 from akien-mga/scons-unify-tools-target 2022-09-30 12:28:50 +02:00
Rémi Verschelde e5857bd6c7 Merge pull request #66548 from akien-mga/msvc-warnings-c4701-c4703
Fix MSVC warnings C4701 and C4703: Potentially uninitialized variable used
2022-09-28 20:47:50 +02:00
Zae 186ca020b3 Fix ScrollContainer touch-scrolling not working. 2022-09-29 01:47:03 +08:00
Rémi Verschelde 85fe6ecc32 Fix MSVC warnings C4701 and C4703: Potentially uninitialized variable used 2022-09-28 17:05:34 +02:00
Rémi Verschelde 0e53dd642c Fix MSVC warning C4706: assignment within conditional expression
Part of #66537.
2022-09-28 16:05:07 +02:00
bruvzg 4421378089
[Windows] Ignore excessive wintab mouse move events. 2022-09-28 10:12:04 +03: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 49fcf4ffad Style: Cleanup header guards for consistency
Fix file names for {Static,Lightmap}RaycasterEmbree.
2022-09-26 13:51:17 +02:00
Rémi Verschelde 67f700d726
Merge pull request #66377 from bruvzg/macos_menu_cb_deferred
[macOS] Process menu callback after event processing step to avoid event queue corruption.
2022-09-25 08:38:10 +02:00
Rémi Verschelde 39be6695d1
Merge pull request #66295 from bruvzg/win_fix_wm_char_keysym
[Windows] Fix WM_CHAR processing code using Unicode char instead of Virtual key.
2022-09-24 22:59:44 +02:00
bruvzg b66931946b
[macOS] Process menu callback after event processing step to avoid event queue corruption. 2022-09-24 23:57:24 +03:00
Rémi Verschelde 26e9145c26 SCons: Cleanup `DEBUG`, `_DEBUG` and `NDEBUG` defines
- `_DEBUG` is MSVC specific so it didn't make much sense to define for
  Android and iOS builds.
- iOS was the only platform to define `DEBUG`. We don't use it anywhere
  outside thirdparty code, which we usually don't intend to debug, so it
  seems better to be consistent with other platforms.
- Consistently define `NDEBUG` to disable assert behavior in both `release`
  and `release_debug` targets. This used to be set for `release` for all
  platforms, and `release_debug` for Android and iOS only.
- Due to the above, I removed the only use we made of `assert()` in Godot
  code, which was only implemented for Unix anyway, should have been
  `DEV_ENABLED`, and is in PoolAllocator which we don't actually use.
- The denoise and recast modules keep defining `NDEBUG` even for the `debug`
  target as we don't want OIDN and Embree asserting all over the place.
2022-09-23 15:21:26 +02:00
Rémi Verschelde c5c3d13dc0 SCons: Remove redundant `-fomit-frame-pointer` and `-ftree-vectorize`
- `-fomit-frame-pointer` is included automatically by both GCC and
  Clang in `-O1` and above.
- `-ftree-vectorize` is included automatically by GCC in `-O2` and
  beyond, and seems always enabled by Clang.

Closes #66296. See that issue for a detailed investigation.
2022-09-23 13:56:16 +02:00
bruvzg 54adfb6dfd [Windows] Fix WM_CHAR processing code using Unicode char instead of Virtual key. 2022-09-23 14:16:16 +03:00
bruvzg 0dab11afa4
[macOS extend-to-title] Add scene/project name to the editor title, fix incorrect window button position/order when system primary language is RTL. 2022-09-22 23:09:56 +03:00
Rémi Verschelde 0b06f8b0bd Merge pull request #65816 from bruvzg/proj_settings_missing_flags
Add missing initial window flags and window mode to the project settings.
2022-09-21 18:56:31 +02:00
bruvzg cdfa50dbe9
[macOS] Improve "extended to title" transition to / from fullscreen. 2022-09-21 11:21:48 +03:00
bruvzg 0ed4cc6287
[macOS] Add an option to align window buttons in "extend to title" mode. 2022-09-20 12:55:59 +03: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
bruvzg d104a4cdbd
Add missing initial window flags and window mode to the project settings. 2022-09-19 12:30:10 +03:00
kobewi 9f2dc68279 Replace File/Directory with FileAccess/DirAccess 2022-09-19 11:03:31 +02:00
Rémi Verschelde 04082597f9 Merge pull request #65975 from Faless/web/4.x_features_detection
[Web] Add feature detection helpers to JS Engine class.
2022-09-18 00:43:13 +02:00
Rémi Verschelde d0d22bfa5e Merge pull request #65331 from derammo/derammo_natvis_3
Add more data structures to Natvis for Visual Studio
2022-09-18 00:43:06 +02:00
Fabio Alessandrelli 6bbde346ab [Web] Add feature detection helpers to JS Engine class. 2022-09-17 11:21:17 +02:00
MJacred ac9786c525 Add get_distribution_name() and get_version() to OS
supports: LinuxBSD, Windows, macOS, iOS, Android, UWP

Co-authored-by: bruvzg
2022-09-16 11:17:36 +02:00
Rémi Verschelde d79040e7eb Merge pull request #65496 from MinusKube/popup-capture-mouse-bug
Fix MOUSE_MODE_CAPTURED not working correctly with popups
2022-09-16 09:23:40 +02:00
bruvzg 89c68bb22d
[macOS] Remove tabs for "Quit" menu item. 2022-09-15 22:27:27 +03:00
bruvzg 734b89124e
[macOS] Fix redraw lag at the edge of the resizing window. 2022-09-15 17:08:12 +03:00
Rémi Verschelde 5ff8e4ee67 Merge pull request #65133 from bruvzg/win_cursor
[Windows] Simplify cursor handling and add support for fully transparent cursors.
2022-09-14 17:42:53 +02:00
bruvzg d46bc8f4ac
[macOS, 4.0] Fix unresponsive redraw during live resizing. 2022-09-14 09:59:00 +03: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
Ted Spikes 21f7bd0723 Check for ios_simulator when building for x86_64 2022-09-13 14:04:08 +03:00
Rémi Verschelde ff824b6f9d Merge pull request #65509 from gotnospirit/master-os-get_datetime
get_datetime_* functions can return wrong values
2022-09-13 11:01:12 +02:00
Rémi Verschelde 5c1ef35def Merge pull request #65262 from bruvzg/win10_dm
Disable dark mode title bar on Windows 10.
2022-09-13 10:58:19 +02:00
Rémi Verschelde ad09e67894
Merge pull request #65682 from m4gr3d/update_editor_versioning_main 2022-09-13 10:38:21 +02:00
Rémi Verschelde f8ec046b14
Merge pull request #65704 from akien-mga/web-editor-fix-some-errors
Fix some errors affecting the Web editor
2022-09-13 08:31:59 +02:00
clayjohn 96b7cb66df Fix multiwindow support in GLES3 for X11, Windows, and MacOS.
Instead of updating all viewports, then blitting all viewports
to the backbuffer, then swapping all buffers, we run through
all viewports and render, blit, and swap backbuffer before
going to the next viewport.
2022-09-12 17:30:50 -07:00
Fredia Huya-Kouadio 1efafa9dfe Exclude small screens from the set of supported devices. 2022-09-12 09:47:34 -07:00
Fredia Huya-Kouadio 67b38d0ac2 Update the versioning logic for the Godot Android Editor
This is necessary to separate subsequent uploads to the Google Play store as each upload needs to increment the version code.
2022-09-12 09:47:07 -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
James 0aecfc9254 Fixes #65377: get_datetime_* functions can return wrong values 2022-09-10 07:58:38 +08:00
Yuri Sizov d2a6a187f4
Merge pull request #44118 from Calinou/windows-enable-ansi-escape-codes
Enable ANSI escape code processing on Windows 10 and later
2022-09-08 19:53:04 +03: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 69233093d7 Merge pull request #65241 from bruvzg/no_keymap_ambiguity
Fix key mapping changes when moving from macOS to other platform.
2022-09-08 09:24:24 +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
Rémi Verschelde df5a356e6c Merge pull request #65501 from m4gr3d/fix_invalid_project_manager_path_main
Fix issue causing the project manager to crash because of missing path argument
2022-09-08 09:19:25 +02:00
Fabio Alessandrelli a95d792420 [Net] Rename "ssl" references to "tls" in methods and members. 2022-09-08 03:24:23 +02:00
Fredia Huya-Kouadio cd544fd86b Fix issue causing the project manager to crash because of missing path argument
In the process, the initialization logic is updated to show an error message and gracefully close the engine when setup errors occur.
2022-09-07 14:21:34 -07:00
Fredia Huya-Kouadio c3c0bea615 Enable long press, pan and scale gestures for the Godot Android Editor
Fix the bug causing the editor to crash when running the project.
2022-09-07 13:30:10 -07:00
Fredia Huya-Kouadio 1b3511ad49 Cleanup the Android input logic implementation 2022-09-07 13:30:10 -07:00
MinusKube 06b86fad0d Fix MOUSE_MODE_CAPTURED not working correctly with popups 2022-09-07 19:31:57 +02:00
bruvzg 6f4d233062
Fix key mapping changes when moving from macOS to other platform
Removes separate `Command` key (use `Meta` instead).
Adds an event flag to automatically remap `Command` <-> `Control` (cannot be set alongside `Control` or `Meta`).
2022-09-07 18:45:35 +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
Rémi Verschelde 5062aafc2d Merge pull request #64417 from aaronfranke/has-space
Replace AABB/Rect2/Rect2i has_no_* methods with has_* methods
2022-09-06 17:00:44 +02:00
Micky b6daad8d4b Rename `range_lerp` to `remap` 2022-09-06 07:19:20 +02:00
Aaron Franke 995b9f94e8
Replace Rect2(i) has_no_area with has_area 2022-09-04 23:03:36 -05:00
MatthewZelriche ef02f06b8c Fix XSendEvent crash & bootsplash.
Fixes a crash due to an Xlib error, as well as ensures that Godot
holds the correct size of the window after window modes have been
applied, before exiting the DisplayServerX11 constructor. This ensures
the bootsplash will be displayed with the correct dimensions.

Fixes #65320
2022-09-04 16:46:37 -06:00
derammo 0c46b5f8e9 added more data structures to Natvis for msdev
can now debug signal_map and connections in Objects
can now view more Variant types, such as packed arrays
2022-09-04 12:06:26 -04:00
Jiri Suchan c69b22124e fix: graceful exit on macOS missing Vulkan 2022-09-04 12:00:47 +09:00
Rémi Verschelde 042050a47c
Merge pull request #65283 from bruvzg/reenable_per_pix_transp
Re-enable per-pixel transparency support on Linux, macOS, and Windows.
2022-09-03 23:52:18 +02:00
Rémi Verschelde 7ced3a6e37
Merge pull request #65111 from MatthewZelriche/DroppedXEventFix
Fix dropped XEvents early in main window lifetime.
2022-09-03 20:36:39 +02:00
bruvzg 57829b7cc4
Re-enable per-pixel transparency support on Linux, macOS, and Windows (for Vulkan and OpenGL rendering drivers). 2022-09-03 19:16:03 +03:00
bruvzg 6ce0d3a212 Disable dark mode title bar on Windows 10. 2022-09-03 11:11:22 +03:00
Raul Santos 471c9c2969
Add support for system dark mode (Linux)
- Use `org.freedesktop.appearance color-scheme` to support system dark mode.
2022-09-02 16:49:21 +02:00
Geequlim 48f9069f3a Rename JavaScript singleton to JavaScriptBridge 2022-09-02 21:11:15 +08:00
Rémi Verschelde fe0b893dc7 Merge pull request #65242 from bruvzg/menu_event_multiwindow 2022-09-02 13:55:37 +02:00
Rémi Verschelde f81a4b2478 Merge pull request #65026 from bruvzg/dark_mode 2022-09-02 13:54:46 +02:00
bruvzg f255ecb241
[macOS] Simplify handling of menu accelerators, and send event to the focused window instead of main. 2022-09-02 13:56:27 +03:00
Rémi Verschelde 027415312e
Merge pull request #65132 from bruvzg/global_menu_shortcuts_context 2022-09-01 17:02:04 +02:00
MatthewZelriche 91ba9bcb03 Fix dropped XEvents early in main window lifetime.
The DisplayServerX11 constructor processes pending events shortly
after constructing the main window. However, it discards pending events
on the event queue that it is not interested in. This results in these
events never making it to the main events thread and as a result are
never processed. We need to save the events we don't handle in
DisplayServerX11 so that they can be resent for later handling by the
events thread.
2022-09-01 07:42:03 -06:00
Rémi Verschelde d454b944e7
Merge pull request #65107 from MatthewZelriche/X11MinimizeMaximizeFix
Fix minimize/maximize not taking effect in X11.
2022-09-01 08:43:43 +02:00
bruvzg b85a4c5d79
[macOS] Handle accelerator and click events of the global menu items separately. 2022-09-01 08:13:56 +03:00
bruvzg 629ae58a80
Add support for system dark mode and accent color detection (macOS and Windows). Add support for dark mode title bar on Windows. 2022-08-31 11:37:01 +03:00
bruvzg 77a4567122
[Windows] Simplify cursor handling and add support for fully transparent cursors. 2022-08-31 11:16:02 +03:00
Rémi Verschelde c80ea41e3b
Merge pull request #65095 from m4gr3d/update_get_current_dir_main
Additional fixes to the Android `get_current_dir()` implementation.
2022-08-31 09:00:53 +02:00