Commit graph

162 commits

Author SHA1 Message Date
Hugo Locurcio 2daaf0fdc3
Make platform feature tag names lowercase
Feature tag names are still case-sensitive, but this makes built-in
feature tags more consistent.

- `Windows` -> `windows`
- `OSX` -> `osx`
- `LinuxBSD` -> `linuxbsd`
- `Android` -> `android`
- `iOS` -> `ios`
- `HTML5` -> `html5`
- `JavaScript` -> `javascript`
- `UWP` -> `uwp`
2021-08-31 20:34:44 +02:00
Hugo Locurcio 3db8359324
Merge pull request #47829 from Calinou/improve-crash-handler-display
Improve crash handler message display
2021-08-25 08:03:10 +02:00
ne0fhyk 3a00ff1cce 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-16 23:11:56 -07:00
Pedro J. Estébanez dc187324be 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-13 11:19:19 +02:00
Pedro J. Estébanez 7c864d41c9 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-13 11:19:19 +02:00
Pedro J. Estébanez 7b7e17a626 Upgrade Vulkan memory allocator 2021-08-13 00:05:41 +02:00
bruvzg d7957a2a20 Use "volk" instead of statically linked Vulkan loader. 2021-08-12 14:25:15 +03:00
Aaron Franke fa3a32a2d6
Use Key enum instead of plain integers 2021-08-10 16:26:55 -05:00
luz paz 3564c16cb8
Fix various typos with codespell
Found via `codespell -q 3 -S ./thirdparty,*.po,./DONORS.md -L ackward,ang,ans,ba,beng,cas,childs,childrens,dof,doubleclick,fave,findn,hist,inout,leapyear,lod,nd,numer,ois,ony,paket,seeked,sinc,switchs,te,uint`
2021-07-25 11:21:51 +02:00
bruvzg 618eb27e8b Move alert function from DisplayServer to OS. 2021-07-22 21:50:35 +03:00
PouleyKetchoupp e030360b88 Fix popup closing immediately after showing on some Linux WMs
When a popup is going to be closed, switch focus to the parent only if
the popup is still being focused.

