Commit Graph

92 Commits

Author SHA1 Message Date
b17aa3343a Revert "SCons: Add CPPEXTPATH for external includes" 2025-10-06 13:09:22 -05:00
c32c2606f4 Merge pull request #110837 from wheatear-dev/add-gdsoftclass-deeper
Add `GDSOFTCLASS` to deeper inheritors of `Object`
2025-09-25 12:13:56 -05:00
bd65cfa876 Revert "Replace many uses of is_class with derives_from."
This reverts commit 78b743cf4a.
2025-09-25 13:48:53 +02:00
e366471fdc Add GDSOFTCLASS to deeper inheritors of Object 2025-09-24 19:15:56 +01:00
8ef4a43ada Replace many uses of is_class with derives_from. 2025-09-23 19:59:00 +02:00
19e6bc68aa Explicitly handle Image AlphaMode enum instead of treating as bool
Co-authored-by: K. S. Ernest (iFire) Lee <ernest.lee@chibifire.com>
2025-05-20 05:04:23 -07:00
01fc9aee6c Core: Modernize C headers with C++ equivalents 2025-05-02 08:23:01 -05:00
f25fc34439 SCons: Add CPPEXTPATH for external includes 2025-04-02 07:29:08 -05:00
324512e11c Style: Replace header guards with #pragma once 2025-03-07 17:33:47 -06:00
a1846b27ea Improve use of Ref.is_null/valid
Use `is_null` over `!is_valid` and vice versa.
2024-12-23 16:35:02 -05:00
33817b186f Remove unused header in drivers and modules.
Co-authored-by: Thaddeus Crews <repiteo@outlook.com>
2024-12-24 00:40:47 +08:00
bb5f390fb9 Style: Apply clang-tidy fixes (superficial)
• `modernize-use-bool-literals`, `modernize-use-nullptr`, and `readability-braces-around-statements`
2024-11-04 12:11:14 -06:00
9f9ee0c813 SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
09bd34df93 libwebp: Update to 1.4.0
https://chromium.googlesource.com/webm/libwebp/+/refs/tags/v1.4.0/NEWS
2024-05-14 13:01:07 +02:00
d4e1a74efb Add 'override' mark to ResourceFormat class 2024-03-25 04:06:34 +08:00
c07cd406cb Fix crash when saving compressed image as JPG & WebP 2023-11-12 00:15:49 +08:00
8dc193173f Merge pull request #79257 from DeeJayLSP/sharpp
Lossy WebP: Enable sharp RGB to YUV conversion
2023-07-25 21:25:54 +02:00
7e21eb7e00 Extract and reorganize texture resource classes 2023-07-14 20:04:21 +02:00
31ca736536 Lossy WebP: Enable sharp RGB to YUV conversion 2023-07-09 18:38:19 -03:00
25b2f1780a Style: Harmonize header includes in modules
This applies our existing style guide, and adds a new rule to that style
guide for modular components such as platform ports and modules:

Includes from the platform port or module ("local" includes) should be listed
first in their own block using relative paths, before Godot's "core" includes
which use "absolute" (project folder relative) paths, and finally thirdparty
includes.

Includes in `#ifdef`s come after their relevant section, i.e. the overall
structure is:

- Local includes
  * Conditional local includes
- Core includes
  * Conditional core includes
- Thirdparty includes
  * Conditional thirdparty includes
2023-06-15 14:35:45 +02:00
7da93a0bc0 Add support for extending GLTF with more texture formats & support WebP 2023-05-22 16:30:20 -05:00
d8e8517d11 libwebp: Sync with upstream 1.3.0 2023-01-25 10:38:03 -03:00
d95794ec8a One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +01:00
da132f3266 Overhaul WebP packer and split compression options 2022-11-15 11:52:22 -03:00
5947f22be9 Merge pull request #67578 from KoBeWi/GEDITOR
Unify usage of GLOBAL/EDITOR_GET
2022-10-31 13:15:58 +01:00
dd64ceab47 Change all WEBP strings and comments to WebP 2022-10-28 15:17:49 -03:00
e48c5daddf Unify usage of GLOBAL/EDITOR_GET 2022-10-18 19:01:48 +02:00
072f6feaba Make some Image methods static 2022-10-14 14:34:15 +02:00
e8fc6bfeb5 [Core] Make ImageFormatLoader extensible. 2022-09-20 02:01:57 +02:00
0cf0e96038 Merge pull request #64776 from YuriSizov/import-images-moar-flags 2022-08-25 16:51:26 +02:00
e5e34f21fc libwebp: Sync with upstream 1.2.4
Changes: https://chromium.googlesource.com/webm/libwebp/+/1.2.4/NEWS
2022-08-23 19:05:53 +02:00
672e9d6868 Make ImageLoader take bit field flags 2022-08-23 14:39:01 +03:00
c3606cb5f3 Swap arguments of ResourceSaver.save() 2022-07-29 19:53:09 +02: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
8f05bd97b5 Add support for saving WebP images 2022-06-21 08:27:51 -05:00
de0ca3b999 Refactor module initialization
* Changed to use the same stages as extensions.
* Makes the initialization more coherent, helping solve problems due to lack of stages.
* Makes it easier to port between module and extension.
* removed the DRIVER initialization level (no longer needed).
2022-05-04 17:34:51 +02:00
9381acb6a4 Make FileAccess and DirAccess classes reference counted. 2022-04-11 13:28:51 +03:00
fe52458154 Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
41ce417847 libwebp: Sync with upstream 1.2.1
Changes: https://chromium.googlesource.com/webm/libwebp/+/1.2.1/NEWS
2021-11-19 13:55:13 +01:00
e28fd07b2b Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00
1bc1e94208 Implement lossless WebP encoding 2021-06-11 18:46:04 +02:00
da5d7db610 Rename File::get_len() get_length() 2021-05-25 11:54:28 +01:00
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
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
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
c7b53c03ae SCons: Add explicit dependencies on thirdparty code in cloned env
Since we clone the environments to build thirdparty code, we don't get an
explicit dependency on the build objects produced by that environment.

So when we update thirdparty code, Godot code using it is not necessarily
rebuilt (I think it is for changed headers, but not for changed .c/.cpp files),
which can lead to an invalid compilation output (linking old Godot .o files
with a newer, potentially ABI breaking version of thirdparty code).

This was only seen as really problematic with bullet updates (leading to
crashes when rebuilding Godot after a bullet update without cleaning .o files),
but it's safer to fix it everywhere, even if it's a LOT of hacky boilerplate.
2020-12-18 10:29:34 +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
0ee0fa42e6 Style: Enforce braces around if blocks and loops
Using clang-tidy's `readability-braces-around-statements`.
https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14 21:57:34 +02:00
0be6d925dc Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to
will now be changed automatically to remove the first empty line.

This makes us lean closer to 1TBS (the one true brace style) instead
of hybridating it with some Allman-inspired spacing.

There's still the case of braces around single-statement blocks that
needs to be addressed (but clang-format can't help with that, but
clang-tidy may if we agree about it).

Part of #33027.
2020-05-14 16:54:55 +02:00