Add per-game overrides (mainly for compatibility)

This commit is contained in:
Connor McLaughlin
2020-08-20 21:30:11 +10:00
parent e8da20f174
commit 60d3fffec1
21 changed files with 1172 additions and 185 deletions

View File

@ -71,6 +71,8 @@ bool CommonHostInterface::Initialize()
m_game_list->SetCacheFilename(GetUserDirectoryRelativePath("cache/gamelist.cache"));
m_game_list->SetDatabaseFilename(GetUserDirectoryRelativePath("cache/redump.dat"));
m_game_list->SetCompatibilityFilename(GetProgramDirectoryRelativePath("database/compatibility.xml"));
m_game_list->SetGameSettingsFilename(GetProgramDirectoryRelativePath("database/gamesettings.ini"));
m_game_list->SetUserGameSettingsFilename(GetUserDirectoryRelativePath("gamesettings.ini"));
m_save_state_selector_ui = std::make_unique<FrontendCommon::SaveStateSelectorUI>(this);
@ -2024,6 +2026,17 @@ bool CommonHostInterface::SaveScreenshot(const char* filename /* = nullptr */, b
return true;
}
void CommonHostInterface::ApplyGameSettings(bool display_osd_messages)
{
// this gets called while booting, so can't use valid
if (System::IsShutdown() || System::GetRunningCode().empty())
return;
const GameSettings::Entry* gs = m_game_list->GetGameSettings(System::GetRunningPath(), System::GetRunningCode());
if (gs)
gs->ApplySettings(display_osd_messages);
}
#ifdef WITH_DISCORD_PRESENCE
void CommonHostInterface::SetDiscordPresenceEnabled(bool enabled)

View File

@ -266,6 +266,8 @@ protected:
void RecreateSystem() override;
void ApplyGameSettings(bool display_osd_messages);
virtual void DrawImGuiWindows();
void DrawFPSWindow();