mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-23 14:25:37 +00:00
FrontendCommon: Add a hotkey to reload post processing
This commit is contained in:
parent
a409a5d45d
commit
2492eb8678
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue