Commit Graph

281 Commits

Author SHA1 Message Date
8bdef23f7f Merge pull request #56012 from bruvzg/wt🤎4 2022-01-17 13:26:15 +01:00
f41c72c538 Fix Actions mapped to triggers not using the full range 2022-01-14 15:36:20 +00:00
24fe82da63 UWP: Simplify QueryPerformanceCounter usage 2022-01-08 13:10:27 +01:00
9a0e4ea550 Fix UTC typos in UWP platform 2022-01-06 10:49:48 -08:00
d2573c1636 Fix decoding UTF-8 filenames on unzipping. 2022-01-05 14:31:20 +02:00
fe52458154 Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
ea5bb8b47d [Windows] Improve console handling and execute/create_process.
Always build with the GUI subsystem.
Redirect stdout and stderr output to the parent process console.
Use CreateProcessW for blocking `execute` calls with piped stdout and stderr (prevent console windows for popping up when used with the GUI subsystem build, and have more consistent behavior with `create_process`).
Add `open_console` argument to the `execute` and `create_process` to open a new console window.
Remove `interface/editor/hide_console_window` editor setting.
Remove `Toggle System Console` menu option.
Remove `set_console_visible` and `is_console_visible` functions.
2021-12-18 10:14:07 +02:00
49403cbfa0 Replace String comparisons with "", String() to is_empty()
Also:
- Adds two stress tests to test_string.h
- Changes to .empty() on std::strings
2021-12-09 04:48:38 -06:00
e078f970db Rename remove() to remove_at() when removing by index 2021-11-23 18:58:57 -07:00
3c0fdcc8ac Use "enum class" for input enums 2021-11-12 15:37:54 -06:00
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
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
2dabdda36a Update Time documentation 2021-10-28 10:16:56 -05:00
3a6be64c12 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 15:43:36 +02:00
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
87a4ba492e Remove unimplemented methods 2021-10-21 18:44:25 +01:00
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
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
b1c6826b9f Merge pull request #52963 from Pineapple/WIN32_LEAN_AND_MEAN_master 2021-10-05 12:03:05 +02:00
6def32d643 Replace #pragma once by traditional include guards for consistency
`#pragma once` was used in a few files, yet we settled on using
traditional include guards instead.

The PooledList template comment was also moved to allow editors
such as Visual Studio Code to display the comment when hovering
PooledList.

`app.h` was renamed to `app_uwp.h` to be less generic for the
include guard.
2021-09-24 02:33:15 +02:00
425ed0ffe0 Add missing WIN32_LEAN_AND_MEAN 2021-09-23 10:35:00 +02:00
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
253581f85c Split uwp platform export template into multiple files 2021-08-12 17:18:37 +03:00
fa3a32a2d6 Use Key enum instead of plain integers 2021-08-10 16:26:55 -05:00
06568bbfdf Misc cleanup of header includes
Was looking for misuse of module headers without checking that the module is
actually enabled and got carried away...
2021-07-15 00:46:43 +02:00
0ce49800ac Use mouse and joypad enums instead of plain integers
Also MIDIMessage
2021-06-20 11:54:24 -04:00
e28fd07b2b Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00
c87e49d7bc UWP: Keep upstream names for capabilities preset settings to avoid mismatch
The previous code used `camelcase_to_underscore` to prettify the names for
display in the export preset, but it leads to inconsistencies if we don't make
sure to do the reverse operation when writing to the `AppxManifest.xml`.

It's simpler to keep the same names as in the manifest, which is also what
users will see referenced in MS documentation.

Fixes #47900.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2021-06-17 12:59:17 +02:00
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
98aa3b669e Add MOUSE_MODE_CONFINED_HIDDEN
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2021-06-03 11:44:28 -04:00
0d2e02945b Implement shader caching
* Shader compilation is now cached. Subsequent loads take less than a millisecond.
* Improved game, editor and project manager startup time.
* Editor uses .godot/shader_cache to store shaders.
* Game uses user://shader_cache
* Project manager uses $config_dir/shader_cache
* Options to tweak shader caching in project settings.
* Editor path configuration moved from EditorSettings to new class, EditorPaths, so it can be available early on (before shaders are compiled).
* Reworked ShaderCompilerRD to ensure deterministic shader code creation (else shader may change and cache will be invalidated).
* Added shader compression with SMOLV: https://github.com/aras-p/smol-v
2021-05-31 10:13:09 +02:00
da5d7db610 Rename File::get_len() get_length() 2021-05-25 11:54:28 +01:00
494c54b98c [UWP] Add missing get_scansym argument. 2021-05-22 16:39:31 +03:00
6c367f8e0d Merge pull request #48168 from LightningAA/control-to-ctrl-4.0 2021-05-17 17:38:02 +02:00
ba095ae567 SCons: Fix UWP build after #45315
(cherry picked from commit d1f023c35b)
2021-05-11 14:14:48 +02:00
97fecd1b69 Rename "Control" key to "Ctrl" and add "_pressed" suffix to all InputEventWithModifiers properties/methods 2021-05-07 14:00:50 -06:00
3f078c99f6 Rename IP_Unix, IP_Address and TCP_Server to remove underscores 2021-05-06 02:52:01 +02:00
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
564ddcde77 Fix EditorExportPlugin _export_begin and _export_end functions not being called when exporting UWP
in uwp's version of export.cpp create a ExportNotifier object so that EditorExportPlugin _export_begin and _export_end functions will be called as documentated.
2021-04-14 09:23:27 -07:00
fd30c36985 Rename Texture.get_data() to get_image() 2021-03-28 13:00:46 +01:00
a5324787c8 Rename some more global enums (Key, Joy, MIDI) 2021-03-23 07:13:23 -04:00
10d7fccb54 Rename ButtonList enum and members to MouseButton 2021-03-23 07:13:23 -04:00
fcddd8c53a Merge pull request #46966 from qarmin/faster_release
Allow to not optimize release build
2021-03-20 22:44:47 +01:00
fda2743fef Converted sensor acceleration units to m/s^2 on iOS and UWP
This is beacuse on Android these values are already in m/s^2 while on
iOS and UWP they are in g. This just makes the behaviour consistent on
all platforms.
2021-03-17 14:05:05 +01:00
0b298d201e Allow to not optimize release build 2021-03-14 15:51:05 +01:00
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
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
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
af878716f2 CI: Update to clang-format 11 and apply ternary operator changes 2021-01-12 19:32:53 +01:00
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