diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-04-13 09:57:53 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-04-13 09:57:53 +0200 |
commit | 68b8156fe3075e0e45b070d26fce2a0baae6f293 (patch) | |
tree | df13815febe3658121b89a528cd440aecba2a509 | |
parent | 467b3e524abbc1fb60aaac3df2c23ffd21fcaec7 (diff) | |
parent | cf64e2fa479ce548713c589d9c3252e5ac36a6d3 (diff) | |
download | redot-engine-68b8156fe3075e0e45b070d26fce2a0baae6f293.tar.gz |
Merge pull request #76014 from AThousandShips/image_astc
Expose more compression formats in Image and fix compress check
-rw-r--r-- | core/io/image.cpp | 4 | ||||
-rw-r--r-- | doc/classes/Image.xml | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/core/io/image.cpp b/core/io/image.cpp index 736a3ec82e..8111ca447c 100644 --- a/core/io/image.cpp +++ b/core/io/image.cpp @@ -2649,7 +2649,7 @@ Error Image::compress_from_channels(CompressMode p_mode, UsedChannels p_channels _image_compress_bptc_func(this, p_channels); } break; case COMPRESS_ASTC: { - ERR_FAIL_COND_V(!_image_compress_bptc_func, ERR_UNAVAILABLE); + ERR_FAIL_COND_V(!_image_compress_astc_func, ERR_UNAVAILABLE); _image_compress_astc_func(this, p_astc_format); } break; case COMPRESS_MAX: { @@ -3535,6 +3535,8 @@ void Image::_bind_methods() { BIND_ENUM_CONSTANT(COMPRESS_ETC); BIND_ENUM_CONSTANT(COMPRESS_ETC2); BIND_ENUM_CONSTANT(COMPRESS_BPTC); + BIND_ENUM_CONSTANT(COMPRESS_ASTC); + BIND_ENUM_CONSTANT(COMPRESS_MAX); BIND_ENUM_CONSTANT(USED_CHANNELS_L); BIND_ENUM_CONSTANT(USED_CHANNELS_LA); diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml index 66325ab9e9..613d5269dc 100644 --- a/doc/classes/Image.xml +++ b/doc/classes/Image.xml @@ -714,6 +714,12 @@ <constant name="COMPRESS_BPTC" value="3" enum="CompressMode"> Use BPTC compression. </constant> + <constant name="COMPRESS_ASTC" value="4" enum="CompressMode"> + Use ASTC compression. + </constant> + <constant name="COMPRESS_MAX" value="5" enum="CompressMode"> + Represents the size of the [enum CompressMode] enum. + </constant> <constant name="USED_CHANNELS_L" value="0" enum="UsedChannels"> </constant> <constant name="USED_CHANNELS_LA" value="1" enum="UsedChannels"> |