From dd9e6221559a5dc374bff998342ee70bb8edf224 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Sat, 13 May 2017 14:27:16 +0100 Subject: [PATCH 1/3] GameConfigLoader: Fix blank keys for variable sections --- Source/Core/Core/ConfigLoaders/GameConfigLoader.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/ConfigLoaders/GameConfigLoader.cpp b/Source/Core/Core/ConfigLoaders/GameConfigLoader.cpp index 6e15ce9a30..ecf19eecbb 100644 --- a/Source/Core/Core/ConfigLoaders/GameConfigLoader.cpp +++ b/Source/Core/Core/ConfigLoaders/GameConfigLoader.cpp @@ -196,7 +196,7 @@ static ConfigLocation MapINIToRealLocation(const std::string& section, const std // Certain sections like 'Speedhacks' has keys that are variable it = ini_to_location.find({section, ""}); if (it != ini_to_location.end()) - return it->second; + return {it->second.system, it->second.section, key}; // Attempt to load it as a configuration option // It will be in the format of '.
' @@ -230,11 +230,11 @@ static std::pair GetINILocationFromConfig(const Config // Try again, but this time with an empty key // Certain sections like 'Speedhacks' have keys that are variable it = std::find_if(ini_to_location.begin(), ini_to_location.end(), [&location](const auto& entry) { - return std::tie(entry.second.system, entry.second.key) == - std::tie(location.system, location.key); + return std::tie(entry.second.system, entry.second.section) == + std::tie(location.system, location.section); }); if (it != ini_to_location.end()) - return it->first; + return {it->first.first, location.key}; WARN_LOG(CORE, "Unknown option: %s.%s", location.section.c_str(), location.key.c_str()); return {"", ""}; From af33ae0e02841af3ed5c9de7b295154d879a69d1 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Sat, 13 May 2017 14:31:28 +0100 Subject: [PATCH 2/3] Core: Move ConfigLoaders to a ConfigLoaders filter --- Source/Core/Core/Core.vcxproj | 16 ++++++------ Source/Core/Core/Core.vcxproj.filters | 37 ++++++++++++++++++++------- 2 files changed, 36 insertions(+), 17 deletions(-) diff --git a/Source/Core/Core/Core.vcxproj b/Source/Core/Core/Core.vcxproj index 03cdf20422..b046d1140e 100644 --- a/Source/Core/Core/Core.vcxproj +++ b/Source/Core/Core/Core.vcxproj @@ -45,6 +45,10 @@ + + + + @@ -231,10 +235,6 @@ - - - - @@ -308,6 +308,10 @@ + + + + @@ -483,10 +487,6 @@ - - - - diff --git a/Source/Core/Core/Core.vcxproj.filters b/Source/Core/Core/Core.vcxproj.filters index 012004e38c..1afefc23e1 100644 --- a/Source/Core/Core/Core.vcxproj.filters +++ b/Source/Core/Core/Core.vcxproj.filters @@ -7,6 +7,9 @@ {2472fb36-5473-4d49-ad2d-3699b78ab6e2} + + {259a11eb-ca07-4b31-b849-7286dbd4550a} + {ed683a12-55f0-49cb-918b-c7edbcf57268} @@ -170,10 +173,6 @@ - - - - @@ -886,6 +885,18 @@ PowerPC\Jit64Common + + ConfigLoader + + + ConfigLoader + + + ConfigLoader + + + ConfigLoader + @@ -901,10 +912,6 @@ - - - - @@ -1376,7 +1383,7 @@ - + IOS\USB\Bluetooth @@ -1522,6 +1529,18 @@ PowerPC\Jit64Common + + ConfigLoader + + + ConfigLoader + + + ConfigLoader + + + ConfigLoader + From bd3e493695302ce8efa4ef8287bc69aae981857b Mon Sep 17 00:00:00 2001 From: MerryMage Date: Sat, 13 May 2017 14:34:55 +0100 Subject: [PATCH 3/3] Section: Fix Section::Get --- Source/Core/Common/Config/Section.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Common/Config/Section.h b/Source/Core/Common/Config/Section.h index 4b4ba263ad..8b36ce157e 100644 --- a/Source/Core/Common/Config/Section.h +++ b/Source/Core/Common/Config/Section.h @@ -65,7 +65,7 @@ public: T Get(const std::string& key, const T& default_value) const { T value; - Get(key, value, default_value); + Get(key, &value, default_value); return value; }