mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-26 07:43:36 +01:00
Make 'load defaults' work for per-game configs. Move 'stop' code into PSP_Shutdown
This commit is contained in:
1 parent
664ac1061f
commit
a5fcf9dd5f
5 files changed
+18
-17
No files matched your search
+12
-11
@@ -1060,10 +1060,18 @@ const std::string Config::FindConfigFile(const std::string &baseFilename) {
|
||||
}
|
||||
|
||||
void Config::RestoreDefaults() {
|
||||
if(File::Exists(iniFilename_))
|
||||
File::Delete(iniFilename_);
|
||||
recentIsos.clear();
|
||||
currentDirectory = "";
|
||||
if (bGameSpecific)
|
||||
{
|
||||
deleteGameConfig(gameId);
|
||||
createGameConfig(gameId);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (File::Exists(iniFilename_))
|
||||
File::Delete(iniFilename_);
|
||||
recentIsos.clear();
|
||||
currentDirectory = "";
|
||||
}
|
||||
Load();
|
||||
}
|
||||
|
||||
@@ -1092,7 +1100,6 @@ bool Config::createGameConfig(const std::string &pGameId)
|
||||
}
|
||||
|
||||
File::CreateEmptyFile(fullIniFilePath);
|
||||
g_Config.saveGameConfig(pGameId);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1101,11 +1108,6 @@ bool Config::deleteGameConfig(const std::string& pGameId)
|
||||
{
|
||||
std::string fullIniFilePath = getGameConfigFile(pGameId);
|
||||
|
||||
if (pGameId == gameId)
|
||||
{
|
||||
unloadGameConfig();
|
||||
Load(iniFilename_.c_str(),controllerIniFilename_.c_str());
|
||||
}
|
||||
File::Delete(fullIniFilePath);
|
||||
return true;
|
||||
}
|
||||
@@ -1150,7 +1152,6 @@ bool Config::loadGameConfig(const std::string &pGameId)
|
||||
if (!hasGameConfig(pGameId))
|
||||
{
|
||||
INFO_LOG(LOADER, "Failed to read %s. No game-specific settings found, using global defaults.", iniFileNameFull.c_str());
|
||||
// NO game specific config file found
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user