diff --git a/stepmania/src/ScreenDemonstration.cpp b/stepmania/src/ScreenDemonstration.cpp index c3d618549a..c4729ef3eb 100644 --- a/stepmania/src/ScreenDemonstration.cpp +++ b/stepmania/src/ScreenDemonstration.cpp @@ -37,6 +37,11 @@ REGISTER_SCREEN_CLASS( ScreenDemonstration ); ScreenDemonstration::ScreenDemonstration( CString sName ) : ScreenJukebox( sName, PrepareForDemonstration() ) // this is a hack to get some code to execute before the ScreenGameplay constructor { LOG->Trace( "ScreenDemonstration::ScreenDemonstration()" ); +} + +void ScreenDemonstration::Init() +{ + ScreenJukebox::Init(); if( GAMESTATE->m_pCurSong == NULL ) // we didn't find a song. { diff --git a/stepmania/src/ScreenDemonstration.h b/stepmania/src/ScreenDemonstration.h index 69805d6d31..a806ce6448 100644 --- a/stepmania/src/ScreenDemonstration.h +++ b/stepmania/src/ScreenDemonstration.h @@ -8,6 +8,7 @@ class ScreenDemonstration : public ScreenJukebox { public: ScreenDemonstration( CString sName ); + virtual void Init(); virtual void HandleScreenMessage( const ScreenMessage SM ); diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index 1c708c75cd..75aaf1691b 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -87,13 +87,13 @@ const ScreenMessage SM_PlayCheer = ScreenMessage(SM_User+6); REGISTER_SCREEN_CLASS( ScreenEvaluation ); ScreenEvaluation::ScreenEvaluation( CString sClassName ) : ScreenWithMenuElements(sClassName) { - LOG->Trace( "ScreenEvaluation::ScreenEvaluation" ); - Init(); // work around horrible gcc bug 3187 - LOG->Trace( "exiting ScreenEvaluation::ScreenEvalaution" ); + LOG->Trace( "ScreenEvaluation::ScreenEvaluation" ); } void ScreenEvaluation::Init() { + Screen::Init(); + // // debugging // diff --git a/stepmania/src/ScreenEvaluation.h b/stepmania/src/ScreenEvaluation.h index ec193435a1..fc2fa0345a 100644 --- a/stepmania/src/ScreenEvaluation.h +++ b/stepmania/src/ScreenEvaluation.h @@ -50,7 +50,7 @@ public: virtual void MenuStart( PlayerNumber pn ); protected: - void Init(); + virtual void Init(); void CommitScores( const StageStats &stageStats, int iPersonalHighScoreIndexOut[NUM_PLAYERS], diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 3273205afb..70bf071134 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -89,11 +89,12 @@ REGISTER_SCREEN_CLASS( ScreenGameplay ); ScreenGameplay::ScreenGameplay( CString sName, bool bDemonstration ) : Screen(sName) { m_bDemonstration = bDemonstration; - Init(); // work around horrible gcc bug 3187 } void ScreenGameplay::Init() { + Screen::Init(); + if( m_bDemonstration ) LIGHTSMAN->SetLightsMode( LIGHTSMODE_DEMONSTRATION ); else diff --git a/stepmania/src/ScreenGameplay.h b/stepmania/src/ScreenGameplay.h index 10b740fb44..682ee19488 100644 --- a/stepmania/src/ScreenGameplay.h +++ b/stepmania/src/ScreenGameplay.h @@ -56,7 +56,7 @@ class ScreenGameplay : public Screen { public: ScreenGameplay( CString sName, bool bDemonstration = false ); - void Init(); + virtual void Init(); virtual ~ScreenGameplay(); virtual void Update( float fDeltaTime ); diff --git a/stepmania/src/ScreenGameplayMultiplayer.cpp b/stepmania/src/ScreenGameplayMultiplayer.cpp index cf37de0672..9abf071fe4 100644 --- a/stepmania/src/ScreenGameplayMultiplayer.cpp +++ b/stepmania/src/ScreenGameplayMultiplayer.cpp @@ -39,11 +39,12 @@ const ScreenMessage SM_GoToScreenAfterBack = ScreenMessage(SM_User+23); REGISTER_SCREEN_CLASS( ScreenGameplayMultiplayer ); ScreenGameplayMultiplayer::ScreenGameplayMultiplayer( CString sName, bool bDemonstration ) : Screen(sName) { - Init(); // work around horrible gcc bug 3187 } void ScreenGameplayMultiplayer::Init() { + Screen::Init(); + m_pSoundMusic = NULL; /* We do this ourself. */ diff --git a/stepmania/src/ScreenJukebox.cpp b/stepmania/src/ScreenJukebox.cpp index b0c4116fcd..2bb81894b7 100644 --- a/stepmania/src/ScreenJukebox.cpp +++ b/stepmania/src/ScreenJukebox.cpp @@ -167,6 +167,11 @@ bool ScreenJukebox::PrepareForJukebox( bool bDemonstration ) // always return t ScreenJukebox::ScreenJukebox( CString sName, bool bDemonstration ) : ScreenGameplay( "ScreenGameplay", PrepareForJukebox(bDemonstration) ) // this is a hack to get some code to execute before the ScreenGameplay constructor { LOG->Trace( "ScreenJukebox::ScreenJukebox()" ); +} + +void ScreenJukebox::Init() +{ + ScreenGameplay::Init(); if( GAMESTATE->m_pCurSong == NULL ) // we didn't find a song. { diff --git a/stepmania/src/ScreenJukebox.h b/stepmania/src/ScreenJukebox.h index 688a7b3122..23bd0ac86a 100644 --- a/stepmania/src/ScreenJukebox.h +++ b/stepmania/src/ScreenJukebox.h @@ -11,6 +11,7 @@ class ScreenJukebox : public ScreenGameplay { public: ScreenJukebox( CString sName, bool bDemonstration = false ); + virtual void Init(); virtual void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ); virtual void HandleScreenMessage( const ScreenMessage SM );