diff --git a/Common/Data/Format/IniFile.cpp b/Common/Data/Format/IniFile.cpp index ed601a38e206..7deb9f538a5b 100644 --- a/Common/Data/Format/IniFile.cpp +++ b/Common/Data/Format/IniFile.cpp @@ -403,18 +403,6 @@ std::map Section::ToMap() const return outMap; } -std::vector> Section::ToVec() const { - std::vector> outVec; - for (std::vector::const_iterator iter = lines.begin(); iter != lines.end(); ++iter) - { - std::string lineKey, lineValue; - if (ParseLine(*iter, &lineKey, &lineValue, NULL)) { - outVec.push_back(std::pair(lineKey, lineValue)); - } - } - return outVec; -} - bool Section::Delete(const char *key) { std::string* line = GetLine(key, 0, 0); diff --git a/Common/Data/Format/IniFile.h b/Common/Data/Format/IniFile.h index 8860161337bc..528ece1f1c45 100644 --- a/Common/Data/Format/IniFile.h +++ b/Common/Data/Format/IniFile.h @@ -28,7 +28,6 @@ class Section { void Clear(); std::map ToMap() const; - std::vector> ToVec() const; // Often more appropriate than ToMap() - doesn't artifically remove duplicates. std::string *GetLine(const char* key, std::string* valueOut, std::string* commentOut); const std::string *GetLine(const char* key, std::string* valueOut, std::string* commentOut) const; diff --git a/GPU/Common/TextureReplacer.cpp b/GPU/Common/TextureReplacer.cpp index 1c7beb4d73f0..35e62b81ae69 100644 --- a/GPU/Common/TextureReplacer.cpp +++ b/GPU/Common/TextureReplacer.cpp @@ -232,7 +232,7 @@ bool TextureReplacer::LoadIniValues(IniFile &ini, VFSBackend *dir, bool isOverri std::string badFilenames; if (ini.HasSection("hashes")) { - auto hashes = ini.GetOrCreateSection("hashes")->ToVec(); + auto hashes = ini.GetOrCreateSection("hashes")->ToMap(); // Format: hashname = filename.png bool checkFilenames = g_Config.bSaveNewTextures && !g_Config.bIgnoreTextureFilenames && !vfsIsZip_; @@ -242,10 +242,7 @@ bool TextureReplacer::LoadIniValues(IniFile &ini, VFSBackend *dir, bool isOverri // sscanf doesn't write to non-matched outputs. int level = 0; if (sscanf(item.first.c_str(), "%16llx%8x_%d", &key.cachekey, &key.hash, &level) >= 1) { - if (item.second.empty()) { - WARN_LOG(G3D, "Texture replacement: Ignoring hash mapping to empty filename: '%s ='", item.first.c_str()); - continue; - } + // We allow empty filenames, to mark textures that we don't want to keep saving. filenameMap[key][level] = item.second; if (checkFilenames) { // TODO: We should check for the union of these on all platforms, really.