Commit graph

353 commits

Author SHA1 Message Date
Rémi Verschelde
90019676b0 Code quality: Fix header guards consistency
Adds `header_guards.sh` bash script, used in CI to validate future
changes. Can be run locally to fix invalid header guards.
2022-07-25 11:17:40 +02:00
Aaron Franke
8b5c744f95
Update export template names for Windows, Mac, and Linux 2022-07-22 18:40:59 -05:00
Rémi Verschelde
f37990ed77
Merge pull request #63278 from akien-mga/scons-linux-refactor-linker 2022-07-22 11:40:10 +02:00
Rémi Verschelde
ed926c4ec1
Merge pull request #63303 from hansemro/x11-eraser-case-insensitive
[X11] Do case-insensitive search for pen inversion detection
2022-07-22 09:17:04 +02:00
Hansem Ro
0f5436098b [X11] Do case-insensitive search for pen inversion detection 2022-07-21 19:25:22 -07:00
Rémi Verschelde
c8479c0d4d SCons: Refactor Linux linker options with linker=<bfd|gold|lld|mold>
The new option is `linker` and lets the user specify the argument to
the`-fuse_ld=` linker flag directly. The supported options are:

- `default`: No change, typically uses GNU ld (bfd) unless the user or
  distro picked a different default `/usr/bin/ld`.
- `bfd`: GNU ld from binutils
- `gold`: GNU gold from binutils
- `lld`: lld from LLVM
- `mold`: mold, an extremely fast modern linker, not (yet) intended for
  use in production but great for development speed. Provided by distro
  `mold` package or needs to be compiled from source and installed to
  `/usr` otherwise.

Removes the `use_lld=yes` option, and make lld actually usable with GCC
too.

Not all the above are compatible or recommend for LTO, we recommend
using GNU ld with GCC LTO, or lld with LLVM ThinLTO.
2022-07-22 01:00:35 +02:00
Riteo
a21f8b7c13 Improve linuxbsd headless building, cleanup build scripts
Now the `linuxbsd` platform can be built headlessly (e.g. without X11
development libraries).

I also cleaned up some weird (old?) usages of the `env` variable which
seem to make no difference and are used nowhere else.
2022-07-20 19:48:35 +02:00
Riteo
f035e7844f Remove -pipe from LINKFLAGS
For some reason this fixes the CI from going OOM.
2022-07-20 19:04:31 +02:00
bruvzg
7c005ba723
Improve DisplayServer.window_set_current_screen
Prevent unnecessary fullscreen toggle animation on macOS, when screen is not changed
Fix window position on Linux/X11
2022-07-19 12:26:11 +03:00
kobewi
d2900429e8 Add static methods for creating Image and ImageTexture 2022-07-08 13:40:47 +02:00
bruvzg
a194043ea8
Check if GL manager exist to prevent crash when using multithreaded renderer with Vulkan. 2022-07-06 09:56:47 +03:00
Rémi Verschelde
344b42703b
Merge pull request #62212 from hansemro/eraser-detect-4
Add inversion/eraser-end property for tablet pens
2022-07-04 21:48:19 +02:00
Hansem Ro
6dcc9d1131 [macOS, Windows, X11] Add stylus inverted/eraser support to
InputEventMouseMotion event
2022-07-04 10:36:53 -07:00
lawnjelly
b221eab426 Variant memory pools
Memory pools via PagedAllocator for Transform2D, Transform3D, Basis and AABB.
2022-07-04 12:01:46 +01:00
Jan Haller
d38d76d039 Fix exit code of --help and --version, and test them in CI
Corrects prior regression which caused ERROR output and exit code of 1.
2022-07-02 01:17:35 +02:00
Wilson E. Alvarez
aadf831a67 Properly check for fullscreen toggle made through the Window Manager
Fixes #40007.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2022-06-30 12:14:46 +02:00
gregcsokas
42e619c01e Adding function key support from F17 to F35
OSX supports everything by default,
Linux is also capable of supporting every function key,
Windows as I know support only up to F24
2022-06-16 19:38:21 +02:00
bruvzg
e00571b194
Add readable export errors. 2022-06-08 17:55:46 +03:00
bruvzg
40b3be7912
Remove mouse events that closed the popup from queue, to fix pop-up reopening. 2022-06-02 08:35:27 +03:00
Fabio Alessandrelli
9c2b5ae5ce [Editor] LinuxBSD export reports Linux as OS name.
This is in line with what's reported by the `OS` class on GNU/Linux, and
is required by the extension exporter to identify the correct library.

