Commit Graph

99 Commits

Author SHA1 Message Date
42f06f6d4d Merge pull request #108170 from aaronfranke/test-ps-path-func
Use ProjectSettings path functions instead of hard-coded folder names in tests
2025-11-17 10:56:31 -06:00
ae9732139a Merge pull request #109433 from KoBeWi/hastension
Add `has_extension()` method to String
2025-10-31 09:23:30 -05:00
3c5df91a90 Use ProjectSettings functions instead of hard-coded folder name in tests 2025-10-24 20:24:50 -07:00
e366471fdc Add GDSOFTCLASS to deeper inheritors of Object 2025-09-24 19:15:56 +01:00
cd3a6c88fd Merge pull request #106200 from BlueCube3310/image-16-u16
Image: Implement 16-bit unorm and uint formats
2025-09-23 12:08:46 -05:00
555e7ad073 Core: Handle disabled class detection in ClassDB 2025-08-26 09:31:14 -05:00
a33ae0be0e Add has_extension() method to String 2025-08-12 13:15:16 +02:00
638c6a5659 Fix Image format RGB565 conversion 2025-08-03 16:28:13 +02:00
16b9ee6f50 Image: Implement 16-bit unorm and uint formats 2025-06-28 00:30:52 +02:00
bac5e097d4 DDS: Fix loading cubemaps 2025-06-25 14:11:26 +02:00
99943ee9fb Merge pull request #106055 from BlueCube3310/dds-formats-no-convert
DDS: Load BGRA4 textures directly as RGBA4
2025-06-05 13:11:22 +02:00
3508257bc5 Add DDS loading of 32bit aligned data without alpha 2025-05-18 22:22:22 +02:00
44bdadbe3a DDS: Prevent crashing when unable to load image 2025-05-14 13:04:58 +02:00
2b8fcca343 DDS: Load BGRA4 textures directly as RGBA4 2025-05-03 16:02:29 +02:00
df4ac6b237 Merge pull request #105200 from Monstrofil/fix-dds-mipmap-size-compressed-v2
Fix importing compressed dds textures with non-power-of-two width or height
2025-04-15 12:28:48 -05:00
65c9f44a2f Fix incorrect mipmap size calculation for uncompressed DDS textures
Previously, the DDS texture loader incorrectly calculated mipmap dimensions
for uncompressed textures when the original dimensions
were non-power-of-two.

For example, given a 120×120 texture, the expected mipmap chain should be:
    mipmap=0, size=120×120
    mipmap=1, size=60×60
    mipmap=2, size=30×30
    mipmap=3, size=15×15
    mipmap=4, size=7×7
    mipmap=5, size=3×3
    mipmap=6, size=1×1

But the loader was producing:
    mipmap=0, size=120×120
    mipmap=1, size=60×60
    mipmap=2, size=30×30
    mipmap=3, size=15×15
    mipmap=4, size=8×8
    mipmap=5, size=4×4
    mipmap=6, size=2×2

This commit corrects the logic to properly compute width and height independently at each mip level.

Fixes issue #105136.
2025-04-09 18:40:20 +03:00
85a9c73a84 Fix the formula for calculation the size of compressed textures.
Accodring to the DDS documentation, the size of each mipmap level should
be:

    max(1, ( (width + 3) / 4 ) ) x max(1, ( (height + 3) / 4 ) ) x 8(DXT1) or 16(DXT2-5)

But in dds loader a slightly different formula was used which
provided different results. Check gh issue #105136 and pull request for details.
2025-04-09 18:23:16 +03:00
090358afcf Disable ResourceFormatLoader/Savers of disabled classes 2025-03-21 14:23:05 -03:00
69b281295c Add DDS image load and save functionality
Save and load DDS from Image class.

Co-authored-by: BlueCube3310 <53150244+BlueCube3310@users.noreply.github.com>
2025-03-14 19:31:43 -07:00
324512e11c Style: Replace header guards with #pragma once 2025-03-07 17:33:47 -06:00
e297506365 Round DDS width/height to next divisor multiple for block compression 2024-11-25 12:55:05 -05:00
06195cdf2c DDS: Add support for loading layered textures 2024-10-29 20:55:22 +01:00
9f9ee0c813 SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
2eb1f069d2 Add support for loading less common DDS formats 2024-08-16 15:35:20 +02:00
d4e1a74efb Add 'override' mark to ResourceFormat class 2024-03-25 04:06:34 +08:00
a344d7f906 Support unspecified linear size in DDS files
Not all exporters choose to populate that (optional) header field.
2023-12-19 16:42:10 -05:00
c278cc3946 Add support for loading more DDS formats 2023-12-14 15:18:35 +01:00
e6766da6ac Refactor DDS loading code 2023-12-08 15:43:06 +01:00
cbbcaa31d5 Fix grayscale dds loading 2023-08-29 19:24:22 +02:00
0045dc204c Revert "Implement loading DDS textures at run-time"
This reverts commit 34ab1c8a36.
2023-08-29 14:25:16 +02:00
1d51c559e7 Make DDS loading code only check for R channel mask when loading grayscale images. 2023-08-21 22:21:17 +02:00
e92b5b405f Remove DDS_Indexed from DDSFormat enum 2023-08-15 21:34:00 +02:00
34ab1c8a36 Implement loading DDS textures at run-time 2023-07-31 21:31:26 +02:00
7e21eb7e00 Extract and reorganize texture resource classes 2023-07-14 20:04:21 +02:00
09465f3fe6 Remove (or make verbose only) various debug prints. 2023-03-20 08:14:18 +02: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
d2900429e8 Add static methods for creating Image and ImageTexture 2022-07-08 13:40:47 +02:00
84f64ddde9 Merge pull request #60723 from reduz/refactor-module-initialization 2022-05-04 19:08:43 +02: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
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
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
9381acb6a4 Make FileAccess and DirAccess classes reference counted. 2022-04-11 13:28:51 +03:00
39d429e497 Change some math macros to constexpr
Changes `MAX`, `MIN`, `ABS`, `CLAMP` and `SIGN`.
2022-03-09 16:24:32 +01:00
fe52458154 Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
e28fd07b2b Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06: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
f8d03b98e7 Improve resource load cache
-Added a new method in Resource: reset_state , used for reloading the same resource from disk
-Added a new cache mode "replace" in ResourceLoader, which reuses existing loaded sub-resources but resets their data from disk (or replaces them if they chaged type)
-Because the correct sub-resource paths are always loaded now, this fixes bugs with subresource folding or subresource ordering when saving.
2021-02-11 15:44:28 -03:00
f7209b459b Initialize class/struct variables with default values in modules/ 2021-02-08 10:57:18 +01: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
02161aad5a Remove empty lines around braces with the formatting script 2020-11-16 23:38:11 -05:00