From 4fd0423b07a0e5a926498fe8052ade3abe35bf35 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 16 May 2021 18:02:07 +0200 Subject: [PATCH] Made 'dim' the fallback screensaver instead of 'black'. Also set the default screensaver type to 'video' instead of 'dim'. --- es-app/src/SystemScreensaver.cpp | 27 +++++++++++------------ es-app/src/guis/GuiScreensaverOptions.cpp | 2 +- es-core/src/Settings.cpp | 4 ++-- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/es-app/src/SystemScreensaver.cpp b/es-app/src/SystemScreensaver.cpp index 56e402542..faccddbcf 100644 --- a/es-app/src/SystemScreensaver.cpp +++ b/es-app/src/SystemScreensaver.cpp @@ -383,21 +383,8 @@ void SystemScreensaver::renderScreensaver() mFallbackScreensaver = true; } } - if (mFallbackScreensaver || - Settings::getInstance()->getString("ScreensaverType") == "black") { - #if defined(USE_OPENGL_21) - Renderer::shaderParameters blackParameters; - blackParameters.fragmentDimValue = mDimValue; - Renderer::shaderPostprocessing(Renderer::SHADER_DIM, blackParameters); - if (mDimValue > 0.0) - mDimValue = Math::clamp(mDimValue - 0.045f, 0.0f, 1.0f); - #else - Renderer::drawRect(0.0f, 0.0f, Renderer::getScreenWidth(), - Renderer::getScreenHeight(), 0x000000FF, 0x000000FF); - #endif - } - else if (Settings::getInstance()->getString("ScreensaverType") == "dim") { + Settings::getInstance()->getString("ScreensaverType") == "dim") { #if defined(USE_OPENGL_21) Renderer::shaderParameters dimParameters; dimParameters.fragmentDimValue = mDimValue; @@ -413,6 +400,18 @@ void SystemScreensaver::renderScreensaver() Renderer::getScreenHeight(), 0x000000A0, 0x000000A0); #endif } + else if (Settings::getInstance()->getString("ScreensaverType") == "black") { + #if defined(USE_OPENGL_21) + Renderer::shaderParameters blackParameters; + blackParameters.fragmentDimValue = mDimValue; + Renderer::shaderPostprocessing(Renderer::SHADER_DIM, blackParameters); + if (mDimValue > 0.0) + mDimValue = Math::clamp(mDimValue - 0.045f, 0.0f, 1.0f); + #else + Renderer::drawRect(0.0f, 0.0f, Renderer::getScreenWidth(), + Renderer::getScreenHeight(), 0x000000FF, 0x000000FF); + #endif + } } } diff --git a/es-app/src/guis/GuiScreensaverOptions.cpp b/es-app/src/guis/GuiScreensaverOptions.cpp index 3c891d4ed..a8a4f3802 100644 --- a/es-app/src/guis/GuiScreensaverOptions.cpp +++ b/es-app/src/guis/GuiScreensaverOptions.cpp @@ -52,7 +52,7 @@ GuiScreensaverOptions::GuiScreensaverOptions(Window* window, const std::string& mWindow->pushGui(new GuiMsgBox(mWindow, getHelpStyle(), "THE 'VIDEO' SCREENSAVER SHOWS\nVIDEOS FROM YOUR GAMELISTS\n\n" "IF YOU DO NOT HAVE ANY VIDEOS, THE\n" - "SCREENSAVER WILL DEFAULT TO 'BLACK'", + "SCREENSAVER WILL DEFAULT TO 'DIM'", "OK", [] { return; }, "", nullptr, "", nullptr)); } Settings::getInstance()->setString("ScreensaverType", diff --git a/es-core/src/Settings.cpp b/es-core/src/Settings.cpp index 0ed3518e0..9c19a9ddb 100644 --- a/es-core/src/Settings.cpp +++ b/es-core/src/Settings.cpp @@ -148,8 +148,8 @@ void Settings::setDefaults() mBoolMap["MediaViewerScreenshotScanlines"] = { true, true }; // UI settings -> screensaver settings. - mIntMap["ScreensaverTimer"] = { 5*60*1000, 5*60*1000 }; // 5 minutes - mStringMap["ScreensaverType"] = { "dim", "dim" }; + mIntMap["ScreensaverTimer"] = { 5 * 60 * 1000, 5 * 60 * 1000 }; // 5 minutes. + mStringMap["ScreensaverType"] = { "video", "video" }; mBoolMap["ScreensaverControls"] = { true, true }; // UI settings -> screensaver settings -> slideshow screensaver settings.