Revert some unnecessary log changes from #18001

This commit is contained in:
Henrik Rydgård 2023-08-29 23:13:45 +02:00
parent ac2859348d
commit 42b0ccd07d
3 changed files with 2 additions and 18 deletions

View file

@ -403,18 +403,6 @@ std::map<std::string, std::string> Section::ToMap() const
return outMap;
}
std::vector<std::pair<std::string, std::string>> Section::ToVec() const {
std::vector<std::pair<std::string, std::string>> outVec;
for (std::vector<std::string>::const_iterator iter = lines.begin(); iter != lines.end(); ++iter)
{
std::string lineKey, lineValue;
if (ParseLine(*iter, &lineKey, &lineValue, NULL)) {
outVec.push_back(std::pair<std::string, std::string>(lineKey, lineValue));
}
}
return outVec;
}
bool Section::Delete(const char *key)
{
std::string* line = GetLine(key, 0, 0);

View file

@ -28,7 +28,6 @@ public:
void Clear();
std::map<std::string, std::string> ToMap() const;
std::vector<std::pair<std::string, std::string>> 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;

View file

@ -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.