Commit Graph

87 Commits

Author SHA1 Message Date
d6edc6d18a Merge pull request #60126 from Calinou/image-improve-error-messages 2022-05-16 15:02:49 +02:00
34c1a2beaa Fix invalid memory usage when using Image.convert 2022-05-11 17:39:27 +08:00
3ca4514866 Merge pull request #50175 from kleonc/image-blit-blend-fix-rects
`Image.blit_rect/blend_rect` Fix rects calculations for negative arguments
2022-04-19 16:30:08 +02:00
46ef52162e Color: Rename to_srgb/to_linear to include base color space
This helps reduce confusion around sRGB <> Linear conversions by making
both input and output color spaces explicit.
2022-04-13 11:45:52 +02:00
18e9e6a81a Improve error messages when creating Images from code
The rationale behind the expected number of bytes is now displayed
in clear (width, height, format, number of mipmaps expected if any).
2022-04-11 01:13:50 +02:00
45f74ceb85 Add PortableCompressedTexture
* Resource that allows saving textures embedded in scenes or standalone.
* Supports only formats that are portable: Lossy, Lossles or BasisUniversal

This is something I wanted to add for a long time. I made it now because @fire
requires it for importing GLTF2 files with embedded textures, but also this
will allow saving Godot scenes as standalone binary files that will run
in all platforms (because textures will load everywhere).

This is ideal when you want to distribute individual standalone assets online
in games that can be built from Godot scenes.
2022-03-30 10:39:41 +02:00
7119d355eb String: Remove TTR and DTR defines in non-tools build
This ensures we don't use TTR in runtime code, as it's specifically meant
to source translations for the editor.
2022-03-28 20:26:35 +02:00
f19cd44346 Unify TextServer built-in module and GDExtension code. 2022-03-17 08:15:29 +02:00
39d429e497 Change some math macros to constexpr
Changes `MAX`, `MIN`, `ABS`, `CLAMP` and `SIGN`.
2022-03-09 16:24:32 +01:00
419b342a9a Faster CVTT by reducing quality.
Make BC6 and BC7 CVTT faster while still having better quality than DXT5.
2022-02-04 15:15:26 -08:00
244db37508 Cleanup and move char functions to the char_utils.h header. 2022-02-04 11:35:01 +02:00
b1b20f5f91 Pad etcpak input to 4x4 blocks. Fixes #49981 2022-01-22 17:20:17 -08:00
40be15920f Remove support for PVRTC texture encoding and decoding
On the only platform where PVRTC is supported (iOS),
ETC2 generally supersedes PVRTC in every possible way. The increased
memory usage is not really a problem thanks to modern iOS' devices
processing power being higher than its Android counterparts.
2022-01-14 21:08:22 +01:00
fe52458154 Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
4038bc0c36 Fix Image.blit_rect/blend_rect() for negative p_dest point 2021-11-26 22:23:04 +01:00
92ca300ab1 Image Use memcpy() in fill(), fill_rect(), _put_pixelb(), _get_pixelb()
Co-authored-by: Lightning_A <aaronjrecord@gmail.com>
2021-11-23 18:06:26 +01:00
91595b16e3 Add Image::fill_rect method 2021-11-23 18:06:23 +01:00
fb7ba76325 Fixed implicit conversion of uint32_t to uint8_t in image 2021-10-25 12:51:28 +02:00
fc9767abb1 Use functions defined in the their classes. 2021-09-29 09:36:34 +05:45
3dae9993ac Validate image formats, check if resize_to_po2 failed 2021-06-28 21:17:06 +02:00
0b7ffd4f68 Fix Image.adjust_bcs crash when image format is invalid 2021-06-27 20:52:42 +08:00
e28fd07b2b Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00
50d1e0ea99 Merge pull request #47835 from mortarroad/master-lossless-webp
Implement lossless WebP encoding
2021-06-11 19:34:36 +02:00
1bc1e94208 Implement lossless WebP encoding 2021-06-11 18:46:04 +02:00
81ed9fa31b fix-vram-compressed-mipmaps 2021-06-08 21:38:45 +08: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
4763835c11 Optimize image channel detection
Speeds up compression
2021-03-26 15:44:00 -03:00
5ae9051771 Add ability to change Icon Saturation
-Allows for more theme freedom
-Allows for entirely B&W themes.
2021-02-12 12:16:37 -03: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
b4a190e0bc Consistently use normal_map 2020-12-29 08:04:19 +00:00
5b937d493f Rename empty() to is_empty() 2020-12-28 10:39:56 +00:00
2df9a8ccad Rename Rect2 and Rect2i clip() to intersection() 2020-12-19 12:59:08 +00:00
46ea6750b4 Add interpolation parameter to resize_to_po2()
Image::resize_to_po2() now takes an optional p_interpolation parameter
that it passes directly to resize() with default value INTERPOLATE_BILINEAR.
2020-12-18 14:05:07 -04:00
9263f8eb4b Image: Rename PVRTC{2,4} to PVRTC1_{2,4}, drop COMPRESS_PVRTC2
We haven't had a proper implementation for COMPRESS_PVRTC2 (which is PVRTC1 2-bpp) in years,
so let's drop it instead of keeping a compress type which doesn't work.

The other enum values were renamed to clarify that our PVRTC2 and PVRTC4 are respectively
PVRTC1 2-bpp and PVRTC1 4-bpp. PVRTC2 2-bpp and 4-bpp are not implemented yet.
2020-12-10 23:14:04 +01:00
2c53e8b0e9 Use Vector2i instead of Vector2 for Image get_pixelv and set_pixelv
Co-authored-by: Andrii Doroshenko <xrayez@gmail.com>
2020-11-21 02:42:29 -05:00
02161aad5a Remove empty lines around braces with the formatting script 2020-11-16 23:38:11 -05: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