From 77951ede0e0c4e8426d796bb7f73425fa58cc26c Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 29 Jan 2004 05:20:27 +0000 Subject: [PATCH] set up GAMESTATE->m_fMusicSeconds earlier --- stepmania/src/Background.cpp | 3 +-- stepmania/src/Foreground.cpp | 3 --- stepmania/src/ScreenGameplay.cpp | 5 +++++ 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index d69e34b5c0..130631abc0 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -444,8 +444,7 @@ int Background::FindBGSegmentForBeat( float fBeat ) const /* If the BG segment has changed, move focus to it. Send Update() calls. */ void Background::UpdateCurBGChange( float fCurrentTime ) { - if( fCurrentTime == GameState::MUSIC_SECONDS_INVALID ) - return; /* hasn't been updated yet */ + ASSERT( fCurrentTime != GameState::MUSIC_SECONDS_INVALID ); if( m_aBGChanges.size() == 0 ) return; diff --git a/stepmania/src/Foreground.cpp b/stepmania/src/Foreground.cpp index 24452808f8..ce9cd69429 100644 --- a/stepmania/src/Foreground.cpp +++ b/stepmania/src/Foreground.cpp @@ -52,9 +52,6 @@ void Foreground::LoadFromSong( const Song *pSong ) void Foreground::Update( float fDeltaTime ) { - if( GAMESTATE->m_fMusicSeconds == GameState::MUSIC_SECONDS_INVALID ) - return; /* hasn't been updated yet */ - /* Calls to Update() should *not* be scaled by music rate. Undo it. */ const float fRate = GAMESTATE->m_SongOptions.m_fMusicRate; diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index b82eb30cba..8e9bb36228 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -1040,6 +1040,11 @@ float ScreenGameplay::StartPlayingSong(float MinTimeToNotes, float MinTimeToMusi SOUND->TakeOverSound( m_soundMusic, &GAMESTATE->m_pCurSong->m_Timing ); m_soundMusic = NULL; // SOUND owns it now + /* Make sure GAMESTATE->m_fMusicSeconds is set up. */ + GAMESTATE->m_fMusicSeconds = -5000; + SOUND->Update(0); + ASSERT( GAMESTATE->m_fMusicSeconds > -4000 ); /* make sure the "fake timer" code doesn't trigger */ + /* Return the amount of time until the first beat. */ return fFirstSecond - fStartSecond; }