Disabled launch animations temporarily as they don't work as expected and a proper fix is planned for later.

This commit is contained in:
Leon Styhre 2020-07-19 19:53:11 +02:00
parent 8b3d2c7ef0
commit 34da214a8d
4 changed files with 56 additions and 43 deletions

View file

@ -26,6 +26,10 @@
#include <assert.h> #include <assert.h>
#ifdef _WIN64
#include <SDL2/SDL_timer.h>
#endif
FileData::FileData( FileData::FileData(
FileType type, FileType type,
const std::string& path, const std::string& path,
@ -550,6 +554,9 @@ void FileData::launchGame(Window* window)
#ifdef _WIN64 #ifdef _WIN64
else { else {
window->setLaunchedGame(); window->setLaunchedGame();
// Temporary hack to stop the user from sending any input to ES while
// the game is launching.
SDL_Delay(3000);
} }
#endif #endif

View file

@ -56,8 +56,6 @@ public:
void apply(float t) override void apply(float t) override
{ {
// TEMPORARY, disabled as it causes flicker when launching games.
return;
cameraOut = Transform4x4f::Identity(); cameraOut = Transform4x4f::Identity();
float zoom = Math::lerp(1.0, 4.25f, t*t); float zoom = Math::lerp(1.0, 4.25f, t*t);

View file

@ -1,7 +1,8 @@
// //
// MoveCameraAnimation.h // 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 #pragma once

View file

@ -264,46 +264,53 @@ void ViewController::launch(FileData* game, Vector3f center)
// Let launch sound play to the end before launching game. // Let launch sound play to the end before launching game.
while (NavigationSounds::getInstance()->isPlayingThemeNavigationSound(LAUNCHSOUND)); 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); game->launchGame(mWindow);
setAnimation(new LambdaAnimation(fadeFunc, 800), 0, [this] { mLockInput = false;
mLockInput = false; }, true);
this->onFileChanged(game, FILE_METADATA_CHANGED); this->onFileChanged(game, FILE_METADATA_CHANGED);
if (mCurrentView)
mCurrentView->onShow(); // TEMPORARY - disabled the launch animations as they don't work properly and more
}); // work is needed to fix them.
} //
else if (transition_style == "slide") { // if (transition_style == "fade") {
// Move camera to zoom in on center + fade out, launch game, come back in. // // Fade out, launch game, fade back in.
setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 1500), 0, // auto fadeFunc = [this](float t) {
[this, origCamera, center, game] { // mFadeOpacity = Math::lerp(0.0f, 1.0f, t);
game->launchGame(mWindow); // };
mCamera = origCamera; // setAnimation(new LambdaAnimation(fadeFunc, 800), 0, [this, game, fadeFunc] {
setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 600), 0, [this] { // game->launchGame(mWindow);
mLockInput = false; }, true); // setAnimation(new LambdaAnimation(fadeFunc, 800), 0, [this] {
this->onFileChanged(game, FILE_METADATA_CHANGED); // mLockInput = false; }, true);
if (mCurrentView) // this->onFileChanged(game, FILE_METADATA_CHANGED);
mCurrentView->onShow(); // if (mCurrentView)
}); // mCurrentView->onShow();
} // });
// Instant // }
else { // else if (transition_style == "slide") {
setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 10), 0, // // Move camera to zoom in on center + fade out, launch game, come back in.
[this, origCamera, center, game] { // setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 1500), 0,
game->launchGame(mWindow); // [this, origCamera, center, game] {
mCamera = origCamera; // game->launchGame(mWindow);
setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 10), 0, // mCamera = origCamera;
[this] { mLockInput = false; }, true); // setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 600), 0, [this] {
this->onFileChanged(game, FILE_METADATA_CHANGED); // mLockInput = false; }, true);
if (mCurrentView) // this->onFileChanged(game, FILE_METADATA_CHANGED);
mCurrentView->onShow(); // 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) void ViewController::removeGameListView(SystemData* system)