Commit graph

969 commits

Author SHA1 Message Date
Yuri Roubinsky
675111e480 Restore console window output for editor app on Windows 2021-11-25 22:06:45 +03:00
Lightning_A
e078f970db Rename remove() to remove_at() when removing by index 2021-11-23 18:58:57 -07:00
Rémi Verschelde
e7216d4085
Merge pull request #55072 from KoBeWi/untitled_goose_project 2021-11-18 13:47:32 +01:00
kobewi
f6d16d55c6 Fix data directory of unnamed projects 2021-11-18 12:31:29 +01:00
Rémi Verschelde
64d7df1e5f
Windows: Use /bigobj only for debug builds, breaks GCC LTO
Building `target=release` and `target=release_debug` builds with MinGW-GCC
errors when linking with LTO.

Since it's only needed for `target=debug` builds anyway (bigger objects), which
we don't build with LTO, this works around the issue.
2021-11-18 10:38:35 +01:00
Aaron Franke
3c0fdcc8ac
Use "enum class" for input enums 2021-11-12 15:37:54 -06:00
Rémi Verschelde
9b6897307c
Merge pull request #54837 from akien-mga/windows-bigobj 2021-11-10 17:48:35 +01:00
Rémi Verschelde
11d1319afd
Windows: Enable /bigobj to increase max size for obj files
Equivalent `-Wa,-mbig-obj` for GCC/Clang.

This started being needed to compile harfbuzz in `target=debug` with MinGW/GCC,
but there doesn't seem to be any drawback to enabling `/bigobj` (aside from
losing support for pre-VS 2005 linkers, which we don't support).
2021-11-10 16:06:39 +01:00
Rémi Verschelde
b727061ce0
Windows: Fix compilation warnings with GCC 11.2.1 2021-11-10 15:13:05 +01:00
WoLfulus
3c9d7203ea
Fix dwFlags on CreateProcessW calls 2021-11-04 09:50:45 -03:00
Clay John
8a10bb7d0d
Use OpenGL 3.3 core profile instead of compatibility profile
- Rename OpenGL to GLES3 in the source code per community feedback.
  - The renderer is still exposed as "OpenGL 3" to the user.
- Hide renderer selection dropdown until OpenGL support is more mature.
  - The renderer can still be changed in the Project Settings or using
    the `--rendering-driver opengl` command line argument.
- Remove commented out exporter code.
- Remove some OpenGL/DisplayServer-related debugging prints.
2021-10-31 15:56:45 +01:00
Hugo Locurcio
ce97ddbcb1
Rename GLES2 driver to OpenGL to prepare for the upgrade to GLES3
- Use lowercase driver names for the `--rendering-driver`
  command line argument.
2021-10-30 02:05:49 +02:00
lawnjelly
e3491a3744
Add GLES2 2D renderer + Linux display manager
First implementation with Linux display manager.

- Add single-threaded mode for EditorResourcePreview (needed for OpenGL).

