use ConcurrentlyPrepareScreen

This commit is contained in:
Glenn Maynard
2005-07-13 06:51:08 +00:00
parent e1dae4bf04
commit 1ddf7f57da
2 changed files with 22 additions and 3 deletions
+2
View File
@@ -205,6 +205,8 @@ void ScreenSelect::HandleScreenMessage( const ScreenMessage SM )
const int iSelectionIndex = GetSelectionIndex(GAMESTATE->m_MasterPlayerNumber); const int iSelectionIndex = GetSelectionIndex(GAMESTATE->m_MasterPlayerNumber);
m_sNextScreen = NEXT_SCREEN(iSelectionIndex); m_sNextScreen = NEXT_SCREEN(iSelectionIndex);
} }
SCREENMAN->ConcurrentlyPrepareScreen( m_sNextScreen );
} }
else if( SM == SM_AllDoneChoosing ) /* It's our turn to tween out. */ else if( SM == SM_AllDoneChoosing ) /* It's our turn to tween out. */
{ {
+20 -3
View File
@@ -51,9 +51,6 @@ void ScreenStage::Init()
m_Cancel.SetDrawOrder( DRAW_ORDER_TRANSITIONS ); m_Cancel.SetDrawOrder( DRAW_ORDER_TRANSITIONS );
this->AddChild( &m_Cancel ); this->AddChild( &m_Cancel );
/* Prep the new screen once m_In is complete. */
this->PostScreenMessage( SM_PrepScreen, m_sprOverlay->GetTweenTimeLeft() );
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("stage "+StageToString(GAMESTATE->GetCurrentStage())) ); SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("stage "+StageToString(GAMESTATE->GetCurrentStage())) );
this->SortByDrawOrder(); this->SortByDrawOrder();
@@ -74,6 +71,12 @@ void ScreenStage::HandleScreenMessage( const ScreenMessage SM )
} }
else if( SM == SM_BeginFadingOut ) else if( SM == SM_BeginFadingOut )
{ {
if( SCREENMAN->IsConcurrentlyLoading() || m_sprOverlay->GetTweenTimeLeft() )
return;
/* Clear any other SM_BeginFadingOut messages. */
this->ClearMessageQueue( SM_BeginFadingOut );
m_Out.StartTransitioning(); m_Out.StartTransitioning();
this->PostScreenMessage( SM_GoToNextScreen, this->GetTweenTimeLeft() ); this->PostScreenMessage( SM_GoToNextScreen, this->GetTweenTimeLeft() );
return; return;
@@ -84,6 +87,20 @@ void ScreenStage::HandleScreenMessage( const ScreenMessage SM )
void ScreenStage::Update( float fDeltaTime ) void ScreenStage::Update( float fDeltaTime )
{ {
if( this->IsFirstUpdate() )
{
if( SCREENMAN->ConcurrentlyPrepareScreen(NEXT_SCREEN, SM_BeginFadingOut) )
{
/* Continue when both the screen finishes loading and the tween finishes. */
this->PostScreenMessage( SM_BeginFadingOut, m_sprOverlay->GetTweenTimeLeft() );
}
else
{
/* Prep the new screen once m_In is complete. */
this->PostScreenMessage( SM_PrepScreen, m_sprOverlay->GetTweenTimeLeft() );
}
}
if( m_bZeroDeltaOnNextUpdate ) if( m_bZeroDeltaOnNextUpdate )
{ {
m_bZeroDeltaOnNextUpdate = false; m_bZeroDeltaOnNextUpdate = false;