Skip to content

Commit

Permalink
Merge pull request #5414 from MerryMage/config-fixups
Browse files Browse the repository at this point in the history
Config: Minor fixups
  • Loading branch information
Tilka committed May 13, 2017
2 parents 460459f + bd3e493 commit 9944712
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Source/Core/Common/Config/Section.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class Section
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;
}

Expand Down
8 changes: 4 additions & 4 deletions Source/Core/Core/ConfigLoaders/GameConfigLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 '<System>.<Section>'
Expand Down Expand Up @@ -230,11 +230,11 @@ static std::pair<std::string, std::string> 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 {"", ""};
Expand Down
16 changes: 8 additions & 8 deletions Source/Core/Core/Core.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
<ClCompile Include="Boot\Boot_ELF.cpp" />
<ClCompile Include="Boot\Boot_WiiWAD.cpp" />
<ClCompile Include="Boot\ElfReader.cpp" />
<ClCompile Include="ConfigLoaders\BaseConfigLoader.cpp" />
<ClCompile Include="ConfigLoaders\GameConfigLoader.cpp" />
<ClCompile Include="ConfigLoaders\MovieConfigLoader.cpp" />
<ClCompile Include="ConfigLoaders\NetPlayConfigLoader.cpp" />
<ClCompile Include="ConfigManager.cpp" />
<ClCompile Include="Core.cpp" />
<ClCompile Include="CoreTiming.cpp" />
Expand Down Expand Up @@ -231,10 +235,6 @@
<ClCompile Include="Movie.cpp" />
<ClCompile Include="NetPlayClient.cpp" />
<ClCompile Include="NetPlayServer.cpp" />
<ClCompile Include="ConfigLoaders\BaseConfigLoader.cpp" />
<ClCompile Include="ConfigLoaders\GameConfigLoader.cpp" />
<ClCompile Include="ConfigLoaders\MovieConfigLoader.cpp" />
<ClCompile Include="ConfigLoaders\NetPlayConfigLoader.cpp" />
<ClCompile Include="PatchEngine.cpp" />
<ClCompile Include="PowerPC\BreakPoints.cpp" />
<ClCompile Include="PowerPC\CachedInterpreter\CachedInterpreter.cpp" />
Expand Down Expand Up @@ -308,6 +308,10 @@
<ClInclude Include="Boot\Boot_DOL.h" />
<ClInclude Include="Boot\ElfReader.h" />
<ClInclude Include="Boot\ElfTypes.h" />
<ClInclude Include="ConfigLoaders\BaseConfigLoader.h" />
<ClInclude Include="ConfigLoaders\GameConfigLoader.h" />
<ClInclude Include="ConfigLoaders\MovieConfigLoader.h" />
<ClInclude Include="ConfigLoaders\NetPlayConfigLoader.h" />
<ClInclude Include="ConfigManager.h" />
<ClInclude Include="Core.h" />
<ClInclude Include="CoreTiming.h" />
Expand Down Expand Up @@ -483,10 +487,6 @@
<ClInclude Include="NetPlayClient.h" />
<ClInclude Include="NetPlayProto.h" />
<ClInclude Include="NetPlayServer.h" />
<ClInclude Include="ConfigLoaders\BaseConfigLoader.h" />
<ClInclude Include="ConfigLoaders\GameConfigLoader.h" />
<ClInclude Include="ConfigLoaders\MovieConfigLoader.h" />
<ClInclude Include="ConfigLoaders\NetPlayConfigLoader.h" />
<ClInclude Include="PatchEngine.h" />
<ClInclude Include="PowerPC\BreakPoints.h" />
<ClInclude Include="PowerPC\CPUCoreBase.h" />
Expand Down
37 changes: 28 additions & 9 deletions Source/Core/Core/Core.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
<Filter Include="Boot">
<UniqueIdentifier>{2472fb36-5473-4d49-ad2d-3699b78ab6e2}</UniqueIdentifier>
</Filter>
<Filter Include="ConfigLoader">
<UniqueIdentifier>{259a11eb-ca07-4b31-b849-7286dbd4550a}</UniqueIdentifier>
</Filter>
<Filter Include="Debugger">
<UniqueIdentifier>{ed683a12-55f0-49cb-918b-c7edbcf57268}</UniqueIdentifier>
</Filter>
Expand Down Expand Up @@ -170,10 +173,6 @@
<ClCompile Include="NetPlayClient.cpp" />
<ClCompile Include="NetPlayServer.cpp" />
<ClCompile Include="PatchEngine.cpp" />
<ClCompile Include="ConfigLoaders\BaseConfigLoader.cpp" />
<ClCompile Include="ConfigLoaders\GameConfigLoader.cpp" />
<ClCompile Include="ConfigLoaders\MovieConfigLoader.cpp" />
<ClCompile Include="ConfigLoaders\NetPlayConfigLoader.cpp" />
<ClCompile Include="State.cpp" />
<ClCompile Include="WiiRoot.cpp" />
<ClCompile Include="ActionReplay.cpp">
Expand Down Expand Up @@ -886,6 +885,18 @@
<ClCompile Include="PowerPC\Jit64Common\ConstantPool.cpp">
<Filter>PowerPC\Jit64Common</Filter>
</ClCompile>
<ClCompile Include="ConfigLoaders\BaseConfigLoader.cpp">
<Filter>ConfigLoader</Filter>
</ClCompile>
<ClCompile Include="ConfigLoaders\GameConfigLoader.cpp">
<Filter>ConfigLoader</Filter>
</ClCompile>
<ClCompile Include="ConfigLoaders\MovieConfigLoader.cpp">
<Filter>ConfigLoader</Filter>
</ClCompile>
<ClCompile Include="ConfigLoaders\NetPlayConfigLoader.cpp">
<Filter>ConfigLoader</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="BootManager.h" />
Expand All @@ -901,10 +912,6 @@
<ClInclude Include="NetPlayProto.h" />
<ClInclude Include="NetPlayServer.h" />
<ClInclude Include="PatchEngine.h" />
<ClInclude Include="ConfigLoaders\BaseConfigLoader.h" />
<ClInclude Include="ConfigLoaders\GameConfigLoader.h" />
<ClInclude Include="ConfigLoaders\MovieConfigLoader.h" />
<ClInclude Include="ConfigLoaders\NetPlayConfigLoader.h" />
<ClInclude Include="State.h" />
<ClInclude Include="WiiRoot.h" />
<ClInclude Include="ActionReplay.h">
Expand Down Expand Up @@ -1376,7 +1383,7 @@
<ClInclude Include="Analytics.h" />
<ClInclude Include="PowerPC\SignatureDB\CSVSignatureDB.h" />
<ClInclude Include="PowerPC\SignatureDB\DSYSignatureDB.h" />
<ClCompile Include="PowerPC\SignatureDB\MEGASignatureDB.h" />
<ClInclude Include="PowerPC\SignatureDB\MEGASignatureDB.h" />
<ClInclude Include="PowerPC\SignatureDB\SignatureDB.h" />
<ClInclude Include="IOS\USB\Bluetooth\BTBase.h">
<Filter>IOS\USB\Bluetooth</Filter>
Expand Down Expand Up @@ -1522,6 +1529,18 @@
<ClInclude Include="PowerPC\Jit64Common\ConstantPool.h">
<Filter>PowerPC\Jit64Common</Filter>
</ClInclude>
<ClInclude Include="ConfigLoaders\BaseConfigLoader.h">
<Filter>ConfigLoader</Filter>
</ClInclude>
<ClInclude Include="ConfigLoaders\GameConfigLoader.h">
<Filter>ConfigLoader</Filter>
</ClInclude>
<ClInclude Include="ConfigLoaders\MovieConfigLoader.h">
<Filter>ConfigLoader</Filter>
</ClInclude>
<ClInclude Include="ConfigLoaders\NetPlayConfigLoader.h">
<Filter>ConfigLoader</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Text Include="CMakeLists.txt" />
Expand Down

0 comments on commit 9944712

Please sign in to comment.