pull out RunConcurrentlyPrepareScreen
This commit is contained in:
@@ -397,29 +397,7 @@ void ScreenManager::Update( float fDeltaTime )
|
|||||||
|
|
||||||
if( !m_sDelayedConcurrentPrepare.empty() )
|
if( !m_sDelayedConcurrentPrepare.empty() )
|
||||||
{
|
{
|
||||||
/* Don't call BackgroundPrepareScreen() from within another background load. */
|
RunConcurrentlyPrepareScreen();
|
||||||
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 );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -570,6 +548,33 @@ bool ScreenManager::ConcurrentlyPrepareScreen( const CString &sScreenName, Scree
|
|||||||
return true;
|
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 )
|
void ScreenManager::PushScreen( Screen *pNewScreen, bool bDeleteWhenDone, ScreenMessage SendOnPop )
|
||||||
{
|
{
|
||||||
if( g_ScreenStack.size() )
|
if( g_ScreenStack.size() )
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ private:
|
|||||||
|
|
||||||
void LoadDelayedScreen();
|
void LoadDelayedScreen();
|
||||||
ScreenMessage PopTopScreenInternal( bool bSendLoseFocus = true );
|
ScreenMessage PopTopScreenInternal( bool bSendLoseFocus = true );
|
||||||
|
void RunConcurrentlyPrepareScreen();
|
||||||
|
|
||||||
// Keep these sounds always loaded, because they could be
|
// Keep these sounds always loaded, because they could be
|
||||||
// played at any time. We want to eliminate SOUND->PlayOnce
|
// played at any time. We want to eliminate SOUND->PlayOnce
|
||||||
|
|||||||
Reference in New Issue
Block a user