Merge pull request #221 from hex007/fix-blank-screen-217

Fixes blank screen on key press while exiting game
This commit is contained in:
Jools Wills 2017-08-23 02:38:23 +01:00 committed by GitHub
commit e0eb0f6ae1

View file

@ -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<float>(0.0f, 1.0f, t*t*t + 1);
mFadeOpacity = lerp<float>(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);
});
}