summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-11-02 09:27:57 +0100
committerGitHub <noreply@github.com>2021-11-02 09:27:57 +0100
commit87727f70ed5316253407e4435a1ea1fb379d1b80 (patch)
treeeee9fd498410cf051f56daa9038d2d40b55712bf
parent5efb11926da99b93d342b5f417b79adf0198d3cc (diff)
parent79d4edfca7c9f7bb916058fabcdfafcc126fd5bb (diff)
Merge pull request #51644 from ChainedLupine/bugfix-stex-webp
-rw-r--r--editor/import/resource_importer_texture.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp
index 96a53b3257..e4553c625b 100644
--- a/editor/import/resource_importer_texture.cpp
+++ b/editor/import/resource_importer_texture.cpp
@@ -218,7 +218,8 @@ void ResourceImporterTexture::get_import_options(List<ImportOption> *r_options,
void ResourceImporterTexture::save_to_stex_format(FileAccess *f, const Ref<Image> &p_image, CompressMode p_compress_mode, Image::UsedChannels p_channels, Image::CompressMode p_compress_format, float p_lossy_quality) {
switch (p_compress_mode) {
case COMPRESS_LOSSLESS: {
- bool lossless_force_png = ProjectSettings::get_singleton()->get("rendering/textures/lossless_compression/force_png");
+ bool lossless_force_png = ProjectSettings::get_singleton()->get("rendering/textures/lossless_compression/force_png") ||
+ !Image::_webp_mem_loader_func; // WebP module disabled.
bool use_webp = !lossless_force_png && p_image->get_width() <= 16383 && p_image->get_height() <= 16383; // WebP has a size limit
f->store_32(use_webp ? StreamTexture2D::DATA_FORMAT_WEBP : StreamTexture2D::DATA_FORMAT_PNG);
f->store_16(p_image->get_width());