mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-23 22:25:42 +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)
|
if (!pressed)
|
||||||
ModifyResolutionScale(-1);
|
ModifyResolutionScale(-1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
RegisterHotkey(StaticString("Graphics"), StaticString("ReloadPostProcessingShaders"),
|
||||||
|
StaticString(TRANSLATABLE("Hotkeys", "Reload Post Processing Shaders")), [this](bool pressed) {
|
||||||
|
if (!pressed)
|
||||||
|
ReloadPostProcessingShaders();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void CommonHostInterface::RegisterSaveStateHotkeys()
|
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
|
#ifdef WITH_DISCORD_PRESENCE
|
||||||
|
|
||||||
void CommonHostInterface::SetDiscordPresenceEnabled(bool enabled)
|
void CommonHostInterface::SetDiscordPresenceEnabled(bool enabled)
|
||||||
|
|
|
@ -166,6 +166,9 @@ public:
|
||||||
/// Immediately applies the specified cheat code.
|
/// Immediately applies the specified cheat code.
|
||||||
void ApplyCheatCode(u32 index);
|
void ApplyCheatCode(u32 index);
|
||||||
|
|
||||||
|
/// Reloads post processing shaders with the current configuration.
|
||||||
|
void ReloadPostProcessingShaders();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
enum : u32
|
enum : u32
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue