From 7fa6620423e0568e785ed14e380f047ab621fd31 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Tue, 10 May 2011 14:45:52 -0400 Subject: [PATCH] [splittiming] m_Position needed. (50) --- src/Attack.cpp | 2 +- src/Background.cpp | 4 ++-- src/DancingCharacters.cpp | 14 +++++++------- src/Foreground.cpp | 10 +++++----- src/LightsManager.cpp | 6 +++--- src/LyricDisplay.cpp | 6 +++--- src/ScreenNameEntry.cpp | 4 ++-- src/ScreenSyncOverlay.cpp | 2 +- src/SoundEffectControl.cpp | 2 +- 9 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/Attack.cpp b/src/Attack.cpp index 1a67cc3181..1bf2c8623b 100644 --- a/src/Attack.cpp +++ b/src/Attack.cpp @@ -32,7 +32,7 @@ void Attack::GetRealtimeAttackBeats( const Song *pSong, const PlayerState* pPlay ASSERT( pSong ); /* If reasonable, push the attack forward 8 beats so that notes on screen don't change suddenly. */ - fStartBeat = min( GAMESTATE->m_fSongBeat+8, pPlayerState->m_fLastDrawnBeat ); + fStartBeat = min( GAMESTATE->m_Position.m_fSongBeat+8, pPlayerState->m_fLastDrawnBeat ); fStartBeat = truncf(fStartBeat)+1; const TimingData &timing = pSong->m_SongTiming; diff --git a/src/Background.cpp b/src/Background.cpp index 5047e5fc1e..8c5a64c5fa 100644 --- a/src/Background.cpp +++ b/src/Background.cpp @@ -800,9 +800,9 @@ void BackgroundImpl::Update( float fDeltaTime ) FOREACH_BackgroundLayer( i ) { Layer &layer = m_Layer[i]; - layer.UpdateCurBGChange( m_pSong, m_fLastMusicSeconds, GAMESTATE->m_fMusicSeconds, m_mapNameToTransition ); + layer.UpdateCurBGChange( m_pSong, m_fLastMusicSeconds, GAMESTATE->m_Position.m_fMusicSeconds, m_mapNameToTransition ); } - m_fLastMusicSeconds = GAMESTATE->m_fMusicSeconds; + m_fLastMusicSeconds = GAMESTATE->m_Position.m_fMusicSeconds; } void BackgroundImpl::DrawPrimitives() diff --git a/src/DancingCharacters.cpp b/src/DancingCharacters.cpp index 6653173f9b..8b5be828c3 100644 --- a/src/DancingCharacters.cpp +++ b/src/DancingCharacters.cpp @@ -175,7 +175,7 @@ int Neg1OrPos1() { return RandomInt( 2 ) ? -1 : +1; } void DancingCharacters::Update( float fDelta ) { - if( GAMESTATE->m_bFreeze || GAMESTATE->m_bDelay ) + if( GAMESTATE->m_Position.m_bFreeze || GAMESTATE->m_Position.m_bDelay ) { // spin the camera Matrix-style m_CameraPanYStart += fDelta*40; @@ -184,7 +184,7 @@ void DancingCharacters::Update( float fDelta ) else { // make the characters move - float fBPM = GAMESTATE->m_fCurBPS*60; + float fBPM = GAMESTATE->m_Position.m_fCurBPS*60; float fUpdateScale = SCALE( fBPM, 60.f, 300.f, 0.75f, 1.5f ); CLAMP( fUpdateScale, 0.75f, 1.5f ); @@ -209,8 +209,8 @@ void DancingCharacters::Update( float fDelta ) } bWasGameplayStarting = bGameplayStarting; - static float fLastBeat = GAMESTATE->m_fSongBeat; - float fThisBeat = GAMESTATE->m_fSongBeat; + static float fLastBeat = GAMESTATE->m_Position.m_fSongBeat; + float fThisBeat = GAMESTATE->m_Position.m_fSongBeat; if( fLastBeat < GAMESTATE->m_pCurSong->m_fFirstBeat && fThisBeat >= GAMESTATE->m_pCurSong->m_fFirstBeat ) { @@ -220,7 +220,7 @@ void DancingCharacters::Update( float fDelta ) fLastBeat = fThisBeat; // time for a new sweep? - if( GAMESTATE->m_fSongBeat > m_fThisCameraEndBeat ) + if( GAMESTATE->m_Position.m_fSongBeat > m_fThisCameraEndBeat ) { if( RandomInt(6) >= 4 ) { @@ -248,7 +248,7 @@ void DancingCharacters::Update( float fDelta ) m_fLookAtHeight = CAMERA_STILL_LOOK_AT_HEIGHT; } - int iCurBeat = (int)GAMESTATE->m_fSongBeat; + int iCurBeat = (int)GAMESTATE->m_Position.m_fSongBeat; iCurBeat -= iCurBeat%8; m_fThisCameraStartBeat = (float) iCurBeat; @@ -313,7 +313,7 @@ void DancingCharacters::DrawPrimitives() if(m_fThisCameraStartBeat == m_fThisCameraEndBeat) fPercentIntoSweep = 0; else - fPercentIntoSweep = SCALE(GAMESTATE->m_fSongBeat, m_fThisCameraStartBeat, m_fThisCameraEndBeat, 0.f, 1.f ); + fPercentIntoSweep = SCALE(GAMESTATE->m_Position.m_fSongBeat, m_fThisCameraStartBeat, m_fThisCameraEndBeat, 0.f, 1.f ); float fCameraPanY = SCALE( fPercentIntoSweep, 0.f, 1.f, m_CameraPanYStart, m_CameraPanYEnd ); float fCameraHeight = SCALE( fPercentIntoSweep, 0.f, 1.f, m_fCameraHeightStart, m_fCameraHeightEnd ); diff --git a/src/Foreground.cpp b/src/Foreground.cpp index 54ba873d7e..f7b7307b37 100644 --- a/src/Foreground.cpp +++ b/src/Foreground.cpp @@ -65,7 +65,7 @@ void Foreground::Update( float fDeltaTime ) { LoadedBGA &bga = m_BGAnimations[i]; - if( GAMESTATE->m_fSongBeat < bga.m_fStartBeat ) + if( GAMESTATE->m_Position.m_fSongBeat < bga.m_fStartBeat ) { // The animation hasn't started yet. continue; @@ -83,11 +83,11 @@ void Foreground::Update( float fDeltaTime ) bga.m_bga->PlayCommand( "On" ); const float fStartSecond = m_pSong->m_SongTiming.GetElapsedTimeFromBeat( bga.m_fStartBeat ); - lDeltaTime = GAMESTATE->m_fMusicSeconds - fStartSecond; + lDeltaTime = GAMESTATE->m_Position.m_fMusicSeconds - fStartSecond; } else { - lDeltaTime = GAMESTATE->m_fMusicSeconds - m_fLastMusicSeconds; + lDeltaTime = GAMESTATE->m_Position.m_fMusicSeconds - m_fLastMusicSeconds; } // This shouldn't go down, but be safe: @@ -95,7 +95,7 @@ void Foreground::Update( float fDeltaTime ) bga.m_bga->Update( lDeltaTime / fRate ); - if( GAMESTATE->m_fSongBeat > bga.m_fStopBeat ) + if( GAMESTATE->m_Position.m_fSongBeat > bga.m_fStopBeat ) { // Finished. bga.m_bga->SetVisible( false ); @@ -104,7 +104,7 @@ void Foreground::Update( float fDeltaTime ) } } - m_fLastMusicSeconds = GAMESTATE->m_fMusicSeconds; + m_fLastMusicSeconds = GAMESTATE->m_Position.m_fMusicSeconds; } /* diff --git a/src/LightsManager.cpp b/src/LightsManager.cpp index b3f05c585b..54e220bf07 100644 --- a/src/LightsManager.cpp +++ b/src/LightsManager.cpp @@ -230,12 +230,12 @@ void LightsManager::Update( float fDeltaTime ) static float fLastBeat; static int iLight; - if( fracf(GAMESTATE->m_fLightSongBeat) < fracf(fLastBeat) ) + if( fracf(GAMESTATE->m_Position.m_fLightSongBeat) < fracf(fLastBeat) ) { ++iLight; wrap( iLight, 4 ); } - fLastBeat = GAMESTATE->m_fLightSongBeat; + fLastBeat = GAMESTATE->m_Position.m_fLightSongBeat; switch( iLight ) { case 0: m_LightsState.m_bCabinetLights[LIGHT_MARQUEE_UP_LEFT] = true; break; @@ -405,7 +405,7 @@ void LightsManager::Update( float fDeltaTime ) // If not joined, has enough credits, and not too late to join, then // blink the menu buttons rapidly so they'll press Start { - int iBeat = (int)(GAMESTATE->m_fLightSongBeat*4); + int iBeat = (int)(GAMESTATE->m_Position.m_fLightSongBeat*4); bool bBlinkOn = (iBeat%2)==0; FOREACH_PlayerNumber( pn ) { diff --git a/src/LyricDisplay.cpp b/src/LyricDisplay.cpp index fec9827e34..7284d2dc17 100644 --- a/src/LyricDisplay.cpp +++ b/src/LyricDisplay.cpp @@ -41,9 +41,9 @@ void LyricDisplay::Update( float fDeltaTime ) return; // If the song has changed (in a course), reset. - if( GAMESTATE->m_fMusicSeconds < m_fLastSecond ) + if( GAMESTATE->m_Position.m_fMusicSeconds < m_fLastSecond ) Init(); - m_fLastSecond = GAMESTATE->m_fMusicSeconds; + m_fLastSecond = GAMESTATE->m_Position.m_fMusicSeconds; if( m_iCurLyricNumber >= GAMESTATE->m_pCurSong->m_LyricSegments.size() ) return; @@ -51,7 +51,7 @@ void LyricDisplay::Update( float fDeltaTime ) const Song *pSong = GAMESTATE->m_pCurSong; const float fStartTime = (pSong->m_LyricSegments[m_iCurLyricNumber].m_fStartTime) - IN_LENGTH.GetValue(); - if( GAMESTATE->m_fMusicSeconds < fStartTime ) + if( GAMESTATE->m_Position.m_fMusicSeconds < fStartTime ) return; // Clamp this lyric to the beginning of the next or the end of the music. diff --git a/src/ScreenNameEntry.cpp b/src/ScreenNameEntry.cpp index fca92a59b1..b4eeeed4cc 100644 --- a/src/ScreenNameEntry.cpp +++ b/src/ScreenNameEntry.cpp @@ -61,7 +61,7 @@ void ScreenNameEntry::ScrollingText::Init( const RString &sName, const vectorm_fSongBeat; + const float fFakeBeat = GAMESTATE->m_Position.m_fSongBeat; const size_t iClosestIndex = lrintf( fFakeBeat ) % CHARS_CHOICES.size(); const float fClosestYOffset = GetClosestCharYOffset( fFakeBeat ); @@ -325,7 +325,7 @@ void ScreenNameEntry::Update( float fDelta ) SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("name entry") ); m_fFakeBeat += fDelta * FAKE_BEATS_PER_SEC; - GAMESTATE->m_fSongBeat = m_fFakeBeat; + GAMESTATE->m_Position.m_fSongBeat = m_fFakeBeat; ScreenWithMenuElements::Update(fDelta); } diff --git a/src/ScreenSyncOverlay.cpp b/src/ScreenSyncOverlay.cpp index baf240d54d..5f5d8e37f4 100644 --- a/src/ScreenSyncOverlay.cpp +++ b/src/ScreenSyncOverlay.cpp @@ -221,7 +221,7 @@ bool ScreenSyncOverlay::OverlayInput( const InputEventPlus &input ) } if( GAMESTATE->m_pCurSong != NULL ) { - BPMSegment& seg = GAMESTATE->m_pCurSong->m_SongTiming.GetBPMSegmentAtBeat( GAMESTATE->m_fSongBeat ); + BPMSegment& seg = GAMESTATE->m_pCurSong->m_SongTiming.GetBPMSegmentAtBeat( GAMESTATE->m_Position.m_fSongBeat ); seg.m_fBPS += fDelta; } } diff --git a/src/SoundEffectControl.cpp b/src/SoundEffectControl.cpp index 40d21fa6ba..2055e6bda1 100644 --- a/src/SoundEffectControl.cpp +++ b/src/SoundEffectControl.cpp @@ -44,7 +44,7 @@ void SoundEffectControl::Update( float fDeltaTime ) if( LOCK_TO_HOLD ) { - int iRow = BeatToNoteRow( GAMESTATE->m_fSongBeat ); + int iRow = BeatToNoteRow( GAMESTATE->m_Position.m_fSongBeat ); int iHoldsHeld, iHoldsLetGo; HoldsBeingHeld( iRow, iHoldsHeld, iHoldsLetGo );