From d13f4a176882642fef728d769c261104dc4190a6 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Sat, 5 Jan 2008 15:31:59 +0000 Subject: [PATCH] Hack to keep banner movies from playing faster and faster due to Update() being called multiple times in the underlying MovieTexture by unloading the texture if it appears more than once in the list of fading banners. --- stepmania/src/FadingBanner.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/stepmania/src/FadingBanner.cpp b/stepmania/src/FadingBanner.cpp index 8d0805792c..a2648bc124 100644 --- a/stepmania/src/FadingBanner.cpp +++ b/stepmania/src/FadingBanner.cpp @@ -73,6 +73,23 @@ void FadingBanner::Load( RageTextureID ID, bool bLowResToHighRes ) { BeforeChange( bLowResToHighRes ); m_Banner[m_iIndexLatest].Load(ID); + + /* XXX: Hack to keep movies from updating multiple times. + * We need to either completely disallow movies in banners or support + * them. There are a number of files that use them currently in the + * wild. If we wanted to support them, then perhaps we should use an + * all-black texture for the low quality texture. */ + RageTexture *pTexture = m_Banner[m_iIndexLatest].GetTexture(); + if( !pTexture || !pTexture->IsAMovie() ) + return; + m_Banner[m_iIndexLatest].SetSecondsIntoAnimation( 0.f ); + for( int i = 1; i < NUM_BANNERS; ++i ) + { + int index = m_iIndexLatest - i; + wrap( index, NUM_BANNERS ); + if( m_Banner[index].GetTexturePath() == ID.filename ) + m_Banner[index].UnloadTexture(); + } } /* If bLowResToHighRes is true, we're fading from a low-res banner to the