Skip to content

Commit

Permalink
Revert some unnecessary log changes from #18001
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Aug 29, 2023
1 parent ac28593 commit 42b0ccd
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
12 changes: 0 additions & 12 deletions Common/Data/Format/IniFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion Common/Data/Format/IniFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class Section {
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;
Expand Down
7 changes: 2 additions & 5 deletions GPU/Common/TextureReplacer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_;

Expand All @@ -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.
Expand Down

0 comments on commit 42b0ccd

Please sign in to comment.