From 27d6c1a5ee4a7b0914a6d21af213e2da2726a4c7 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 3 Jan 2005 23:31:34 +0000 Subject: [PATCH] simplify demo/jukebox setup --- stepmania/src/ScreenDemonstration.cpp | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/stepmania/src/ScreenDemonstration.cpp b/stepmania/src/ScreenDemonstration.cpp index c4729ef3eb..7a915c6a5e 100644 --- a/stepmania/src/ScreenDemonstration.cpp +++ b/stepmania/src/ScreenDemonstration.cpp @@ -18,29 +18,23 @@ const ScreenMessage SM_NotesEnded = ScreenMessage(SM_User+10); // MUST be same as in ScreenGameplay -bool PrepareForDemonstration() // always return true. +REGISTER_SCREEN_CLASS( ScreenDemonstration ); +ScreenDemonstration::ScreenDemonstration( CString sName ) : ScreenJukebox( sName ) +{ + LOG->Trace( "ScreenDemonstration::ScreenDemonstration()" ); + m_bDemonstration = true; +} + +void ScreenDemonstration::Init() { GAMESTATE->m_pCurStyle = GAMEMAN->GetDemonstrationStyleForGame(GAMESTATE->m_pCurGame); GAMESTATE->m_PlayMode = PLAY_MODE_REGULAR; - /* If needed, turn sound off. We need to do this before the ScreenGameplay ctor, - * since changes to sound volume aren't guaranteed to take effect if done *after* - * the sound starts playing. */ + /* If needed, turn sound off. */ if( !GAMESTATE->IsTimeToPlayAttractSounds() ) SOUNDMAN->SetPrefs( 0 ); // silent - return true; -} - -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.