Commit Graph

716 Commits

Author SHA1 Message Date
Rémi Verschelde
861ae4de27
CI: Partially sync workflows and actions with 3.x branch
Stick to `ubuntu:20.04` runners for now, as porting to newer ones implies
fixing a number of compilation warnings which may not be worth the trouble
for an EOL branch.

Static checks do use `ubuntu:22.04` as it comes with clang-format 13 out
of the box, so we avoid having to install it.
2024-11-07 23:33:28 +01:00
Rémi Verschelde
b0dd91bec8
SCons: Fix Python 3.12 SyntaxError with regex escape sequences
(cherry picked from commit b362976504)
2024-11-05 22:44:19 +01:00
Wilson E. Alvarez
720b3a40ce Properly check for fullscreen toggle made through the Window Manager
(cherry picked from commit cf38b6f187)
2022-07-07 14:12:34 +02:00
Paweł Fertyk
d8f8ae0ce1 Fix set_window_size crash when using NaN
Fixes #60466.

(cherry picked from commit b3f822eaae)
2022-07-07 14:11:01 +02:00
Rémi Verschelde
afe8492241 Fix typos with codespell
Using codespell 2.2-dev from current git.

Fix a couple incorrect uses of gendered pronouns.
2022-06-19 14:06:55 +02:00
Rémi Verschelde
694aef9ae5 Linux: Use pkg-config for alsa, libudev and GL too
It's not needed on most distros as those are found in standard lib
and include paths, but on NixOS they're all in non-standard prefixes,
so we need to rely on information provided by pkg-config.

Fixes #59913.

Co-authored-by: David Lewis <davidalewis00@gmail.com>
(cherry picked from commit 07ad066420)
2022-05-05 15:15:10 +02:00
ConteZero
d87f9ad419 Fix X11 is_window_maximized
(cherry picked from commit 59fb6c9ef0)
2022-04-13 12:18:45 +02:00
Rémi Verschelde
c3d7c4d41c Revert "Fix detected leaks/heap-use-after-free by AddressSanitizer at startup"
This reverts commit 0ae6150d8e.

It broke `detect_prime`'s main purpose which is to detect GPUs and use
the best one available.
2022-03-15 09:33:11 +01:00
Wilson E. Alvarez
0ae6150d8e Fix detected leaks/heap-use-after-free by AddressSanitizer at startup
(cherry picked from commit 3f94ea6271)
2022-03-13 18:14:54 +01:00
Mai Lavelle
cf3497ce78 Fix deleting of directories on Linux
Trailing slash of directories was mishandled, and incorrect derived paths
were formed. Stripping the slash fixes this.

(cherry picked from commit 2c00b90613)
2022-03-12 15:07:17 +01:00
Haoyu Qiu
fbff61dfe9
Fix memory leak when move to trash fails on Linux
(cherry picked from commit 8be49838b3)
2022-01-25 18:56:36 +01:00
Rémi Verschelde
71066cd63b
Update copyright statements to 2022
Happy new year to the wonderful Godot community!

(cherry picked from commit a627cdafc5)
2022-01-13 16:00:37 +01:00
bruvzg
cb6d82a111
Fix multiple missing UTF-8 decoding.
(cherry picked from commit c69e0d16bc)
2022-01-06 21:30:41 +01:00
Marcel Admiraal
ecb283009e
Fix tablet tilt values returning bad values
(cherry picked from commit 913855926d)
2022-01-06 00:58:32 +01:00
Rémi Verschelde
2c47e33905
Merge pull request #54313 from nekomatata/x11-fix-input-delay-3.x 2021-11-02 08:53:06 +01:00
robfram
2c8014e565 Exclude atomic lib under FreeBSD using LLVM 2021-10-29 18:24:57 +02:00
Rémi Verschelde
1b65550ec7
clang-format: Various fixes to comments alignment from clang-format 13
All reviewed manually and occasionally rewritten to avoid bad auto formatting.
2021-10-28 14:50:32 +02:00
Rémi Verschelde
42d385b312
clang-format: Disable alignment of operands, too unreliable
Sets `AlignOperands` to `DontAlign`.

`clang-format` developers seem to mostly care about space-based indentation and
every other version of clang-format breaks the bad mismatch of tabs and spaces
that it seems to use for operand alignment. So it's better without, so that it
respects our two-tabs `ContinuationIndentWidth`.
2021-10-28 13:23:38 +02:00
PouleyKetchoupp
874c9ae89a Fix input events random delay on X11
The new system based on a thread gathering events from the X11 server
was causing delays in some scenarios where some events have just been
missed at the time of processing and we're waiting for a whole frame to
check them again.

