reduce fading banner skips

This commit is contained in:
Glenn Maynard
2004-09-06 05:25:37 +00:00
parent 5339c85250
commit 692ad6c31e
2 changed files with 17 additions and 1 deletions
+16 -1
View File
@@ -20,6 +20,7 @@ FadingBanner::FadingBanner()
MW_SWITCH_SECONDS.Refresh();
m_bMovingFast = false;
m_bSkipNextBannerUpdate = false;
m_iIndexFront = 0;
for( int i=0; i<2; i++ )
this->AddChild( &m_Banner[i] );
@@ -33,7 +34,17 @@ void FadingBanner::ScaleToClipped( float fWidth, float fHeight )
void FadingBanner::Update( float fDeltaTime )
{
ActorFrame::Update( fDeltaTime );
// update children manually
// ActorFrame::Update( fDeltaTime );
Actor::Update( fDeltaTime );
if( !m_bSkipNextBannerUpdate )
{
m_Banner[0].Update( fDeltaTime );
m_Banner[1].Update( fDeltaTime );
}
m_bSkipNextBannerUpdate = false;
/* Don't fade to the full banner until we finish fading. */
float HighQualTime = FADE_SECONDS;
@@ -78,6 +89,10 @@ void FadingBanner::BeforeChange()
m_Banner[m_iIndexFront].SetDiffuse( RageColor(1,1,1,0) );
m_sPendingBanner = "";
/* We're about to load a banner. It'll probably cause a frame skip or
* two. Skip an update, so the fade-in doesn't skip. */
m_bSkipNextBannerUpdate = true;
}
/* If this returns false, the banner couldn't be loaded. */