For BSD, we should either finish splitting the platform (into
platform/bsd) or register a separate exporter with OS name BSD and
proper templates detection.
2022-05-24 12:01:34 +02:00
reduz
45af29da80 Add a new HashSet template
* Intended to replace RBSet in most cases.
* Optimized for iteration speed
2022-05-20 22:40:38 +02:00
reduz
746dddc067 Replace most uses of Map by HashMap
* Map is unnecessary and inefficient in almost every case.
* Replaced by the new HashMap.
* Renamed Map to RBMap and Set to RBSet for cases that still make sense
  (order matters) but use is discouraged.

There were very few cases where replacing by HashMap was undesired because
keeping the key order was intended.
I tried to keep those (as RBMap) as much as possible, but might have missed
some. Review appreciated!
2022-05-16 10:37:48 +02:00
clayjohn
652adcd5bf Basic 3D rendering 2022-05-12 10:37:27 -07:00
Rémi Verschelde
c366f8d2d4 Crash handler: Use print_error to include backtrace in logs 2022-05-05 12:22:56 +02:00
Marcel Admiraal
c893302ca1 Read and store joypad events in a separate thread on x11 platform 2022-05-05 07:51:54 +02:00
Hugo Locurcio
180e5d3028
Remove RES and REF typedefs in favor of spelled out Ref<>
These typedefs don't save much typing compared to the full `Ref<Resource>`
and `Ref<RefCounted>`, yet they sometimes introduce confusion among
new contributors.
2022-05-03 01:43:50 +02:00
Rémi Verschelde
c273ddc3ee Style: Partially apply clang-tidy's cppcoreguidelines-pro-type-member-init
Didn't commit all the changes where it wants to initialize a struct
with `{}`. Should be reviewed in a separate PR.

Option `IgnoreArrays` enabled for now to be conservative, can be
disabled to see if it proposes more useful changes.

Also fixed manually a handful of other missing initializations / moved
some from constructors.
2022-05-02 16:28:25 +02:00
bruvzg
652f78785b
[Linux] Disable speech-dispatcher, pulse audio and udev wrapper builds, when library is not found. 2022-04-28 18:13:34 +03:00
bruvzg
6ab672d1ef Implement text-to-speech support on Android, iOS, HTML5, Linux, macOS and Windows.
Implement TextServer word break method.
2022-04-28 14:35:41 +03:00
Rémi Verschelde
504708ae21
Merge pull request #56093 from bruvzg/pck_section_load
Improve embedded PCK loading and exporting.
2022-04-27 14:29:21 +02:00
Rémi Verschelde
8dfa12cae7
Merge pull request #59979 from bruvzg/cpp_check2 2022-04-27 10:08:26 +02:00
Rémi Verschelde
a300fb6665
Merge pull request #60523 from akien-mga/linux-pkgconfig-nixos 2022-04-27 09:41:58 +02:00
Rémi Verschelde
e89fc52ec6
Merge pull request #58272 from bruvzg/x11_backup_screen_info 2022-04-27 09:34:25 +02:00
Rémi Verschelde
07ad066420 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>
2022-04-26 09:37:28 +02:00
bruvzg
c0cc41d6c1
Improve embedded PCK loading and exporting.
Windows export process:
  Limit size of executable with embedded PCK to 4 GB.
  Use "rcedit" before embedding PCK.
  Capture and process "rcedit" errors.

Windows, Linux:
  Add support for PCK loading from executable "pck" section.
