diff --git a/src/views/ViewController.cpp b/src/views/ViewController.cpp index caf420b31..11b4f87ed 100644 --- a/src/views/ViewController.cpp +++ b/src/views/ViewController.cpp @@ -112,14 +112,32 @@ void ViewController::launch(FileData* game, Eigen::Vector3f center) center += mCurrentView->getPosition(); stopAnimation(1); // make sure the fade in isn't still playing mLockInput = true; - setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 1500), 0, [this, origCamera, center, game] + + if(Settings::getInstance()->getString("TransitionStyle") == "fade") { - game->getSystem()->launchGame(mWindow, game); - mCamera = origCamera; - mLockInput = false; - setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 600), 0, nullptr, true); - this->onFileChanged(game, FILE_METADATA_CHANGED); - }); + // fade out, launch game, fade back in + auto fadeFunc = [this](float t) { + t -= 1; + mFadeOpacity = lerp(0.0f, 1.0f, t*t*t + 1); + }; + setAnimation(new LambdaAnimation(fadeFunc, 1500), 0, [this, game, fadeFunc] + { + game->getSystem()->launchGame(mWindow, game); + mLockInput = false; + setAnimation(new LambdaAnimation(fadeFunc, 1500), 0, nullptr, true); + this->onFileChanged(game, FILE_METADATA_CHANGED); + }); + }else{ + // move camera to zoom in on center + fade out, launch game, come back in + setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 1500), 0, [this, origCamera, center, game] + { + game->getSystem()->launchGame(mWindow, game); + mCamera = origCamera; + mLockInput = false; + setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 600), 0, nullptr, true); + this->onFileChanged(game, FILE_METADATA_CHANGED); + }); + } } std::shared_ptr ViewController::getGameListView(SystemData* system)