From f2a0a526ef415f24204fce4c9bfc609d8874199a Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sat, 16 Apr 2022 13:09:49 +0200 Subject: [PATCH] Improve warning message for invalid desktop VRAM compression settings - Display the source file path. - Display the valid compression algorithms on desktop platforms. - Use "desktop platforms" instead of "PC" to avoid ambiguity. - Use "may" instead of "will", as desktop platforms can still sometimes display ETC1/ETC2 textures depending on the GPU and drivers. --- editor/import/resource_importer_layered_texture.cpp | 6 +++--- editor/import/resource_importer_layered_texture.h | 2 +- editor/import/resource_importer_texture.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/editor/import/resource_importer_layered_texture.cpp b/editor/import/resource_importer_layered_texture.cpp index 7c0c99cd299..d335e52d027 100644 --- a/editor/import/resource_importer_layered_texture.cpp +++ b/editor/import/resource_importer_layered_texture.cpp @@ -391,7 +391,7 @@ Error ResourceImporterLayeredTexture::import(const String &p_source_file, const texture_import->bptc_ldr = bptc_ldr; texture_import->mipmaps = mipmaps; texture_import->used_channels = used_channels; - _check_compress_ctex(texture_import); + _check_compress_ctex(p_source_file, texture_import); if (r_metadata) { Dictionary metadata; metadata["vram_texture"] = compress_mode == COMPRESS_VRAM_COMPRESSED; @@ -472,7 +472,7 @@ ResourceImporterLayeredTexture::ResourceImporterLayeredTexture() { ResourceImporterLayeredTexture::~ResourceImporterLayeredTexture() { } -void ResourceImporterLayeredTexture::_check_compress_ctex(Ref r_texture_import) { +void ResourceImporterLayeredTexture::_check_compress_ctex(const String &p_source_file, Ref r_texture_import) { String extension = get_save_extension(); ERR_FAIL_NULL(r_texture_import->csource); if (r_texture_import->compress_mode != COMPRESS_VRAM_COMPRESSED) { @@ -542,5 +542,5 @@ void ResourceImporterLayeredTexture::_check_compress_ctex(Ref r_texture_import); + void _check_compress_ctex(const String &p_source_file, Ref r_texture_import); static ResourceImporterLayeredTexture *get_singleton() { return singleton; } virtual String get_importer_name() const override; diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp index de51a28c5a9..037d3417a55 100644 --- a/editor/import/resource_importer_texture.cpp +++ b/editor/import/resource_importer_texture.cpp @@ -561,7 +561,7 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String } if (!ok_on_pc) { - EditorNode::add_io_error(TTR("Warning, no suitable PC VRAM compression enabled in Project Settings. This texture will not display correctly on PC.")); + EditorNode::add_io_error(vformat(TTR("%s: No suitable desktop VRAM compression algorithm enabled in Project Settings (S3TC or BPTC). This texture may not display correctly on desktop platforms."), p_source_file)); } } else { //import normally