From 5a62040f63e7cf23eb2824b0ac456bdf35fcdaf4 Mon Sep 17 00:00:00 2001 From: hex007 Date: Tue, 22 Aug 2017 14:33:26 -0700 Subject: [PATCH] Fixes blank screen on key press while exiting game --- es-app/src/views/ViewController.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/es-app/src/views/ViewController.cpp b/es-app/src/views/ViewController.cpp index 2b7b9fbdd..2b0016b8c 100644 --- a/es-app/src/views/ViewController.cpp +++ b/es-app/src/views/ViewController.cpp @@ -239,15 +239,12 @@ void ViewController::launch(FileData* game, Eigen::Vector3f center) { // fade out, launch game, fade back in auto fadeFunc = [this](float t) { - //t -= 1; - //mFadeOpacity = lerp(0.0f, 1.0f, t*t*t + 1); mFadeOpacity = lerp(0.0f, 1.0f, t); }; setAnimation(new LambdaAnimation(fadeFunc, 800), 0, [this, game, fadeFunc] { game->launchGame(mWindow); - mLockInput = false; - setAnimation(new LambdaAnimation(fadeFunc, 800), 0, nullptr, true); + setAnimation(new LambdaAnimation(fadeFunc, 800), 0, [this] { mLockInput = false; }, true); this->onFileChanged(game, FILE_METADATA_CHANGED); }); } else if (transition_style == "slide"){ @@ -256,17 +253,15 @@ void ViewController::launch(FileData* game, Eigen::Vector3f center) { game->launchGame(mWindow); mCamera = origCamera; - mLockInput = false; - setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 600), 0, nullptr, true); + setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 600), 0, [this] { mLockInput = false; }, true); this->onFileChanged(game, FILE_METADATA_CHANGED); }); - } else { + } else { // instant setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 10), 0, [this, origCamera, center, game] { game->launchGame(mWindow); mCamera = origCamera; - mLockInput = false; - setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 10), 0, nullptr, true); + setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 10), 0, [this] { mLockInput = false; }, true); this->onFileChanged(game, FILE_METADATA_CHANGED); }); }