Transition style now also affects launch transition.

"Fade" only does a fade. "Slide" does the old move camera + fade effect.
This commit is contained in:
Aloshi 2014-04-30 12:40:25 -05:00
parent a9514843b4
commit b33a03fe83

View file

@ -112,6 +112,23 @@ void ViewController::launch(FileData* game, Eigen::Vector3f center)
center += mCurrentView->getPosition();
stopAnimation(1); // make sure the fade in isn't still playing
mLockInput = true;
if(Settings::getInstance()->getString("TransitionStyle") == "fade")
{
// fade out, launch game, fade back in
auto fadeFunc = [this](float t) {
t -= 1;
mFadeOpacity = lerp<float>(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);
@ -120,6 +137,7 @@ void ViewController::launch(FileData* game, Eigen::Vector3f center)
setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 600), 0, nullptr, true);
this->onFileChanged(game, FILE_METADATA_CHANGED);
});
}
}
std::shared_ptr<IGameListView> ViewController::getGameListView(SystemData* system)