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:
Glenn Maynard
2005-01-04 01:45:28 +00:00
parent 07aba0f89f
commit 3153c70ddb
2 changed files with 13 additions and 2 deletions
+11 -2
View File
@@ -40,6 +40,15 @@ Background::Background()
m_pCurrentBGA = NULL;
m_pFadingBGA = NULL;
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") );
FOREACH_PlayerNumber( p )
@@ -63,8 +72,6 @@ Background::Background()
if( bOneOrMoreChars && !bShowingBeginnerHelper )
m_pDancingCharacters = new DancingCharacters;
else
m_pDancingCharacters = NULL;
m_quadBorder[0].StretchTo( RectF(SCREEN_LEFT,SCREEN_TOP,LEFT_EDGE,SCREEN_BOTTOM) );
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 )
{
Init();
Unload();
m_pSong = pSong;
+2
View File
@@ -33,6 +33,7 @@ class Background : public ActorFrame
public:
Background();
~Background();
void Init();
virtual void LoadFromSong( const Song *pSong );
virtual void Unload();
@@ -55,6 +56,7 @@ protected:
bool IsDeadPlayerVisible( PlayerNumber pn );
void UpdateCurBGChange( float fCurrentTime );
bool m_bInitted;
DancingCharacters* m_pDancingCharacters;
BGAnimation m_DangerPlayer[NUM_PLAYERS];