Load Background's BGAs on first load, not in the ctor, so Jukebox and
Demonstration set up first; otherwise, BGAs with Lua expressions that depend on them won't work.
This commit is contained in:
@@ -40,6 +40,15 @@ Background::Background()
|
|||||||
m_pCurrentBGA = NULL;
|
m_pCurrentBGA = NULL;
|
||||||
m_pFadingBGA = NULL;
|
m_pFadingBGA = NULL;
|
||||||
m_fSecsLeftInFade = 0;
|
m_fSecsLeftInFade = 0;
|
||||||
|
m_pDancingCharacters = NULL;
|
||||||
|
m_bInitted = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Background::Init()
|
||||||
|
{
|
||||||
|
if( m_bInitted )
|
||||||
|
return;
|
||||||
|
m_bInitted = true;
|
||||||
|
|
||||||
m_DangerAll.LoadFromAniDir( THEME->GetPathToB("ScreenGameplay danger all") );
|
m_DangerAll.LoadFromAniDir( THEME->GetPathToB("ScreenGameplay danger all") );
|
||||||
FOREACH_PlayerNumber( p )
|
FOREACH_PlayerNumber( p )
|
||||||
@@ -63,8 +72,6 @@ Background::Background()
|
|||||||
|
|
||||||
if( bOneOrMoreChars && !bShowingBeginnerHelper )
|
if( bOneOrMoreChars && !bShowingBeginnerHelper )
|
||||||
m_pDancingCharacters = new DancingCharacters;
|
m_pDancingCharacters = new DancingCharacters;
|
||||||
else
|
|
||||||
m_pDancingCharacters = NULL;
|
|
||||||
|
|
||||||
m_quadBorder[0].StretchTo( RectF(SCREEN_LEFT,SCREEN_TOP,LEFT_EDGE,SCREEN_BOTTOM) );
|
m_quadBorder[0].StretchTo( RectF(SCREEN_LEFT,SCREEN_TOP,LEFT_EDGE,SCREEN_BOTTOM) );
|
||||||
m_quadBorder[0].SetDiffuse( RageColor(0,0,0,1) );
|
m_quadBorder[0].SetDiffuse( RageColor(0,0,0,1) );
|
||||||
@@ -284,6 +291,8 @@ void Background::LoadFromRandom( float fFirstBeat, float fLastBeat, const Timing
|
|||||||
|
|
||||||
void Background::LoadFromSong( const Song* pSong )
|
void Background::LoadFromSong( const Song* pSong )
|
||||||
{
|
{
|
||||||
|
Init();
|
||||||
|
|
||||||
Unload();
|
Unload();
|
||||||
|
|
||||||
m_pSong = pSong;
|
m_pSong = pSong;
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ class Background : public ActorFrame
|
|||||||
public:
|
public:
|
||||||
Background();
|
Background();
|
||||||
~Background();
|
~Background();
|
||||||
|
void Init();
|
||||||
|
|
||||||
virtual void LoadFromSong( const Song *pSong );
|
virtual void LoadFromSong( const Song *pSong );
|
||||||
virtual void Unload();
|
virtual void Unload();
|
||||||
@@ -55,6 +56,7 @@ protected:
|
|||||||
bool IsDeadPlayerVisible( PlayerNumber pn );
|
bool IsDeadPlayerVisible( PlayerNumber pn );
|
||||||
void UpdateCurBGChange( float fCurrentTime );
|
void UpdateCurBGChange( float fCurrentTime );
|
||||||
|
|
||||||
|
bool m_bInitted;
|
||||||
DancingCharacters* m_pDancingCharacters;
|
DancingCharacters* m_pDancingCharacters;
|
||||||
|
|
||||||
BGAnimation m_DangerPlayer[NUM_PLAYERS];
|
BGAnimation m_DangerPlayer[NUM_PLAYERS];
|
||||||
|
|||||||
Reference in New Issue
Block a user