diff --git a/es-app/src/FileData.cpp b/es-app/src/FileData.cpp index 4879536ba..43958384b 100644 --- a/es-app/src/FileData.cpp +++ b/es-app/src/FileData.cpp @@ -26,6 +26,10 @@ #include +#ifdef _WIN64 +#include +#endif + FileData::FileData( FileType type, const std::string& path, @@ -550,6 +554,9 @@ void FileData::launchGame(Window* window) #ifdef _WIN64 else { window->setLaunchedGame(); + // Temporary hack to stop the user from sending any input to ES while + // the game is launching. + SDL_Delay(3000); } #endif diff --git a/es-app/src/animations/LaunchAnimation.h b/es-app/src/animations/LaunchAnimation.h index dbf5e6631..dc593a062 100644 --- a/es-app/src/animations/LaunchAnimation.h +++ b/es-app/src/animations/LaunchAnimation.h @@ -56,8 +56,6 @@ public: void apply(float t) override { - // TEMPORARY, disabled as it causes flicker when launching games. - return; cameraOut = Transform4x4f::Identity(); float zoom = Math::lerp(1.0, 4.25f, t*t); diff --git a/es-app/src/animations/MoveCameraAnimation.h b/es-app/src/animations/MoveCameraAnimation.h index 9da0c6bba..d4729ff4f 100644 --- a/es-app/src/animations/MoveCameraAnimation.h +++ b/es-app/src/animations/MoveCameraAnimation.h @@ -1,7 +1,8 @@ // // MoveCameraAnimation.h // -// Animation to play when moving the camera, used by the slide transition style. +// Animation to play when moving the camera, used by the slide transition style +// (when moving between gamelists using quick system select). // #pragma once diff --git a/es-app/src/views/ViewController.cpp b/es-app/src/views/ViewController.cpp index 1225f7e0e..61642b91c 100644 --- a/es-app/src/views/ViewController.cpp +++ b/es-app/src/views/ViewController.cpp @@ -264,46 +264,53 @@ void ViewController::launch(FileData* game, Vector3f center) // Let launch sound play to the end before launching game. while (NavigationSounds::getInstance()->isPlayingThemeNavigationSound(LAUNCHSOUND)); - if (transition_style == "fade") { - // Fade out, launch game, fade back in. - auto fadeFunc = [this](float t) { - mFadeOpacity = Math::lerp(0.0f, 1.0f, t); - }; - setAnimation(new LambdaAnimation(fadeFunc, 800), 0, [this, game, fadeFunc] { - game->launchGame(mWindow); - setAnimation(new LambdaAnimation(fadeFunc, 800), 0, [this] { - mLockInput = false; }, true); - this->onFileChanged(game, FILE_METADATA_CHANGED); - if (mCurrentView) - mCurrentView->onShow(); - }); - } - else if (transition_style == "slide") { - // 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->launchGame(mWindow); - mCamera = origCamera; - setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 600), 0, [this] { - mLockInput = false; }, true); - this->onFileChanged(game, FILE_METADATA_CHANGED); - if (mCurrentView) - mCurrentView->onShow(); - }); - } - // Instant - else { - setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 10), 0, - [this, origCamera, center, game] { - game->launchGame(mWindow); - mCamera = origCamera; - setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 10), 0, - [this] { mLockInput = false; }, true); - this->onFileChanged(game, FILE_METADATA_CHANGED); - if (mCurrentView) - mCurrentView->onShow(); - }); - } + game->launchGame(mWindow); + mLockInput = false; + this->onFileChanged(game, FILE_METADATA_CHANGED); + + // TEMPORARY - disabled the launch animations as they don't work properly and more + // work is needed to fix them. + // + // if (transition_style == "fade") { + // // Fade out, launch game, fade back in. + // auto fadeFunc = [this](float t) { + // mFadeOpacity = Math::lerp(0.0f, 1.0f, t); + // }; + // setAnimation(new LambdaAnimation(fadeFunc, 800), 0, [this, game, fadeFunc] { + // game->launchGame(mWindow); + // setAnimation(new LambdaAnimation(fadeFunc, 800), 0, [this] { + // mLockInput = false; }, true); + // this->onFileChanged(game, FILE_METADATA_CHANGED); + // if (mCurrentView) + // mCurrentView->onShow(); + // }); + // } + // else if (transition_style == "slide") { + // // 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->launchGame(mWindow); + // mCamera = origCamera; + // setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 600), 0, [this] { + // mLockInput = false; }, true); + // this->onFileChanged(game, FILE_METADATA_CHANGED); + // if (mCurrentView) + // mCurrentView->onShow(); + // }); + // } + // // Instant + // else { + // setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 10), 0, + // [this, origCamera, center, game] { + // game->launchGame(mWindow); + // mCamera = origCamera; + // setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 10), 0, + // [this] { mLockInput = false; }, true); + // this->onFileChanged(game, FILE_METADATA_CHANGED); + // if (mCurrentView) + // mCurrentView->onShow(); + // }); + // } } void ViewController::removeGameListView(SystemData* system)