Add ScreenAttract::AutoBeginFadingOut() to disable sending

SM_BeginFadingOut.  We can't do this in the ctor (since it's sent during
Update now); we can't do it in Update(), because if the message is posted
with a delay of 0 (ScreenRanking), the message will be added by
ScreenAttract::Update and immediately processed by Actor::Update
before the derived Update can remove it.
This commit is contained in:
Glenn Maynard
2005-01-16 14:48:44 +00:00
parent 66c6018ed1
commit 7183a5e271
4 changed files with 14 additions and 10 deletions
+10 -8
View File
@@ -122,16 +122,18 @@ void ScreenAttract::Update( float fDelta )
{
// The shared background isn't loaded until the screen is actually
// showing. The background is loaded by the time of the first update.
BGAnimation &background = *SCREENMAN->m_pSharedBGA;
float fTimeUntilBeginFadingOut = background.GetTweenTimeLeft() - m_Out.GetTweenTimeLeft();
if( fTimeUntilBeginFadingOut < 0 )
if( AutoBeginFadingOut() )
{
LOG->Warn( "Screen '%s' Out BGAnimation (%f seconds) is longer than Background BGAnimation (%f seconds); background BGA will be truncated",
m_sName.c_str(), m_Out.GetTweenTimeLeft(), background.GetTweenTimeLeft() );
fTimeUntilBeginFadingOut = 0;
BGAnimation &background = *SCREENMAN->m_pSharedBGA;
float fTimeUntilBeginFadingOut = background.GetTweenTimeLeft() - m_Out.GetTweenTimeLeft();
if( fTimeUntilBeginFadingOut < 0 )
{
LOG->Warn( "Screen '%s' Out BGAnimation (%f seconds) is longer than Background BGAnimation (%f seconds); background BGA will be truncated",
m_sName.c_str(), m_Out.GetTweenTimeLeft(), background.GetTweenTimeLeft() );
fTimeUntilBeginFadingOut = 0;
}
this->PostScreenMessage( SM_BeginFadingOut, fTimeUntilBeginFadingOut );
}
this->PostScreenMessage( SM_BeginFadingOut, fTimeUntilBeginFadingOut );
if( GAMESTATE->IsTimeToPlayAttractSounds() )
SOUND->PlayMusic( THEME->GetPathToS(m_sName + " music") );
+2
View File
@@ -19,6 +19,8 @@ public:
virtual void HandleScreenMessage( const ScreenMessage SM );
protected:
virtual bool AutoBeginFadingOut() const { return true; }
Transition m_In;
Transition m_Out;
};
-2
View File
@@ -362,8 +362,6 @@ ScreenRanking::ScreenRanking( CString sClassName ) : ScreenAttract( sClassName )
}
}
this->ClearMessageQueue( SM_BeginFadingOut ); // ignore ScreenAttract's SecsToShow
this->PostScreenMessage( SM_ShowNextPage, 0.5f );
}
+2
View File
@@ -34,6 +34,8 @@ public:
void HandleScreenMessage( const ScreenMessage SM );
protected:
virtual bool AutoBeginFadingOut() const { return false; }
struct PageToShow
{
PageToShow()