Made 'dim' the fallback screensaver instead of 'black'.

Also set the default screensaver type to 'video' instead of 'dim'.
This commit is contained in:
Leon Styhre 2021-05-16 18:02:07 +02:00
parent bf39f10381
commit 4fd0423b07
3 changed files with 16 additions and 17 deletions

View file

@ -383,21 +383,8 @@ void SystemScreensaver::renderScreensaver()
mFallbackScreensaver = true; mFallbackScreensaver = true;
} }
} }
if (mFallbackScreensaver || if (mFallbackScreensaver ||
Settings::getInstance()->getString("ScreensaverType") == "black") { Settings::getInstance()->getString("ScreensaverType") == "dim") {
#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") {
#if defined(USE_OPENGL_21) #if defined(USE_OPENGL_21)
Renderer::shaderParameters dimParameters; Renderer::shaderParameters dimParameters;
dimParameters.fragmentDimValue = mDimValue; dimParameters.fragmentDimValue = mDimValue;
@ -413,6 +400,18 @@ void SystemScreensaver::renderScreensaver()
Renderer::getScreenHeight(), 0x000000A0, 0x000000A0); Renderer::getScreenHeight(), 0x000000A0, 0x000000A0);
#endif #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
}
} }
} }

View file

@ -52,7 +52,7 @@ GuiScreensaverOptions::GuiScreensaverOptions(Window* window, const std::string&
mWindow->pushGui(new GuiMsgBox(mWindow, getHelpStyle(), mWindow->pushGui(new GuiMsgBox(mWindow, getHelpStyle(),
"THE 'VIDEO' SCREENSAVER SHOWS\nVIDEOS FROM YOUR GAMELISTS\n\n" "THE 'VIDEO' SCREENSAVER SHOWS\nVIDEOS FROM YOUR GAMELISTS\n\n"
"IF YOU DO NOT HAVE ANY VIDEOS, THE\n" "IF YOU DO NOT HAVE ANY VIDEOS, THE\n"
"SCREENSAVER WILL DEFAULT TO 'BLACK'", "SCREENSAVER WILL DEFAULT TO 'DIM'",
"OK", [] { return; }, "", nullptr, "", nullptr)); "OK", [] { return; }, "", nullptr, "", nullptr));
} }
Settings::getInstance()->setString("ScreensaverType", Settings::getInstance()->setString("ScreensaverType",

View file

@ -148,8 +148,8 @@ void Settings::setDefaults()
mBoolMap["MediaViewerScreenshotScanlines"] = { true, true }; mBoolMap["MediaViewerScreenshotScanlines"] = { true, true };
// UI settings -> screensaver settings. // UI settings -> screensaver settings.
mIntMap["ScreensaverTimer"] = { 5*60*1000, 5*60*1000 }; // 5 minutes mIntMap["ScreensaverTimer"] = { 5 * 60 * 1000, 5 * 60 * 1000 }; // 5 minutes.
mStringMap["ScreensaverType"] = { "dim", "dim" }; mStringMap["ScreensaverType"] = { "video", "video" };
mBoolMap["ScreensaverControls"] = { true, true }; mBoolMap["ScreensaverControls"] = { true, true };
// UI settings -> screensaver settings -> slideshow screensaver settings. // UI settings -> screensaver settings -> slideshow screensaver settings.