Merge pull request #60299 from Calinou/editor-vram-compress-pc-improve-warning

This commit is contained in:
Rémi Verschelde 2022-08-06 23:43:06 +02:00 committed by GitHub
commit 8f033f1d19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View file

@ -391,7 +391,7 @@ Error ResourceImporterLayeredTexture::import(const String &p_source_file, const
texture_import->bptc_ldr = bptc_ldr; texture_import->bptc_ldr = bptc_ldr;
texture_import->mipmaps = mipmaps; texture_import->mipmaps = mipmaps;
texture_import->used_channels = used_channels; texture_import->used_channels = used_channels;
_check_compress_ctex(texture_import); _check_compress_ctex(p_source_file, texture_import);
if (r_metadata) { if (r_metadata) {
Dictionary metadata; Dictionary metadata;
metadata["vram_texture"] = compress_mode == COMPRESS_VRAM_COMPRESSED; metadata["vram_texture"] = compress_mode == COMPRESS_VRAM_COMPRESSED;
@ -472,7 +472,7 @@ ResourceImporterLayeredTexture::ResourceImporterLayeredTexture() {
ResourceImporterLayeredTexture::~ResourceImporterLayeredTexture() { ResourceImporterLayeredTexture::~ResourceImporterLayeredTexture() {
} }
void ResourceImporterLayeredTexture::_check_compress_ctex(Ref<LayeredTextureImport> r_texture_import) { void ResourceImporterLayeredTexture::_check_compress_ctex(const String &p_source_file, Ref<LayeredTextureImport> r_texture_import) {
String extension = get_save_extension(); String extension = get_save_extension();
ERR_FAIL_NULL(r_texture_import->csource); ERR_FAIL_NULL(r_texture_import->csource);
if (r_texture_import->compress_mode != COMPRESS_VRAM_COMPRESSED) { if (r_texture_import->compress_mode != COMPRESS_VRAM_COMPRESSED) {
@ -542,5 +542,5 @@ void ResourceImporterLayeredTexture::_check_compress_ctex(Ref<LayeredTextureImpo
} }
return; return;
} }
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 PC VRAM compression algorithm enabled in Project Settings (S3TC or BPTC). This texture may not display correctly on desktop platforms."), p_source_file));
} }

View file

@ -87,7 +87,7 @@ protected:
static ResourceImporterLayeredTexture *singleton; static ResourceImporterLayeredTexture *singleton;
public: public:
void _check_compress_ctex(Ref<LayeredTextureImport> r_texture_import); void _check_compress_ctex(const String &p_source_file, Ref<LayeredTextureImport> r_texture_import);
static ResourceImporterLayeredTexture *get_singleton() { return singleton; } static ResourceImporterLayeredTexture *get_singleton() { return singleton; }
virtual String get_importer_name() const override; virtual String get_importer_name() const override;

View file

@ -597,7 +597,7 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String
} }
if (!ok_on_pc) { 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 { } else {
//import normally //import normally