pull out RunConcurrentlyPrepareScreen

This commit is contained in:
Glenn Maynard
2005-08-15 15:19:34 +00:00
parent a94acefe4b
commit d0c14b9187
2 changed files with 29 additions and 23 deletions
+28 -23
View File
@@ -397,29 +397,7 @@ void ScreenManager::Update( float fDeltaTime )
if( !m_sDelayedConcurrentPrepare.empty() )
{
/* Don't call BackgroundPrepareScreen() from within another background load. */
ASSERT( !IsConcurrentlyLoading() );
CString sScreenName = m_sDelayedConcurrentPrepare;
m_sDelayedConcurrentPrepare = "";
ScreenMessage SM = m_OnDonePreparingScreen;
m_OnDonePreparingScreen = SM_None;
g_bIsConcurrentlyLoading = true;
StartConcurrentRendering();
if( g_setGroupedScreens.find(sScreenName) == g_setGroupedScreens.end() )
DeletePreparedScreens();
PrepareScreen( sScreenName );
FinishConcurrentRendering();
g_bIsConcurrentlyLoading = false;
LOG->Trace( "Concurrent prepare of %s finished", sScreenName.c_str() );
/* We're done. Send the message. The screen is allowed to start
* another concurrent prepare from this message. */
SendMessageToTopScreen( SM );
RunConcurrentlyPrepareScreen();
}
}
@@ -570,6 +548,33 @@ bool ScreenManager::ConcurrentlyPrepareScreen( const CString &sScreenName, Scree
return true;
}
void ScreenManager::RunConcurrentlyPrepareScreen()
{
/* Don't call BackgroundPrepareScreen() from within another background load. */
ASSERT( !IsConcurrentlyLoading() );
CString sScreenName = m_sDelayedConcurrentPrepare;
m_sDelayedConcurrentPrepare = "";
ScreenMessage SM = m_OnDonePreparingScreen;
m_OnDonePreparingScreen = SM_None;
g_bIsConcurrentlyLoading = true;
StartConcurrentRendering();
if( g_setGroupedScreens.find(sScreenName) == g_setGroupedScreens.end() )
DeletePreparedScreens();
PrepareScreen( sScreenName );
FinishConcurrentRendering();
g_bIsConcurrentlyLoading = false;
LOG->Trace( "Concurrent prepare of %s finished", sScreenName.c_str() );
/* We're done. Send the message. The screen is allowed to start
* another concurrent prepare from this message. */
SendMessageToTopScreen( SM );
}
void ScreenManager::PushScreen( Screen *pNewScreen, bool bDeleteWhenDone, ScreenMessage SendOnPop )
{
if( g_ScreenStack.size() )