Replacement: Log only missing explicit filenames.

This commit is contained in:
Unknown W. Brackets 2022-10-30 08:53:24 -07:00
parent 0db48c956c
commit b78c310b47
2 changed files with 5 additions and 4 deletions

View File

@ -420,7 +420,7 @@ void TextureReplacer::PopulateReplacement(ReplacedTexture *result, u64 cachekey,
ReplacedTextureLevel level;
level.fmt = Draw::DataFormat::R8G8B8A8_UNORM;
level.file = filename;
bool good = PopulateLevel(level);
bool good = PopulateLevel(level, hashfile == HashName(cachekey, hash, i) + ".png");
// We pad files that have been hashrange'd so they are the same texture size.
level.w = (level.w * w) / newW;
@ -463,12 +463,13 @@ static ReplacedImageType Identify(FILE *fp) {
return ReplacedImageType::INVALID;
}
bool TextureReplacer::PopulateLevel(ReplacedTextureLevel &level) {
bool TextureReplacer::PopulateLevel(ReplacedTextureLevel &level, bool ignoreError) {
bool good = false;
FILE *fp = File::OpenCFile(level.file, "rb");
if (!fp) {
ERROR_LOG(G3D, "Error opening replacement texture file '%s'", level.file.c_str());
if (!ignoreError)
ERROR_LOG(G3D, "Error opening replacement texture file '%s'", level.file.c_str());
return false;
}

View File

@ -241,7 +241,7 @@ protected:
std::string LookupHashFile(u64 cachekey, u32 hash, int level);
std::string HashName(u64 cachekey, u32 hash, int level);
void PopulateReplacement(ReplacedTexture *result, u64 cachekey, u32 hash, int w, int h);
bool PopulateLevel(ReplacedTextureLevel &level);
bool PopulateLevel(ReplacedTextureLevel &level, bool ignoreError);
bool enabled_ = false;
bool allowVideo_ = false;