Commit Graph

130 Commits

Author SHA1 Message Date
e48c5daddf Unify usage of GLOBAL/EDITOR_GET 2022-10-18 19:01:48 +02:00
85fe6ecc32 Fix MSVC warnings C4701 and C4703: Potentially uninitialized variable used 2022-09-28 17:05:34 +02:00
10a56981dc Rename String plus_file to path_join 2022-08-29 19:38:13 -05:00
45c7377556 Refactor the export checking logic to improve separation of concerns 2022-08-14 09:12:04 -07:00
9f55bd971e Extract EditorResourceConversionPlugin into its own source files and clean up editor includes 2022-07-31 21:14:15 +03:00
17c4cd6412 Update export dialog to handle many architectures 2022-07-29 10:24:58 -05:00
a0072ba39f Make some editor export methods const 2022-07-29 10:24:13 -05:00
e53ae13178 Split up editor export code into multiple files 2022-07-26 08:28:19 -05:00
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
d2900429e8 Add static methods for creating Image and ImageTexture 2022-07-08 13:40:47 +02:00
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
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
d36c5514d3 Fix ZipIO crash when reused (and possible leaks). 2022-05-11 16:08:17 +03:00
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
4bf99f4af2 Narrow FileAccess scope to prevent deadlocks. 2022-04-12 10:54:39 +03:00
9381acb6a4 Make FileAccess and DirAccess classes reference counted. 2022-04-11 13:28:51 +03:00
f851c4aa33 Fix some issues found by cppcheck. 2022-04-06 14:34:37 +03:00
93b7a85c98 HTML5: Explain why export templates are missing
Same for UWP.

This is skipped in DEV_ENABLED builds so contributors can still test
the export pipeline (and CI still compiles it on debug builds).
2022-03-26 20:27:36 +01:00
98d0af7d5c Implement GDExtension export plugin. 2022-03-16 11:16:19 +02:00
ccd4cdfd8b Rename StreamTexture* to CompressedTexture*
* Its not and will not be used for streaming.
* Streaming will be implemented in 4.1 and it will work different.
* It makes more sense to be called CompressedTexture since it imports and compresses texture files.
2022-03-05 16:43:38 +01:00
11572c6e30 Editor: Cleanup some includes dependencies
Removes some unnecessary includes from `editor_node.h`, and instead add
those where they're used.

Removes unnecessary `editor_node.h` includes in various editor classes.

Renames `dynamicfont` to `dynamic_font` in a couple files.

Misc cleanup while jumping through that rabbit hole.
2022-02-15 14:54:15 +01:00
b396fd4eef Improve compilation speed (forward declarations/includes cleanup) 2022-02-12 02:46:22 +01: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
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
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
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
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
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
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
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
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
b5334d14f7 Update copyright statements to 2021
Happy new year to the wonderful Godot community!

2020 has been a tough year for most of us personally, but a good year for
Godot development nonetheless with a huge amount of work done towards Godot
4.0 and great improvements backported to the long-lived 3.2 branch.

We've had close to 400 contributors to engine code this year, authoring near
7,000 commit! (And that's only for the `master` branch and for the engine code,
there's a lot more when counting docs, demos and other first-party repos.)

Here's to a great year 2021 for all Godot users 🎆
2021-01-01 20:19:21 +01:00
5b937d493f Rename empty() to is_empty() 2020-12-28 10:39:56 +00:00
e1811b689b Initialize class/struct variables with default values in platform/ and editor/ 2020-12-02 16:09:11 +01:00
504efc5f9b Export: Reorder options for consistency across platforms 2020-11-20 11:17:50 +01:00
127458ed17 Reorganized core/ directory, it was too fatty already
-Removed FuncRef, since Callable makes it obsolete
-Removed int_types.h as its obsolete in c++11+
-Changed color names code
2020-11-07 20:17:12 -03:00
ee06a70ea6 Refactor MethodBind to use variadic templates
Removed make_binders and the old style generated binders.
2020-10-18 12:28:44 +02:00
9cb46ed4e7 Fixed an issue in UWP export caused by duplicate entry for extensions in content types file. 2020-10-08 18:44:15 +05:30
f043eabdd8 Adds PCK encryption support (using script encryption key for export).
Change default encryption mode from ECB to CFB.
2020-09-05 14:53:39 +03:00
26fcf2b04c Add override keywords. 2020-07-10 13:56:54 +01:00
08ef0aab16 Export: Rename 'Windows Universal' to 'UWP'
It's otherwise too easy to be confused between 'Windows Desktop' (Win32)
and 'Windows Universal' (UWP).
2020-06-19 16:31:28 +02:00