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.

This commit is contained in:
Steve Checkoway
2008-01-05 15:31:59 +00:00
parent e905fa7628
commit d13f4a1768
+17
View File
@@ -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