CoreParameter: Unify LoadDefaultGameIni and LoadLocalGameIni

A side effect of this is that user INIs now can specify revisions.
I don't think anyone will use it, but there's no reason to not allow it.
This commit is contained in:
JosJuice 2015-02-06 19:34:17 +01:00
parent d73a6ea3b7
commit 8670f2a627
2 changed files with 8 additions and 14 deletions

View File

@ -378,33 +378,28 @@ void SCoreStartupParameter::CheckMemcardPath(std::string& memcardPath, std::stri
IniFile SCoreStartupParameter::LoadDefaultGameIni() const
{
IniFile game_ini;
LoadDefaultGameIni(&game_ini);
LoadGameIni(&game_ini, File::GetSysDirectory() + GAMESETTINGS_DIR DIR_SEP);
return game_ini;
}
IniFile SCoreStartupParameter::LoadLocalGameIni() const
{
IniFile game_ini;
LoadLocalGameIni(&game_ini);
LoadGameIni(&game_ini, File::GetUserPath(D_GAMESETTINGS_IDX));
return game_ini;
}
IniFile SCoreStartupParameter::LoadGameIni() const
{
IniFile game_ini;
LoadDefaultGameIni(&game_ini);
LoadLocalGameIni(&game_ini);
LoadGameIni(&game_ini, File::GetSysDirectory() + GAMESETTINGS_DIR DIR_SEP);
LoadGameIni(&game_ini, File::GetUserPath(D_GAMESETTINGS_IDX));
return game_ini;
}
void SCoreStartupParameter::LoadDefaultGameIni(IniFile* game_ini) const
void SCoreStartupParameter::LoadGameIni(IniFile* game_ini, const std::string& path) const
{
game_ini->Load(File::GetSysDirectory() + GAMESETTINGS_DIR DIR_SEP + GetUniqueID() + ".ini", true);
game_ini->Load(path + GetUniqueID() + ".ini", true);
if (!m_strRevisionSpecificUniqueID.empty())
game_ini->Load(File::GetSysDirectory() + GAMESETTINGS_DIR DIR_SEP + m_strRevisionSpecificUniqueID + ".ini", true);
}
void SCoreStartupParameter::LoadLocalGameIni(IniFile* game_ini) const
{
game_ini->Load(File::GetUserPath(D_GAMESETTINGS_IDX) + GetUniqueID() + ".ini", true);
game_ini->Load(path + m_strRevisionSpecificUniqueID + ".ini", true);
}

View File

@ -265,6 +265,5 @@ struct SCoreStartupParameter
IniFile LoadGameIni() const;
private:
void LoadDefaultGameIni(IniFile* game_ini) const;
void LoadLocalGameIni(IniFile* game_ini) const;
void LoadGameIni(IniFile* game_ini, const std::string& path) const;
};