Co-authored-by: clayjohn <claynjohn@gmail.com>
Co-authored-by: Fabio Alessandrelli <fabio.alessandrelli@gmail.com>
2021-10-30 02:05:48 +02:00
Aaron Franke
2dabdda36a
Update Time documentation 2021-10-28 10:16:56 -05:00
Rémi Verschelde
3b11e33a09
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 15:19:35 +02:00
Rémi Verschelde
cd21cc683a
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.
2021-10-15 10:26:58 +02:00
K. S. Ernest (iFire) Lee
8f0c056431 Fix specific warnings issues by Clang
Found by `scons dev=yes` on llvm-mingw.
2021-10-14 14:14:26 -07:00
Rémi Verschelde
e2dfb656f4
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 godotengine/godot-proposals#3371.
2021-10-14 12:01:28 +02:00
Pedro J. Estébanez
007cb5ccfb Implement get_cache_path() for iOS, and improve it for Android and Windows 2021-10-09 11:13:26 +02:00
kobewi
92a53f9bd6 Change dragging cursor on Windows 2021-10-06 13:13:42 +02:00
Rémi Verschelde
b1c6826b9f
Merge pull request #52963 from Pineapple/WIN32_LEAN_AND_MEAN_master 2021-10-05 12:03:05 +02:00
Rémi Verschelde
3479aaa369
Merge pull request #53405 from winterpixelgames/PR-more-error-logging-release 2021-10-05 08:43:07 +02:00
Jordan Schidlowsky
b78d399f91 revert 0d7409a so additional error information prints in release builds 2021-10-04 16:55:01 -06:00
Rémi Verschelde
a7011fa294
Merge pull request #52684 from Frixuu/master 2021-10-01 11:53:01 +02:00
Lightning_A
c63b18507d Use range iterators for Map 2021-09-30 15:09:12 -06:00
Bartłomiej T. Listwon
425ed0ffe0 Add missing WIN32_LEAN_AND_MEAN 2021-09-23 10:35:00 +02:00
Rémi Verschelde
a412011be7
Merge pull request #52842 from Ev1lbl0w/fix_win_open_errcode
Fix shell_open not returning errors on Windows
2021-09-21 11:26:58 +02:00
Frixuu
650e63a7ca Allow for mapping keycodes to current layout 2021-09-21 00:03:02 +02:00
Dan
131f5dbb54 Fix Windows cursor with trails disappearing in fullscreen
Fixed by turning off mouse trails when going into fullscreen, then restoring trails when exiting fullscreen or game
2021-09-19 21:42:56 -07:00
Ricardo Subtil
c4787a8e6d Fix shell_open not returning errors on Windows 2021-09-19 11:29:56 +01:00
Max Hilbrunner
7ca6a0e849 Clean DisplayServerWindows and add missing guards 2021-09-10 15:56:46 +02:00
jmb462
59116e1995 Fix bad size after restoring a minimized window under Windows 2021-08-27 14:32:52 +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
Max Hilbrunner
ca7f53dd25
Merge pull request #52001 from floppyhammer/fix-window-decor-size-on-windows
Fix window decoration size on Windows
2021-08-24 17:28:47 +02:00
floppyhammer
1a5d72bf16 Fix window decoration size on Windows 2021-08-23 10:43:34 +08:00
Aaron Franke
ae1702bee5
Replace HTTP links with HTTPS for sites with HTTPS versions 2021-08-22 20:13:11 -05: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
Sergey Minakov
6627f18e0f Split windows platform export template into multiple files 2021-08-12 17:18:36 +03: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
Georg Wacker
63ba15a518 Fix vertical scroll/zoom for precision touchpad
Adds factor data for vertical mousewheel event, in line with horizontal mousewheel event
2021-08-06 15:06:11 +02:00
Rémi Verschelde
c191cfbddf
Windows: Fix build with SCons 4.2.0 2021-08-01 10:08:20 +02:00
luz paz
2e0044c93d Remove unnecessary 'pass' statement
ref: https://lgtm.com/projects/g/godotengine/godot/?mode=tree&ruleFocus=910088
2021-07-25 11:56:24 -04:00
Aaron Franke
4e6efd1b07
Use C++ iterators for Lists in many situations 2021-07-23 17:38:28 -04:00
bruvzg
618eb27e8b Move alert function from DisplayServer to OS. 2021-07-22 21:50:35 +03:00
Hendrik Brucker
38578a8095 Modernize Display server to use override keyword 2021-07-16 21:39:13 +02: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
Rémi Verschelde
7931ebb7bb
Merge pull request #39139 from ThakeeNathees/windows-err-to-stderr
Windows error logs directed to stderr
2021-07-06 12:14:29 +02:00
miere43
119a59f872 Replace backslash with forward slash in OS_Windows path methods 2021-07-04 09:04:21 +03:00
bruvzg
8f7c2ccefd [Windows Export] Use temporary file for osslsigncode signing. 2021-06-29 10:38:28 +03: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
Rémi Verschelde
c1c76850cb
Style: Cleanup uses of double spaces between words
Or after punctuation. Tried to leave third-party stuff alone, unless it has
been heavily modified for Godot.
2021-06-07 11:03:08 +02:00
Marcel Admiraal
8acd13a456 Rename Quat to Quaternion 2021-06-04 18:14:32 +01:00
Rémi Verschelde
5d9cab3aeb
Merge pull request #38430 from aaronfranke/transform3d 2021-06-03 23:07:21 +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
Aaron Franke
08a85352fb
Rename Variant TRANSFORM to TRANSFORM3D
Also _transform to _transform3d
2021-06-03 07:30:01 -04:00
Hendrik Brucker
6abd842a5a Fixed window_can_draw of DisplayServerWindows 2021-06-02 12:51:36 +02:00
Rémi Verschelde
0e1d45b210
OS: Remove code duplicate in XDG paths handling
Follow-up to #48542.
2021-05-21 12:49:09 +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
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
Hugo Locurcio
3f078c99f6
Rename IP_Unix, IP_Address and TCP_Server to remove underscores 2021-05-06 02:52:01 +02:00
Aaron Franke
0de9a7d803
Rename doubleclick to double_click 2021-05-04 04:38:08 -04:00
Rémi Verschelde
5b16020846
Replace remaining uses of NULL with nullptr
Follow-up to #38736 (these uses were likely added after this PR was merged).
2021-04-29 11:53:27 +02:00
Rémi Verschelde
8247667a3e
Core: Drop custom copymem/zeromem defines
We've been using standard C library functions `memcpy`/`memset` for these since
2016 with 67f65f6639.

