FrontendCommon: Add a hotkey to reload post processing

This commit is contained in:
Connor McLaughlin 2020-09-13 20:21:05 +10:00
parent a409a5d45d
commit 2492eb8678
2 changed files with 20 additions and 0 deletions

View file

@ -1438,6 +1438,12 @@ void CommonHostInterface::RegisterGraphicsHotkeys()
if (!pressed)
ModifyResolutionScale(-1);
});
RegisterHotkey(StaticString("Graphics"), StaticString("ReloadPostProcessingShaders"),
StaticString(TRANSLATABLE("Hotkeys", "Reload Post Processing Shaders")), [this](bool pressed) {
if (!pressed)
ReloadPostProcessingShaders();
});
}
void CommonHostInterface::RegisterSaveStateHotkeys()
@ -2265,6 +2271,17 @@ void CommonHostInterface::ApplyCheatCode(u32 index)
}
}
void CommonHostInterface::ReloadPostProcessingShaders()
{
if (!m_display)
return;
if (!m_display->SetPostProcessingChain(g_settings.display_post_process_chain))
AddOSDMessage(TranslateStdString("OSDMessage", "Failed to load post processing shader chain."), 20.0f);
else
AddOSDMessage(TranslateStdString("OSDMessage", "Post processing shaders reloaded."), 10.0f);
}
#ifdef WITH_DISCORD_PRESENCE
void CommonHostInterface::SetDiscordPresenceEnabled(bool enabled)

View file

@ -166,6 +166,9 @@ public:
/// Immediately applies the specified cheat code.
void ApplyCheatCode(u32 index);
/// Reloads post processing shaders with the current configuration.
void ReloadPostProcessingShaders();
protected:
enum : u32
{