2022-04-20 11:09:59 +03:00
bruvzg
de4c97758a
Fix more issues found by cppcheck. 2022-04-20 10:34:00 +03:00
bruvzg
8b0761d1fd
Fix sub-menu keyboard navigation. 2022-04-13 09:58:38 +03:00
bruvzg
4bf99f4af2 Narrow FileAccess scope to prevent deadlocks. 2022-04-12 10:54:39 +03:00
bruvzg
9381acb6a4
Make FileAccess and DirAccess classes reference counted. 2022-04-11 13:28:51 +03:00
bruvzg
f851c4aa33
Fix some issues found by cppcheck. 2022-04-06 14:34:37 +03:00
Rémi Verschelde
b79721fede
Merge pull request #59908 from bruvzg/fix_popup_close_race
Fix a possible race condition on popup close, that might cause multiple deletions of the same list item.
2022-04-06 08:35:56 +02:00
Rémi Verschelde
77843355a0 CI: Update black formatter and apply changes 2022-04-05 17:43:12 +02:00
bruvzg
daa42e0e50
Fix a possible race condition on popup close, that might cause multiple deletions of the same list item. 2022-04-05 12:44:29 +03:00
Rémi Verschelde
f8ab79e68a Zero initialize all pointer class and struct members
This prevents the pitfall of UB when checking if they have been
assigned something valid by comparing to nullptr.
2022-04-04 19:49:50 +02:00
bruvzg
ba0317be04
Add CI build with clang sanitizers, increase stack size to 30 MB for builds with sanitizers. 2022-04-01 13:15:35 +03:00
ConteZero
2eb36b8bdb Fix X11 is_window_maximized 2022-03-31 23:21:32 +02:00
Markus Sauermann
0494e024d8 Rename warp mouse functions to warp_mouse 2022-03-27 14:12:01 +02:00
Aaron Franke
13392a96e9
Generate export template file names instead of having a fixed set 2022-03-22 10:16:03 -05:00
Aaron Franke
ac3ecec58e
Change extension for Linux 32-bit x86 exports to x86_32 2022-03-21 14:56:27 -05:00
Aaron Franke
f301451fa3
Move extension logic to EditorExportPlatformLinuxBSD 2022-03-21 12:50:31 -05:00
Aaron Franke
e5e697564d
Move fixup_embedded_pck to EditorExportPlatform classes 2022-03-20 21:04:22 -05:00
bruvzg
f0315c28a8
[Export] Add "export console script" option for Linux, macOS, and Windows exports. 2022-03-14 17:19:18 +02:00
Rémi Verschelde
768f9422bc Convert uses of DirAccess * to DirAccessRef to prevent memleaks
`DirAccess *` needs to be deleted manually, and this is often forgotten
especially when doing early returns with `ERR_FAIL_COND`.
`DirAccessRef` is deleted automatically when it goes out of scope.

Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2022-03-11 09:13:11 +01:00
Rémi Verschelde
7866c98479
Merge pull request #58335 from maiself/fix-directory-delete-linux 2022-03-10 21:29:40 +01:00
Rémi Verschelde
3d7f155586 Remove unused Bullet module and thirdparty code
It has been disabled in `master` since one year (#45852) and our plan
is for Bullet, and possibly other thirdparty physics engines, to be
implemented via GDExtension so that they can be selected by the users
who need them.
2022-03-09 21:45:47 +01:00
MmAaXx500
eda3180395
Add missing header for headless builds 2022-03-09 09:58:20 +01:00
bruvzg
3cc37342c4
[X11] Do not try to focus unmapped window. 2022-03-08 11:46:44 +02:00
Haoyu Qiu
29e45d4fa0 Fix X11 memory leak after drag & drop file into the editor 2022-03-04 17:50:24 +08:00
bruvzg
74ff5921d6 Improve popup window handling.
Add window FLAG_POPUP and a platform specific routines to control popup auto-hiding and event forwarding.
2022-02-25 09:33:27 +02:00
Mai Lavelle
dfdc1c1642 Fix deleting of directories on Linux
Trailing slash of directories was mishandled, and incorrect derived paths
were formed. Stripping the slash fixes this.
2022-02-20 08:38:59 -05:00
bruvzg
372e24265a
[Linux/X11] Fallback to the X server root window to get screen rects, if Xinerama is not available. 2022-02-18 13:29:10 +02:00
Rémi Verschelde
b8b4580448
Style: Cleanup single-line blocks, semicolons, dead code
Remove currently unused implementation of TextureBasisU, could be re-added
later on if needed and ported.
2022-02-16 14:06:29 +01:00
Hugo Locurcio
ee7cd9a3a1
Add an OS.get_processor_name() method
This method can be used to get the CPU model name.
It can be used in conjunction with
`RenderingServer.get_video_adapter_name()` and
`RenderingServer.get_video_adapter_vendor()` for annotating benchmarks
and automatic graphics quality configuration.
2022-02-15 20:55:53 +01:00
Hendrik Brucker
b396fd4eef Improve compilation speed (forward declarations/includes cleanup) 2022-02-12 02:46:22 +01:00
Rémi Verschelde
1bdb82c64e
Fix typos with codespell
Using codespell 2.2-dev from current git.

Added `misc/scripts/codespell.sh` to make it easier to run it once in a
while and update the skip and ignore lists.
2022-02-10 12:30:19 +01:00
Rémi Verschelde
90162851a7
Core: Move generated VERSION_HASH to a .cpp file
This lets us have its definition in `core/version.h` and avoid
rebuilding a handful of files every time the commit hash changes.
2022-02-09 09:20:17 +01:00
Rémi Verschelde
2a39a1c221
Merge pull request #57612 from maiself/improve-gamepad-detection 2022-02-08 15:22:31 +01:00
bruvzg
4fcc35bdfa
[X11] Fix decoration reset when returning from fullscreen mode. 2022-02-08 11:01:24 +02:00
jordi
635da44ef8 Snap refresh rate to hundreths place on X11 2022-02-06 13:24:57 +01:00
Rémi Verschelde
225a3b2545
Merge pull request #57341 from bruvzg/win_multiwin_fs 2022-02-04 13:28:56 +01:00
Rémi Verschelde
2e320dcf87
Merge pull request #57617 from bruvzg/char_cleanup 2022-02-04 13:06:38 +01:00
Rémi Verschelde
d235c1bb19
Merge pull request #57335 from jordigcs/display-refresh-rate 2022-02-04 11:51:07 +01:00
bruvzg
f4ea9cd9f3
[Windows] Add WS_BORDER flag to windows in WINDOW_MODE_FULLSCREEN mode to allow multi-window interface in full-screen.
[Windows] Add WINDOW_MODE_EXCLUSIVE_FULLSCREEN without WS_BORDER flag enabled (no multi-window support).
2022-02-04 12:08:46 +02:00
bruvzg
244db37508
Cleanup and move char functions to the char_utils.h header. 2022-02-04 11:35:01 +02:00
Mai Lavelle
b966ca6167 Improve detection of gamepads on Linux
Some devices (Nintendo Switch Right Joy-Con) report only a right stick.
2022-02-03 22:56:43 -05:00
jordi
54dec44dba Add screen_get_refresh_rate to DisplayServer 2022-02-03 21:50:32 -06:00
Rémi Verschelde
ea12094f19
Merge pull request #57497 from Geometror/fix-mouse-mode 2022-02-01 14:46:30 +01:00
Hendrik Brucker
c058361a23 Fix captured mouse mode 2022-02-01 03:49:51 +01:00
Rémi Verschelde
f14b1441e7
Merge pull request #56548 from madmiraal/fix-53894 2022-01-31 18:08:48 +01:00
Nathan Franke
8a0a3accee
simplify formatting scripts, add a clang-tidy script, and run clang-tidy 2022-01-29 04:41:03 -06:00
Rémi Verschelde
4b36b6e92a
Merge pull request #56785 from bruvzg/nat_handles_4 2022-01-27 12:12:34 +01:00
Haoyu Qiu
8be49838b3 Fix memory leak when move to trash fails on Linux 2022-01-25 18:38:13 +08:00
Rémi Verschelde
57a057f7ff
Merge pull request #56754 from madmiraal/fix-45592 2022-01-24 10:05:42 +01:00
Omar Polo
bd448e5535 Rename or refactor macros to avoid leading underscores
These are not used consistently and some can conflict with
system-specific defines.  While here, also delete some unused macros.
2022-01-20 20:29:15 +01:00
bruvzg
d62ca0c9c0 Window management improvements.
[macOS] Fix transient windows not working in the full-screen mode.
[macOS] Fix moving transient windows to the other screen than parent window.
[macOS] Fix popup menu switch on hover.
[macOS] Use content origin rect for windows position (to ensure `DS.mouse_get_position` is equal to `DS.window_get_position` + mouse position from the input events).
[macOS] Fix incorrect input coordinates, when external display with different scaling in connected/disconnected.
[macOS/Windows] Fix moving fullscreen windows between the screens.
Add auto refocusing of the parent window, when the focused transient window is closed.
Remove redundant `DS.mouse_get_absolute_position` function (returns mouse position in the screen coordinates, same as `DS.mouse_get_position`).
2022-01-18 11:47:03 +02:00
Marcel Admiraal
f41c72c538 Fix Actions mapped to triggers not using the full range 2022-01-14 15:36:20 +00:00
bruvzg
89f37d4105
Add support for getting native display, window, and view handles. 2022-01-14 13:36:32 +02:00
luz paz
858bcd5058 Fix various typos
Found via `codespell -q 3 -S ./thirdparty,*.po,./DONORS.md -L ackward,ang,ans,ba,beng,cas,childs,childrens,dof,doubleclick,expct,fave,findn,gird,hist,inh,inout,leapyear,lod,nd,numer,ois,ony,paket,ro,seeked,sinc,switchs,te,uint,varn,vew`
2022-01-13 23:20:01 -05:00
Marcel Admiraal
5250cdd150 Use mouse event relative motion to calculate mouse velocity 2022-01-13 15:23:21 +00:00
Rémi Verschelde
585231a172
Merge pull request #56492 from akien-mga/remove-author-docstrings 2022-01-12 15:24:17 +01:00
clayjohn
99064d57db New OpenGL batching canvas renderer 2022-01-11 22:26:18 -08:00
Rémi Verschelde
46624388d4
Merge pull request #56322 from madmiraal/fix-42450 2022-01-11 11:33:59 +01:00
bruvzg
c69e0d16bc
Fix multiple missing UTF-8 decoding. 2022-01-06 14:35:22 +02:00
Marcel Admiraal
ac1e7e10eb Set window to focused when created 2022-01-06 08:04:59 +00:00
Rémi Verschelde
ba2bdc478b
Style: Remove inconsistently used @author docstrings
Each file in Godot has had multiple contributors who co-authored it over the
years, and the information of who was the original person to create that file
is not very relevant, especially when used so inconsistently.

`git blame` is a much better way to know who initially authored or later
modified a given chunk of code, and most IDEs now have good integration to
show this information.
2022-01-04 20:42:50 +01:00
Rémi Verschelde
1d6f8ad837
Merge pull request #56438 from madmiraal/fix-56428
Fix tablet tilt values returning bad values
2022-01-03 23:48:46 +01:00
Rémi Verschelde
fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
Marcel Admiraal
75a58360fd Fix tablet tilt values returning bad values 2022-01-02 12:15:14 +00:00
Marcel Admiraal
3105d9b1f3 Rename speed to velocity when it's a directional Vector 2021-12-29 15:35:26 +00:00
Rémi Verschelde
51c5fa48ab
Merge pull request #56039 from Rubonnek/update-detect-prime-formatting-master 2021-12-20 10:28:16 +01:00