diff --git a/stepmania/src/FadingBanner.cpp b/stepmania/src/FadingBanner.cpp index b11f886b1d..817658e981 100644 --- a/stepmania/src/FadingBanner.cpp +++ b/stepmania/src/FadingBanner.cpp @@ -22,6 +22,7 @@ static const float FadeTime = 0.25; FadingBanner::FadingBanner() { + m_bMovingFast = false; m_iIndexFront = 0; for( int i=0; i<2; i++ ) this->AddChild( &m_Banner[i] ); @@ -86,9 +87,13 @@ void FadingBanner::BeforeChange() /* If this returns false, the banner couldn't be loaded. */ bool FadingBanner::LoadFromCachedBanner( const CString &path ) { + /* No matter what we load, ensure we don't fade to a stale path. */ + m_sPendingBanner = ""; + if( TEXTUREMAN->IsTextureRegistered( Banner::BannerTex( path ) ) ) { /* The actual file is already cached. Use it. */ + BeforeChange(); m_Banner[GetBackIndex()].Load( Banner::BannerTex(path) ); return true; } @@ -98,6 +103,7 @@ bool FadingBanner::LoadFromCachedBanner( const CString &path ) if( !TEXTUREMAN->IsTextureRegistered(ID) ) return false; + BeforeChange(); m_Banner[GetBackIndex()].Load( ID ); m_sPendingBanner = path; m_PendingTimer.GetDeltaTime(); /* reset */ @@ -107,10 +113,20 @@ bool FadingBanner::LoadFromCachedBanner( const CString &path ) void FadingBanner::LoadFromSong( Song* pSong ) { - BeforeChange(); - if( !LoadFromCachedBanner(pSong->GetBannerPath()) ) - m_Banner[GetBackIndex()].LoadFromSong( pSong ); + { + /* Oops. We couldn't load a banner quickly. We can load the actual + * banner, but that's slow, so we don't want to do that when we're moving + * fast on the music wheel. In that case, we should just keep the banner + * that's there (or load a "moving fast" banner). Once we settle down, + * we'll get called again and load the real banner. */ + + if( !m_bMovingFast ) + { + BeforeChange(); + m_Banner[GetBackIndex()].LoadFromSong( pSong ); + } + } } void FadingBanner::LoadAllMusic() diff --git a/stepmania/src/FadingBanner.h b/stepmania/src/FadingBanner.h index c83669a2a3..524eeedcc2 100644 --- a/stepmania/src/FadingBanner.h +++ b/stepmania/src/FadingBanner.h @@ -31,6 +31,7 @@ public: void LoadRandom(); void LoadFallback(); + void SetMovingFast( bool fast ) { m_bMovingFast=fast; } virtual void Update( float fDeltaTime ); virtual void DrawPrimitives(); @@ -45,6 +46,7 @@ protected: CString m_sPendingBanner; RageTimer m_PendingTimer; + bool m_bMovingFast; }; #endif diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index 4dd681f384..1ff6a4ae86 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -778,6 +778,7 @@ void ScreenSelectMusic::AfterMusicChange() m_arrayNotes[pn].clear(); bool no_banner_change = false; + m_Banner.SetMovingFast( !!m_MusicWheel.IsMoving() ); // if(PREFSMAN->m_BannerCacheType == PREFSMAN->preload_none && m_MusicWheel.IsMoving()) // { /* If we're moving fast and we didn't preload banners, don't touch it. */