Fixes some cases with specific WMs where due to the order of events, a
new popup could be immediately unfocused because a previously opened
and closed popup is switching focus to the parent.
2021-07-21 12:28:39 -07:00
Hendrik Brucker 38578a8095 Modernize Display server to use override keyword 2021-07-16 21:39:13 +02:00
joe b627fcd2cd Fix for ambiguous variant error during build on Debian 10(Buster) using clang v7 2021-07-13 03:44:03 +01:00
Hugo Locurcio a2d5f191d8
Merge pull request #48622 from Geometror/reimplement-disableable-vsync 2021-07-10 01:02:23 +02:00
likeich 0314e04939 Fix linux use after free
Fixes #50032
2021-07-08 22:34:07 -04:00
Hendrik Brucker 043ae91560 Restructure and reimplement vsync options
-Add a v-sync mode setting which allows to choose between DISABLED, ON, ADAPTIVE and MAILBOX
-Removed the V-Sync via Compositor option
2021-07-06 16:34:26 +02:00
Niklas Higi 0c83a23ab5
Add "Keep screen on" feature to DisplayServerX11 2021-06-20 21:57:33 +02:00
Aaron Franke 0ce49800ac
Use mouse and joypad enums instead of plain integers
Also MIDIMessage
2021-06-20 11:54:24 -04:00
Aaron Franke e919d894f8
Move many input enums to their own file 2021-06-20 11:53:01 -04:00
Lightning_A e28fd07b2b Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00
Hugo Locurcio 8556dd1bef
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.
2021-06-17 20:05:16 +02:00
Rémi Verschelde ac73059b56
Merge pull request #49123 from aaronfranke/it-is-time
Add a Time singleton
2021-06-12 22:55:25 +02:00
Rémi Verschelde 8d4046929c
Merge pull request #49511 from akien-mga/core-diraccess-fileaccess-io
Core: Move DirAccess and FileAccess to `core/io`
2021-06-11 16:51:10 +02:00
Rémi Verschelde 6b0183ec89
Merge pull request #49279 from Calinou/rename-string-is-abs-path-method
Rename `String.is_abs_path()` to `String.is_absolute_path()`
2021-06-11 15:58:16 +02:00
Aaron Franke f64fea1b23
Add Time singleton 2021-06-11 09:32:39 -04:00
Rémi Verschelde 9e328bb5b7
Core: Move DirAccess and FileAccess to core/io
File handling APIs are typically considered part of I/O, and we did have most
`FileAccess` implementations in `core/io` already.
2021-06-11 14:52:39 +02:00
Aaron Franke 98aa3b669e
Add MOUSE_MODE_CONFINED_HIDDEN
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2021-06-03 11:44:28 -04:00
Hugo Locurcio 5ea1c75d63
Rename String.is_abs_path() to String.is_absolute_path()
This is more consistent with `NodePath.is_absolute()`.
2021-06-03 16:00:06 +02:00
Fabio Alessandrelli 8594613f94 LinuxBSD now compiles without vulkan/x11. 2021-06-01 16:27:54 +02:00
Omar Polo 3bff838cee add OpenBSD to OS_LinuxBSD::get_name() 2021-05-21 21:35:31 +02:00
Hugo Locurcio 011a99316a
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.
2021-05-20 18:37:28 +02:00
Rémi Verschelde 6c367f8e0d
Merge pull request #48168 from LightningAA/control-to-ctrl-4.0 2021-05-17 17:38:02 +02:00
Pedro J. Estébanez 469fa47e06
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-17 15:06:19 +02:00
Hugo Locurcio 064ca9adae
Remove debugging prints in the Linux DisplayServer
Some Vulkan debugging prints were also changed to be printed only
in verbose mode.
2021-05-08 19:07:50 +02:00
Lightning_A 97fecd1b69 Rename "Control" key to "Ctrl" and add "_pressed" suffix to all InputEventWithModifiers properties/methods 2021-05-07 14:00:50 -06:00
Rémi Verschelde dfbabcdaeb
Merge pull request #48453 from JFonS/improve_raycast_module_scsub
Port changes to the "raycast" module build files from 3.x
2021-05-04 17:55:25 +02:00
jfons 575543ce53 Port changes to the "raycast" module build files from 3.x 2021-05-04 17:21:41 +02:00
Aaron Franke 0de9a7d803
Rename doubleclick to double_click 2021-05-04 04:38:08 -04:00
Rémi Verschelde aa15ad72ee
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.
2021-04-26 13:34:55 +02:00
bruvzg a79cc0d772
Fix macOS build with all sanitizers enabled. 2021-04-16 08:27:00 +03:00
Rafał Mikrut f827bcd2f3 Add more sanitizer flags to shows more bugs 2021-04-15 20:16:28 +02:00
Rémi Verschelde d83761ba80
Style: Apply clang-tidy's readability-braces-around-statements 2021-04-05 14:09:59 +02:00
Rémi Verschelde 9bbe51dc27
Style: Apply clang-tidy's modernize-use-nullptr 2021-04-05 14:05:07 +02:00
Marcel Admiraal fd30c36985 Rename Texture.get_data() to get_image() 2021-03-28 13:00:46 +01:00
Aaron Franke a5324787c8
Rename some more global enums (Key, Joy, MIDI) 2021-03-23 07:13:23 -04:00
Aaron Franke 10d7fccb54
Rename ButtonList enum and members to MouseButton 2021-03-23 07:13:23 -04:00
Rafał Mikrut 0b298d201e Allow to not optimize release build 2021-03-14 15:51:05 +01:00
Rémi Verschelde ae850177a3 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>
2021-03-08 15:51:14 +01:00
Jordan Schidlowsky da35cd2f00 add msan sanitizer option for linus/bsd, lsan option for osx 2021-03-02 11:10:16 -06:00
Pedro Rodrigues 1cb21b6937 Fix out of bounds array access on DisplayServerX11 code
The problem happened on methods `screen_get_position`,
`screen_get_usable_rect` and `window_set_current_screen` when they were
passed a negative screen value.

Fixes:
- #46184
- #46185
- #46186
2021-02-28 16:43:46 +00:00