There was still the possibility for third-party platform ports to override the
definitions with a custom header, but this doesn't seem useful anymore.
2021-04-27 16:26:27 +02:00
floppyhammer
18678fd11e Fix window resizing after minimization on Windows 2021-03-30 20:09:19 +08: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
Rémi Verschelde
fcddd8c53a
Merge pull request #46966 from qarmin/faster_release
Allow to not optimize release build
2021-03-20 22:44:47 +01:00
Rafał Mikrut
0b298d201e Allow to not optimize release build 2021-03-14 15:51:05 +01:00
Rémi Verschelde
0fd723d3ec
Merge pull request #46941 from goostengine/asan-msvc
Add `use_asan` option for MSVC to enable AddressSanitizer
2021-03-13 22:10:01 +01:00
Rémi Verschelde
7015027cbf
Merge pull request #46900 from Ev1lbl0w/bugfix-malloc_calls
Replace malloc's with Godot's memalloc macro
2021-03-13 21:55:52 +01:00
Ev1lbl0w
838e7d0a8d
Replace malloc's with Godot's memalloc macro 2021-03-13 11:51:45 +00:00
Andrii Doroshenko (Xrayez)
53901d870b Add use_asan option for MSVC to enable AddressSanitizer
Exposes AddressSanitizer support in MSVC compiler. Can be installed via individual
components in the Visual Studio 2019 Installer.

Disabled by default. Compile the engine with `scons use_asan=yes`.
2021-03-12 18:44:06 +02:00
Anshul7sp1
91181c2086 Fixes small typos and grammar correction 2021-03-12 19:05:16 +05:30
PouleyKetchoupp
27d5e1fff0 Added LocalVector to Visual Studio debugger visualization 2021-02-24 18:35:39 -07:00
bruvzg
3e0262509f
Move tablet driver API from OS to DisplayServer. 2021-02-18 17:12:24 +02:00
reduz
8b19ffd810 Make Servers truly Thread Safe
-Rendering server now uses a split RID allocate/initialize internally, this allows generating RIDs immediately but initialization to happen later on the proper thread (as rendering APIs generally requiere to call on the right thread).
-RenderingServerWrapMT is no more, multithreading is done in RenderingServerDefault.
-Some functions like texture or mesh creation, when renderer supports it, can register and return immediately (so no waiting for server API to flush, and saving staging and command buffer memory).
-3D physics server changed to be made multithread friendly.
-Added PhysicsServer3DWrapMT to use 3D physics server from multiple threads.
-Disablet Bullet (too much effort to make multithread friendly, this needs to be fixed eventually).
2021-02-10 13:21:46 -03:00
Bastiaan Olij
4946ae16fc Use /Zi and /FS for including debugger symbols on Windows with MSVC 2021-02-09 00:20:42 +11:00
Rémi Verschelde
849c090343
SCons: Fix debug_symbols tests after switch to BoolVariable
Bug introduced in #45679.

Fixes part of #45816.
2021-02-08 08:53:16 +01:00
kobewi
b6e2ad0e7e Cancel event dispatch on error 2021-02-07 21:50:12 +01:00
Rémi Verschelde
db26871210 SCons: Add production=yes option to use production defaults
This is meant for users making custom builds to match the options used on
optimized, official builds.

This enables, on the platforms which support them:
- `use_static_cpp=yes` (portable binaries for Linux and Windows)
- `use_lto=yes` (link time optimizations - note: requires a lot of RAM!)
- `debug_symbols=no` (no debug symbols, smaller binaries)

Also abort when using MSVC with `production=yes`, as:
- It cannot optimize the GDScript VM like GCC or Clang do, leading to
  significant performance drops.
- Its LTO support is unreliable, at least used to trigger crashes last
  we tried it extensively.

All options can still be overridden if specified, and the `dev=yes` option
was changed to also support overrides.
2021-02-03 11:48:17 +01:00
Pedro J. Estébanez
99fe462452 Modernize Thread
- Based on C++11's `thread` and `thread_local`
- No more need to allocate-deallocate or check for null
- No pointer anymore, just a member variable
- Platform-specific implementations no longer needed (except for the few cases of non-portable functions)
- Simpler for `NO_THREADS`
- Thread ids are now the same across platforms (main is 1; others follow)
2021-01-29 12:02:13 +01:00
Rémi Verschelde
d39f6386ce
Merge pull request #45314 from RandomShaper/modernize_rwlock
Modernize RWLock
2021-01-22 14:51:05 +01:00
Pedro J. Estébanez
8ed259b792 Modernize RWLock
- Based on C++14's `shared_time_mutex`
- No more need to allocate-deallocate or check for null
- No pointer anymore, just a member variable
- Platform-specific implementations no longer needed
- Simpler for `NO_THREADS`
2021-01-19 11:53:10 +01:00
Marios Staikopoulos
2a2de2f684 BUGFIX: Fix unintialized cursor_shape on windows display server 2021-01-18 15:52:47 -08:00
Marcel Admiraal
2a74b388d0 Split OS::execute into two methods
1. execute(): Executes a command and returns the results.
2. create_process(): Creates a new process and returns the new process' id.
2021-01-09 10:03:23 +00:00
Yuri Roubinsky
785f84f1d1 Removes semicolon typo in display_server_windows 2021-01-06 15:08:51 +03:00