From 685c3bcbbb955c7c970f2804a1187f301ee89815 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 24 Mar 2003 21:26:12 +0000 Subject: [PATCH] fix the demonstration screen when there is no music --- stepmania/src/ScreenGameplay.cpp | 15 +++++++++------ stepmania/src/ScreenJukebox.cpp | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 3f4c077a43..fe81a000bc 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -759,6 +759,15 @@ bool ScreenGameplay::IsTimeToPlayTicks() const void ScreenGameplay::Update( float fDeltaTime ) { + if( GAMESTATE->m_pCurSong == NULL ) + { + /* ScreenDemonstration will move us to the next screen. We just need to + * survive for one update without crashing. We need to call Screen::Update + * to make sure we receive the next-screen message. */ + Screen::Update( fDeltaTime ); + return; + } + if( m_bFirstUpdate ) { SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("gameplay intro") ); // crowd cheer @@ -811,14 +820,8 @@ void ScreenGameplay::Update( float fDeltaTime ) if( GAMESTATE->m_MasterPlayerNumber != PLAYER_INVALID ) m_MaxCombo.SetText( ssprintf("%d", GAMESTATE->m_CurStageStats.iCurCombo[GAMESTATE->m_MasterPlayerNumber]) ); /* MAKE THIS WORK FOR BOTH PLAYERS! */ - //LOG->Trace( "m_fOffsetInBeats = %f, m_fBeatsPerSecond = %f, m_Music.GetPositionSeconds = %f", m_fOffsetInBeats, m_fBeatsPerSecond, m_Music.GetPositionSeconds() ); - - if( GAMESTATE->m_pCurSong == NULL ) - return; - - int pn; switch( m_DancingState ) { diff --git a/stepmania/src/ScreenJukebox.cpp b/stepmania/src/ScreenJukebox.cpp index 7e3d516bf8..9f11c83f07 100644 --- a/stepmania/src/ScreenJukebox.cpp +++ b/stepmania/src/ScreenJukebox.cpp @@ -78,7 +78,7 @@ bool ScreenJukebox::PrepareForJukebox() // always return true. SetSong(); - ASSERT( GAMESTATE->m_pCurSong ); +// ASSERT( GAMESTATE->m_pCurSong ); GAMESTATE->m_MasterPlayerNumber = PLAYER_1;