diff --git a/Common/File/VFS/ZipFileReader.cpp b/Common/File/VFS/ZipFileReader.cpp index d4e4f69e66..8935fafe55 100644 --- a/Common/File/VFS/ZipFileReader.cpp +++ b/Common/File/VFS/ZipFileReader.cpp @@ -15,13 +15,15 @@ #include "Common/File/VFS/ZipFileReader.h" #include "Common/StringUtils.h" -ZipFileReader *ZipFileReader::Create(const Path &zipFile, const char *inZipPath) { +ZipFileReader *ZipFileReader::Create(const Path &zipFile, const char *inZipPath, bool logErrors) { int error = 0; zip *zip_file; if (zipFile.Type() == PathType::CONTENT_URI) { int fd = File::OpenFD(zipFile, File::OPEN_READ); if (!fd) { - ERROR_LOG(IO, "Failed to open FD for %s as zip file", zipFile.c_str()); + if (logErrors) { + ERROR_LOG(IO, "Failed to open FD for '%s' as zip file", zipFile.c_str()); + } return nullptr; } zip_file = zip_fdopen(fd, 0, &error); @@ -30,7 +32,9 @@ ZipFileReader *ZipFileReader::Create(const Path &zipFile, const char *inZipPath) } if (!zip_file) { - ERROR_LOG(IO, "Failed to open %s as a zip file", zipFile.c_str()); + if (logErrors) { + ERROR_LOG(IO, "Failed to open %s as a zip file", zipFile.c_str()); + } return nullptr; } diff --git a/Common/File/VFS/ZipFileReader.h b/Common/File/VFS/ZipFileReader.h index f39058beed..44a3292ede 100644 --- a/Common/File/VFS/ZipFileReader.h +++ b/Common/File/VFS/ZipFileReader.h @@ -16,7 +16,7 @@ class ZipFileReader : public VFSBackend { public: - static ZipFileReader *Create(const Path &zipFile, const char *inZipPath); + static ZipFileReader *Create(const Path &zipFile, const char *inZipPath, bool logErrors = true); ~ZipFileReader(); bool IsValid() const { return zip_file_ != nullptr; } diff --git a/GPU/Common/TextureReplacer.cpp b/GPU/Common/TextureReplacer.cpp index 432cf51c07..00275dcd97 100644 --- a/GPU/Common/TextureReplacer.cpp +++ b/GPU/Common/TextureReplacer.cpp @@ -124,9 +124,12 @@ bool TextureReplacer::LoadIni() { delete vfs_; vfs_ = nullptr; + Path zipPath = basePath_ / ZIP_FILENAME; + // First, check for textures.zip, which is used to reduce IO. - VFSBackend *dir = ZipFileReader::Create(basePath_ / ZIP_FILENAME, ""); + VFSBackend *dir = ZipFileReader::Create(zipPath, "", false); if (!dir) { + INFO_LOG(G3D, "%s wasn't a zip file - opening the directory %s instead.", zipPath.c_str(), basePath_.c_str()); vfsIsZip_ = false; dir = new DirectoryReader(basePath_); } else {