mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 15:45:38 +00:00
Added an option to disable the blurring of the background when opening menus.
This commit is contained in:
parent
06f88093c6
commit
a46222030c
|
@ -331,6 +331,19 @@ void GuiMenu::openUISettings()
|
||||||
s->setNeedsSaving();
|
s->setNeedsSaving();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Blur background when the menu is open.
|
||||||
|
auto menu_blur_background = std::make_shared<SwitchComponent>(mWindow);
|
||||||
|
menu_blur_background->setState(Settings::getInstance()->getBool("MenuBlurBackground"));
|
||||||
|
s->addWithLabel("BLUR BACKGROUND WHEN MENU IS OPEN", menu_blur_background);
|
||||||
|
s->addSaveFunc([menu_blur_background, s] {
|
||||||
|
if (menu_blur_background->getState() !=
|
||||||
|
Settings::getInstance()->getBool("MenuBlurBackground")) {
|
||||||
|
Settings::getInstance()->setBool("MenuBlurBackground",
|
||||||
|
menu_blur_background->getState());
|
||||||
|
s->setNeedsSaving();
|
||||||
|
}
|
||||||
|
});
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Display pillarboxes (and letterboxes) for videos in the gamelists.
|
// Display pillarboxes (and letterboxes) for videos in the gamelists.
|
||||||
|
|
|
@ -116,6 +116,7 @@ void Settings::setDefaults()
|
||||||
mStringMap["UIMode"] = { "full", "full" };
|
mStringMap["UIMode"] = { "full", "full" };
|
||||||
mStringMap["DefaultSortOrder"] = { "filename, ascending", "filename, ascending" };
|
mStringMap["DefaultSortOrder"] = { "filename, ascending", "filename, ascending" };
|
||||||
mStringMap["MenuOpeningEffect"] = { "scale-up", "scale-up" };
|
mStringMap["MenuOpeningEffect"] = { "scale-up", "scale-up" };
|
||||||
|
mBoolMap["MenuBlurBackground"] = { true, true };
|
||||||
mBoolMap["GamelistVideoPillarbox"] = { true, true };
|
mBoolMap["GamelistVideoPillarbox"] = { true, true };
|
||||||
mBoolMap["GamelistVideoScanlines"] = { true, true };
|
mBoolMap["GamelistVideoScanlines"] = { true, true };
|
||||||
mBoolMap["FoldersOnTop"] = { true, true };
|
mBoolMap["FoldersOnTop"] = { true, true };
|
||||||
|
|
|
@ -333,6 +333,8 @@ void Window::render()
|
||||||
// Defocus the background using multiple passes of gaussian blur, with the number
|
// Defocus the background using multiple passes of gaussian blur, with the number
|
||||||
// of iterations relative to the screen resolution.
|
// of iterations relative to the screen resolution.
|
||||||
Renderer::shaderParameters backgroundParameters;
|
Renderer::shaderParameters backgroundParameters;
|
||||||
|
|
||||||
|
if (Settings::getInstance()->getBool("MenuBlurBackground")) {
|
||||||
float heightModifier = Renderer::getScreenHeightModifier();
|
float heightModifier = Renderer::getScreenHeightModifier();
|
||||||
|
|
||||||
if (heightModifier < 1)
|
if (heightModifier < 1)
|
||||||
|
@ -356,6 +358,13 @@ void Window::render()
|
||||||
Renderer::shaderPostprocessing(Renderer::SHADER_BLUR_HORIZONTAL |
|
Renderer::shaderPostprocessing(Renderer::SHADER_BLUR_HORIZONTAL |
|
||||||
Renderer::SHADER_BLUR_VERTICAL | Renderer::SHADER_DIM,
|
Renderer::SHADER_BLUR_VERTICAL | Renderer::SHADER_DIM,
|
||||||
backgroundParameters, processedTexture);
|
backgroundParameters, processedTexture);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Dim the background slightly.
|
||||||
|
backgroundParameters.fragmentDimValue = 0.60f;
|
||||||
|
Renderer::shaderPostprocessing(
|
||||||
|
Renderer::SHADER_DIM, backgroundParameters, processedTexture);
|
||||||
|
}
|
||||||
|
|
||||||
mPostprocessedBackground->initFromPixels(processedTexture,
|
mPostprocessedBackground->initFromPixels(processedTexture,
|
||||||
Renderer::getScreenWidth(), Renderer::getScreenHeight());
|
Renderer::getScreenWidth(), Renderer::getScreenHeight());
|
||||||
|
|
Loading…
Reference in a new issue