From c95351d94c896fa40e7aa04e5ddb7689f6fbc57a Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Tue, 22 Jun 2021 18:00:30 +0200 Subject: [PATCH] The game launch screen now uses the same menu opening effect setting as the menus. --- es-app/src/guis/GuiLaunchScreen.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/es-app/src/guis/GuiLaunchScreen.cpp b/es-app/src/guis/GuiLaunchScreen.cpp index bbe7c2ab4..a2c21e4ee 100644 --- a/es-app/src/guis/GuiLaunchScreen.cpp +++ b/es-app/src/guis/GuiLaunchScreen.cpp @@ -172,6 +172,12 @@ void GuiLaunchScreen::displayLaunchScreen(FileData* game) mMarquee->setPosition(currentPos); } + setOrigin({0.5f, 0.5f}); + + // Center on the X axis and keep slightly off-center on the Y axis. + setPosition(static_cast(Renderer::getScreenWidth()) / 2.0f, + static_cast(Renderer::getScreenHeight()) / 2.25f); + mBackground.fitTo(mSize, Vector3f::Zero(), Vector2f(-32, -32)); mBackground.setEdgeColor(0xEEEEEEFF); } @@ -202,20 +208,17 @@ void GuiLaunchScreen::onSizeChanged() void GuiLaunchScreen::update(int deltaTime) { - if (mScaleUp < 1.0f) + if (Settings::getInstance()->getString("MenuOpeningEffect") == "none") + mScaleUp = 1.0f; + else if (mScaleUp < 1.0f) mScaleUp = Math::clamp(mScaleUp + 0.07f, 0.0f, 1.0f); } void GuiLaunchScreen::render() { // Scale up animation. - if (mScaleUp < 1.0f) { - setOrigin({0.5f, 0.5f}); - // Center on the X axis and keep slightly off-center on the Y axis. - setPosition(static_cast(Renderer::getScreenWidth()) / 2.0f, - static_cast(Renderer::getScreenHeight()) / 2.25f); + if (mScaleUp < 1.0f) setScale(mScaleUp); - } Transform4x4f trans = Transform4x4f::Identity() * getTransform(); Renderer::setMatrix(trans);