Commit graph

361 commits

Author SHA1 Message Date
Rémi Verschelde
8017827144 SCons: Re-enable treating #warning as error with werror
Replace all TODO uses of `#warning` by proper TODO comments, and will open
matching bug reports to keep track of them.

We don't have a great track record fixing TODOs, but I'd wager we're even
worse for fixing these "TODO #warning" so we should prohibit this usage.
2022-10-10 16:12:26 +02:00
Rémi Verschelde
5b6ccf2fd2 Merge pull request #66720 from qarmin/unintialized_memory
Remove usage of unitialized variables
2022-10-05 11:42:47 +02:00
Rémi Verschelde
2c94470dd1 Merge pull request #63983 from Calinou/scons-linux-execinfo-musl
Automatically use execinfo for crash handler on *BSD and musl-based Linux
2022-10-05 08:29:59 +02:00
Hugo Locurcio
8e04bffbcf
Automatically use execinfo for crash handler on *BSD and musl-based Linux
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2022-10-04 19:40:19 +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
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
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
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
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
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
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
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
James
0aecfc9254 Fixes #65377: get_datetime_* functions can return wrong values 2022-09-10 07:58:38 +08: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
MinusKube
06b86fad0d Fix MOUSE_MODE_CAPTURED not working correctly with popups 2022-09-07 19:31:57 +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
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
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
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
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
MatthewZelriche
87937bcf87 Fix minimize/maximize not taking effect in X11.
Attempts to construct an X11 window in an initial state of
minimized/maximized would fail due to the window being unmapped.
We simply check for failed mode changes during an unmap and reapply
them if necessary.
2022-08-30 12:52:24 -06:00
Rémi Verschelde
432b25d364
Merge pull request #65066 from aaronfranke/str-path-join 2022-08-30 10:01:11 +02:00
MatthewZelriche
37f3b9f1ef Fix fullscreen on X11.
Attempts to set a Godot window to fullscreen prior to the window being
mapped would silently fail. This commit uses
_window_fullscreen_check to test if a window had been set to fullscreen
while unmapped, and if so, resets it to fullscreen once the window has
been successfully mapped.

Fixes #54065
2022-08-29 19:11:20 -06:00
Aaron Franke
10a56981dc
Rename String plus_file to path_join 2022-08-29 19:38:13 -05:00
Rémi Verschelde
c08e84af0d
Merge pull request #64943 from MatthewZelriche/FixUnMappedAncestor 2022-08-29 08:19:50 +02:00
Rémi Verschelde
67e731d450
Merge pull request #64507 from RandomShaper/remove_unused
Remove unused `force_quit` variable from many OS abstractions
2022-08-27 18:42:20 +02:00
MatthewZelriche
93af2993f0 Fix X11 menu window bug.
Fixes an issue where XSetInputFocus fails due to the window not
being viewable.

Fixes #62635
Fixes #60690
2022-08-27 07:38:09 -06:00
Pedro J. Estébanez
6e647dea24 Remove unused force_quit variable from many OS abstractions 2022-08-27 13:41:53 +02:00
Rémi Verschelde
fce3602a1e Linux: Fix GNU ld detection for pck_embed linker script 2022-08-26 14:06:56 +02:00
Hugo Locurcio
ce56743aa1
Improve platform-specific READMEs to add useful links
This also adds READMEs for all platforms.
2022-08-25 17:50:53 +02:00
Aaron Franke
27b0f18275 Unify bits, arch, and android_arch into env["arch"]
Fully removes the `bits` option and adapts the code that relied on it.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2022-08-25 11:19:20 +02:00
kobewi
8be27dc59e Replace Array return types with TypedArray 2022-08-22 22:42:36 +02:00
bruvzg
6510e11ae9
Fix memory leak when accessing/listing system fonts. 2022-08-09 12:57:53 +03:00
RedMser
c939f336d6 Only define keep_screen_on project setting once 2022-08-06 22:10:24 +02:00
Rémi Verschelde
33258d850c
Merge pull request #61315 from lawnjelly/variant_bucket_pools
Variant memory pools
2022-08-02 15:54:18 +02:00
Rémi Verschelde
3e5ad8213f
Merge pull request #63563 from aaronfranke/export-arch 2022-07-30 11:22:25 +02:00
bruvzg
d6a9384a32
[Linux] Fix build with missing DBUS. 2022-07-29 22:16:21 +03:00
Rémi Verschelde
7199314eb3
Merge pull request #63595 from reduz/remove-signal-connect-binds
Remove Signal connect binds
2022-07-29 18:10:39 +02:00
Aaron Franke
17c4cd6412
Update export dialog to handle many architectures 2022-07-29 10:24:58 -05:00
Juan Linietsky
d4433ae6d3 Remove Signal connect binds
Remove the optional argument p_binds from `Object::connect` since it was deprecated by Callable.bind().
Changed all uses of it to Callable.bind()
2022-07-29 16:26:13 +02:00