Solved by flushing again and checking for pending events at the
beginning of the process loop, in addition to events already gathered
on the event thread.
2021-10-27 10:19:16 -07:00
Aaron Franke
5659120af3
[3.x] Add support for the RISC-V architecture
Supports RV64GC (RISC-V 64-bit with general-purpose and compressed-instruction extensions)
2021-10-22 12:51:23 -05:00
Rémi Verschelde
9657559b66
SCons: Set DEBUG_ENABLED and DEV_ENABLED in SConstruct
They're the same for all platforms so they don't need to be repeated in all
platform definitions.

(cherry picked from commit cd21cc683a)
2021-10-15 12:54:16 +02:00
Omar Polo
04c08d1f8c
use .get_file() instead of basename(3)
On OpenBSD the compiler complains that calling basename(3) would lose
const qualifier.  basename(3) is defined as

	char *basename(char *);

and can, accorgindly to the POSIX.1, modify the passed string.

This uses the .get_file() method.  The check is necessary because
file_name could be a directory, in which case .get_file() would return
an empty string.  The .get_base_dir().get_file() idiom is already used.

The usage of get_file() and the check were suggested by theraot, thanks!

(cherry picked from commit a3384b7461)
2021-10-10 12:27:51 +02:00
Rémi Verschelde
e292d79fb3
SCons: Add DEV_ENABLED defines for target=debug builds
This will allow adding developer checks which will be fully compiled out in
user builds, unlike `DEBUG_ENABLED` which is included in debug tempates and
the editor builds.

This define is not used yet, but we'll soon add code that uses it, and change
some existing `DEBUG_ENABLED` checks to be performed only in dev builds.

Related to https://github.com/godotengine/godot-proposals/issues/3371.
2021-10-04 11:25:02 +02:00
Rémi Verschelde
b7901c773c
bullet: Sync with upstream 3.17
Stop include Bullet headers using `-isystem` for GCC/Clang as it misleads
SCons into not properly rebuilding all files when headers change.

This means we also need to make sure Bullet builds without warning, and
current version fares fairly well, there were just a couple to fix (patch
included).

Increase minimum version for distro packages to 2.90 (this was never released
as the "next" version after 2.89 was 3.05... but that covers it too).
2021-09-29 16:30:34 +02:00
Hugo Locurcio
8a6bc045ea
Add logo attribution for Android, HTML5 and Linux platform icons
- Tweak the Android platform logo to remove the Android wordmark,
  as it can't be used without explicit permission.

