Load decompressable texture format is no supported one found.

This commit is contained in:
Pāvels Nadtočajevs
2025-01-27 21:42:02 +02:00
parent 6b5b84c0c5
commit b384de9013
4 changed files with 45 additions and 18 deletions

View File

@@ -2699,6 +2699,19 @@ Error Image::decompress() {
return OK;
}
bool Image::can_decompress(const String &p_format_tag) {
if (p_format_tag == "astc") {
return _image_decompress_astc != nullptr;
} else if (p_format_tag == "bptc") {
return _image_decompress_bptc != nullptr;
} else if (p_format_tag == "etc2") {
return _image_decompress_etc2 != nullptr;
} else if (p_format_tag == "s3tc") {
return _image_decompress_bc != nullptr;
}
return false;
}
Error Image::compress(CompressMode p_mode, CompressSource p_source, ASTCFormat p_astc_format) {
ERR_FAIL_INDEX_V_MSG(p_mode, COMPRESS_MAX, ERR_INVALID_PARAMETER, "Invalid compress mode.");
ERR_FAIL_INDEX_V_MSG(p_source, COMPRESS_SOURCE_MAX, ERR_INVALID_PARAMETER, "Invalid compress source.");