avoid GetPathS during BeginScreen

This commit is contained in:
Glenn Maynard
2005-09-22 01:17:35 +00:00
parent 026f13f765
commit 701aff5ee8
2 changed files with 7 additions and 1 deletions
+5 -1
View File
@@ -128,6 +128,10 @@ void ScreenWithMenuElements::Init()
m_Cancel.Load( THEME->GetPathB(m_sName,"cancel") ); m_Cancel.Load( THEME->GetPathB(m_sName,"cancel") );
m_Cancel.SetDrawOrder( DRAW_ORDER_TRANSITIONS ); m_Cancel.SetDrawOrder( DRAW_ORDER_TRANSITIONS );
this->AddChild( &m_Cancel ); this->AddChild( &m_Cancel );
/* Grab the music path here; don't GetPath during BeginScreen. */
if( PLAY_MUSIC )
m_sPathToMusic = THEME->GetPathS( m_sName, "music" );
} }
void ScreenWithMenuElements::BeginScreen() void ScreenWithMenuElements::BeginScreen()
@@ -199,7 +203,7 @@ void ScreenWithMenuElements::StartPlayingMusic()
/* Some screens should leave the music alone (eg. ScreenPlayerOptions music /* Some screens should leave the music alone (eg. ScreenPlayerOptions music
* sample left over from ScreenSelectMusic). */ * sample left over from ScreenSelectMusic). */
if( PLAY_MUSIC ) if( PLAY_MUSIC )
SOUND->PlayMusic( THEME->GetPathS(m_sName,"music") ); SOUND->PlayMusic( m_sPathToMusic );
} }
void ScreenWithMenuElements::Update( float fDeltaTime ) void ScreenWithMenuElements::Update( float fDeltaTime )
+2
View File
@@ -58,6 +58,8 @@ protected:
ThemeMetric<bool> PLAY_MUSIC; ThemeMetric<bool> PLAY_MUSIC;
ThemeMetric<float> TIMER_SECONDS; ThemeMetric<float> TIMER_SECONDS;
private:
CString m_sPathToMusic;
}; };
#endif #endif