(cherry picked from commit 1513aa9b26)
2021-09-21 17:14:59 +02:00
Hugo Locurcio
f2ab6bd01c
Improve messages when compiling for Linux/*BSD
- Don't display messages when enabling PulseAudio/ALSA/D-Bus/udev
  as these become noisy in incremental builds.
- Improve warning and error messages to be more descriptive
  and consistent.

(cherry picked from commit 4c5deea83e)
2021-09-19 11:30:20 +02:00
Hugo Locurcio
a5d027e542
Mention that rebooting is required after updating graphics driver on X11 2021-09-15 18:25:49 +02:00
Hugo Locurcio
4d94aba0ed
Improve crash handler message display
- State the Godot version and full hash in the backtrace.
- Add decoration around the crash backtrace, both to make it stand out
  from other messages and help the user figure out what they should copy.

(cherry picked from commit 8556dd1bef)
2021-09-14 13:41:26 +02:00
ne0fhyk
c88d1608ab Add partial support for Android scoped storage.
This is done by providing API access to app specific directories which don't have any limitations and allows us to bump the target sdk version to 30.
In addition, we're also bumping the min sdk version to 19 as version 18 is no longer supported by Google Play Services and only account of 0.3% of Android devices.
2021-08-13 11:04:17 -07:00
Pedro J. Estébanez
7be9c26e20 Add input buffering framework
Input buffering is implicitly used by event accumulation, but this commit makes it more generic so it can be enabled for other uses.

For desktop OSs it's currently not feasible given main and UI threads are the same).
2021-08-08 12:37:55 +02:00
Pedro J. Estébanez
58a54f534e Improve input event accumulation
- API has been simplified: all events now go through `parse_input_event()`. Whether they are accumulated or not depends on the `use_accumulated_input` flag.
- Event accumulation is now thread-safe (it was not needed so far, but it prepares the ground for the following changes).
- Touch drag events now support accumulation.
2021-08-08 12:37:55 +02:00
Hugo Locurcio
8fbdcb6fea
Point at software OpenGL when OpenGL fails to initialize on X11 2021-08-05 18:24:42 +02:00
David Kennedy
72db6016ba
Fixes move_to_trash() on Linux
Fixes #42840 OS move_to_trash() on Linux is not compliant with the Freedesktop specification

(cherry picked from commit 8b68c6808d)
2021-07-15 10:39:47 +02:00
Marcel Admiraal
5a58516231 Remove duplicate ERR_PRINTS macro 2021-06-16 11:56:25 +01:00
Rémi Verschelde
752ed768fa
Linux: Fix embree unbundling on aarch64
Embree supports aarch64 since version 3.13.0.
2021-05-24 21:10:43 +02:00
Hugo Locurcio
12236d2868
Only allow absolute paths in XDG environment variables
The XDG Base Directory specification does not allow using relative paths
(which broke things in Godot anyway). If a relative path is detected,
it should be ignored.

(cherry picked from commits 011a99316a
and 0e1d45b210)
2021-05-21 12:53:11 +02:00
Pedro J. Estébanez
817ffc01e1
Make all file access 64-bit (uint64_t)
This changes the types of a big number of variables.

General rules:
- Using `uint64_t` in general. We also considered `int64_t` but eventually
  settled on keeping it unsigned, which is also closer to what one would expect
  with `size_t`/`off_t`.
- We only keep `int64_t` for `seek_end` (takes a negative offset from the end)
  and for the `Variant` bindings, since `Variant::INT` is `int64_t`. This means
  we only need to guard against passing negative values in `core_bind.cpp`.
- Using `uint32_t` integers for concepts not needing such a huge range, like
  pages, blocks, etc.

In addition:
- Improve usage of integer types in some related places; namely, `DirAccess`,
  core binds.

Note:
- On Windows, `_ftelli64` reports invalid values when using 32-bit MinGW with
  version < 8.0. This was an upstream bug fixed in 8.0. It breaks support for
  big files on 32-bit Windows builds made with that toolchain. We might add a
  workaround.

Fixes #44363.
Fixes godotengine/godot-proposals#400.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2021-05-16 17:52:31 +02:00
bruvzg
dab4cf3ed6
Add physical_scancode (keyboard layout independent keycodes) to InputEventKey and InputMap.
Fix non-latin keyboard layout keycodes on Linux/X11 (fallback to physical keycodes).
2021-05-06 23:19:45 +03:00
Rémi Verschelde
140350d767
Style: Enforce braces around if blocks and loops
Using clang-tidy's `readability-braces-around-statements`.
https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2021-05-05 15:02:01 +02:00
Rémi Verschelde
a828398655
Style: Replaces uses of 0/NULL by nullptr (C++11)
Using clang-tidy's `modernize-use-nullptr`.
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html
2021-05-04 16:30:23 +02:00
Rémi Verschelde
b5e1e05ef2
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
Rémi Verschelde
64a63e0861
Style: clang-format: Disable AllowShortCaseLabelsOnASingleLine 2021-05-04 14:45:15 +02:00
Rémi Verschelde
3d15f04668
Style: clang-format: Disable AllowShortIfStatementsOnASingleLine 2021-05-04 14:45:15 +02:00
Rémi Verschelde
6e600cb3f0
Style: Set clang-format Standard to c++14 2021-05-04 14:45:15 +02:00
Rémi Verschelde
3b12daa10d
Linux: Remove use_static_cpp override on x86_32
After further testing it seems to work fine now when building binaries with GCC 5
on Ubuntu 16.04 (previously we were using GCC 9 on Ubuntu 14.04).

Follow-up to #45629.

(cherry picked from commit aa15ad72ee)
2021-04-27 13:44:04 +02:00
Rémi Verschelde
a14b51df92
Linux: Don't attempt linking embree3 on non-tools, link it for headless too
`tech_debt++`, that's what we get for not taking the time to cleanup all this
and do it right...

Follow-up to #48073 and #48102.
2021-04-23 10:40:53 +02:00
Rémi Verschelde
a2c68d9da7
lightmapper: Disable build if raycast module can't build
We need to propagate the hacky checks from the raycast config to the
lightmapper config, as the failure of a `can_build()` check is not notified to
other modules (which might even be checked further depending on the processing
order in SConstruct).

A more thorough fix would be to change SConstruct to do two loops on modules:
one to check `can_build()` and disable modules which can't build, then another
one to rechecked `can_build()` with the new lineup and do further config.
But there would be more risk for regressions than with this ad hoc hack.

Similar story for the `platform/x11/detect.py` change... oh my eyes :(
2021-04-22 19:12:37 +02:00
Rémi Verschelde
b266cc2315
embree: Allow building against system library on Linux 2021-04-22 17:06:28 +02:00
Rafał Mikrut
6b6324441f
Allow to not optimize release build
(cherry picked from commit 0b298d201e)
2021-03-20 23:05:13 +01:00
Rémi Verschelde
03dda90ddd Linux: Fix PRIME detection on Steam
To avoid trying to do PRIME detection on fake `libGL.so` as used by e.g.
Renderdoc or Primus, we skip detection if there's a `libGL.so` in
`LD_LIBRARY_PATH`... and our luck is that Steam defines it and includes
system paths too, thus the actual system `libGL`... 🤦

So if we detect Steam, we skip this check.

Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>

(cherry picked from commit 562b1cd2cda2098e62c7501dae87393def99c23a)
2021-03-08 16:03:24 +01:00