Remove backgrounds on screens. Have one shared background that persists across screens.
This commit is contained in:
@@ -246,15 +246,6 @@ ScreenEnding::ScreenEnding( CString sClassName ) : ScreenAttract( sClassName, fa
|
||||
|
||||
// Now that we've read the data from the profile, it's ok to Reset()
|
||||
GAMESTATE->Reset();
|
||||
|
||||
float fSecsUntilBeginFadingOut = m_Background.GetLengthSeconds() - m_Out.GetLengthSeconds();
|
||||
if( fSecsUntilBeginFadingOut < 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.GetLengthSeconds(), m_Background.GetLengthSeconds() );
|
||||
fSecsUntilBeginFadingOut = 0;
|
||||
}
|
||||
this->PostScreenMessage( SM_BeginFadingOut, fSecsUntilBeginFadingOut );
|
||||
}
|
||||
|
||||
ScreenEnding::~ScreenEnding()
|
||||
@@ -263,6 +254,22 @@ ScreenEnding::~ScreenEnding()
|
||||
|
||||
void ScreenEnding::Update( float fDeltaTime )
|
||||
{
|
||||
// The shared background isn't loaded until the screen is actually
|
||||
// showing. The background is loaded by the time of the first update.
|
||||
if( IsFirstUpdate() )
|
||||
{
|
||||
BGAnimation &background = *SCREENMAN->m_pSharedBGA;
|
||||
float fSecsUntilBeginFadingOut = background.GetLengthSeconds() - m_Out.GetLengthSeconds();
|
||||
if( fSecsUntilBeginFadingOut < 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.GetLengthSeconds(), background.GetLengthSeconds() );
|
||||
fSecsUntilBeginFadingOut = 0;
|
||||
}
|
||||
this->PostScreenMessage( SM_BeginFadingOut, fSecsUntilBeginFadingOut );
|
||||
}
|
||||
|
||||
|
||||
ScreenAttract::Update( fDeltaTime );
|
||||
|
||||
if( m_In.IsTransitioning() && m_Out.IsTransitioning() )
|
||||
|
||||
Reference in New Issue
Block a user