[splittiming] m_Position needed. (50)

This commit is contained in:
Jason Felds
2011-05-10 14:45:52 -04:00
parent 2c87c34899
commit 7fa6620423
9 changed files with 25 additions and 25 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ void Attack::GetRealtimeAttackBeats( const Song *pSong, const PlayerState* pPlay
ASSERT( pSong ); ASSERT( pSong );
/* If reasonable, push the attack forward 8 beats so that notes on screen don't change suddenly. */ /* 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; fStartBeat = truncf(fStartBeat)+1;
const TimingData &timing = pSong->m_SongTiming; const TimingData &timing = pSong->m_SongTiming;
+2 -2
View File
@@ -800,9 +800,9 @@ void BackgroundImpl::Update( float fDeltaTime )
FOREACH_BackgroundLayer( i ) FOREACH_BackgroundLayer( i )
{ {
Layer &layer = m_Layer[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() void BackgroundImpl::DrawPrimitives()
+7 -7
View File
@@ -175,7 +175,7 @@ int Neg1OrPos1() { return RandomInt( 2 ) ? -1 : +1; }
void DancingCharacters::Update( float fDelta ) 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 // spin the camera Matrix-style
m_CameraPanYStart += fDelta*40; m_CameraPanYStart += fDelta*40;
@@ -184,7 +184,7 @@ void DancingCharacters::Update( float fDelta )
else else
{ {
// make the characters move // 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 ); float fUpdateScale = SCALE( fBPM, 60.f, 300.f, 0.75f, 1.5f );
CLAMP( fUpdateScale, 0.75f, 1.5f ); CLAMP( fUpdateScale, 0.75f, 1.5f );
@@ -209,8 +209,8 @@ void DancingCharacters::Update( float fDelta )
} }
bWasGameplayStarting = bGameplayStarting; bWasGameplayStarting = bGameplayStarting;
static float fLastBeat = GAMESTATE->m_fSongBeat; static float fLastBeat = GAMESTATE->m_Position.m_fSongBeat;
float fThisBeat = GAMESTATE->m_fSongBeat; float fThisBeat = GAMESTATE->m_Position.m_fSongBeat;
if( fLastBeat < GAMESTATE->m_pCurSong->m_fFirstBeat && if( fLastBeat < GAMESTATE->m_pCurSong->m_fFirstBeat &&
fThisBeat >= GAMESTATE->m_pCurSong->m_fFirstBeat ) fThisBeat >= GAMESTATE->m_pCurSong->m_fFirstBeat )
{ {
@@ -220,7 +220,7 @@ void DancingCharacters::Update( float fDelta )
fLastBeat = fThisBeat; fLastBeat = fThisBeat;
// time for a new sweep? // time for a new sweep?
if( GAMESTATE->m_fSongBeat > m_fThisCameraEndBeat ) if( GAMESTATE->m_Position.m_fSongBeat > m_fThisCameraEndBeat )
{ {
if( RandomInt(6) >= 4 ) if( RandomInt(6) >= 4 )
{ {
@@ -248,7 +248,7 @@ void DancingCharacters::Update( float fDelta )
m_fLookAtHeight = CAMERA_STILL_LOOK_AT_HEIGHT; m_fLookAtHeight = CAMERA_STILL_LOOK_AT_HEIGHT;
} }
int iCurBeat = (int)GAMESTATE->m_fSongBeat; int iCurBeat = (int)GAMESTATE->m_Position.m_fSongBeat;
iCurBeat -= iCurBeat%8; iCurBeat -= iCurBeat%8;
m_fThisCameraStartBeat = (float) iCurBeat; m_fThisCameraStartBeat = (float) iCurBeat;
@@ -313,7 +313,7 @@ void DancingCharacters::DrawPrimitives()
if(m_fThisCameraStartBeat == m_fThisCameraEndBeat) if(m_fThisCameraStartBeat == m_fThisCameraEndBeat)
fPercentIntoSweep = 0; fPercentIntoSweep = 0;
else 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 fCameraPanY = SCALE( fPercentIntoSweep, 0.f, 1.f, m_CameraPanYStart, m_CameraPanYEnd );
float fCameraHeight = SCALE( fPercentIntoSweep, 0.f, 1.f, m_fCameraHeightStart, m_fCameraHeightEnd ); float fCameraHeight = SCALE( fPercentIntoSweep, 0.f, 1.f, m_fCameraHeightStart, m_fCameraHeightEnd );
+5 -5
View File
@@ -65,7 +65,7 @@ void Foreground::Update( float fDeltaTime )
{ {
LoadedBGA &bga = m_BGAnimations[i]; 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. // The animation hasn't started yet.
continue; continue;
@@ -83,11 +83,11 @@ void Foreground::Update( float fDeltaTime )
bga.m_bga->PlayCommand( "On" ); bga.m_bga->PlayCommand( "On" );
const float fStartSecond = m_pSong->m_SongTiming.GetElapsedTimeFromBeat( bga.m_fStartBeat ); const float fStartSecond = m_pSong->m_SongTiming.GetElapsedTimeFromBeat( bga.m_fStartBeat );
lDeltaTime = GAMESTATE->m_fMusicSeconds - fStartSecond; lDeltaTime = GAMESTATE->m_Position.m_fMusicSeconds - fStartSecond;
} }
else else
{ {
lDeltaTime = GAMESTATE->m_fMusicSeconds - m_fLastMusicSeconds; lDeltaTime = GAMESTATE->m_Position.m_fMusicSeconds - m_fLastMusicSeconds;
} }
// This shouldn't go down, but be safe: // This shouldn't go down, but be safe:
@@ -95,7 +95,7 @@ void Foreground::Update( float fDeltaTime )
bga.m_bga->Update( lDeltaTime / fRate ); bga.m_bga->Update( lDeltaTime / fRate );
if( GAMESTATE->m_fSongBeat > bga.m_fStopBeat ) if( GAMESTATE->m_Position.m_fSongBeat > bga.m_fStopBeat )
{ {
// Finished. // Finished.
bga.m_bga->SetVisible( false ); 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;
} }
/* /*
+3 -3
View File
@@ -230,12 +230,12 @@ void LightsManager::Update( float fDeltaTime )
static float fLastBeat; static float fLastBeat;
static int iLight; static int iLight;
if( fracf(GAMESTATE->m_fLightSongBeat) < fracf(fLastBeat) ) if( fracf(GAMESTATE->m_Position.m_fLightSongBeat) < fracf(fLastBeat) )
{ {
++iLight; ++iLight;
wrap( iLight, 4 ); wrap( iLight, 4 );
} }
fLastBeat = GAMESTATE->m_fLightSongBeat; fLastBeat = GAMESTATE->m_Position.m_fLightSongBeat;
switch( iLight ) switch( iLight )
{ {
case 0: m_LightsState.m_bCabinetLights[LIGHT_MARQUEE_UP_LEFT] = true; break; 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 // If not joined, has enough credits, and not too late to join, then
// blink the menu buttons rapidly so they'll press Start // 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; bool bBlinkOn = (iBeat%2)==0;
FOREACH_PlayerNumber( pn ) FOREACH_PlayerNumber( pn )
{ {
+3 -3
View File
@@ -41,9 +41,9 @@ void LyricDisplay::Update( float fDeltaTime )
return; return;
// If the song has changed (in a course), reset. // If the song has changed (in a course), reset.
if( GAMESTATE->m_fMusicSeconds < m_fLastSecond ) if( GAMESTATE->m_Position.m_fMusicSeconds < m_fLastSecond )
Init(); Init();
m_fLastSecond = GAMESTATE->m_fMusicSeconds; m_fLastSecond = GAMESTATE->m_Position.m_fMusicSeconds;
if( m_iCurLyricNumber >= GAMESTATE->m_pCurSong->m_LyricSegments.size() ) if( m_iCurLyricNumber >= GAMESTATE->m_pCurSong->m_LyricSegments.size() )
return; return;
@@ -51,7 +51,7 @@ void LyricDisplay::Update( float fDeltaTime )
const Song *pSong = GAMESTATE->m_pCurSong; const Song *pSong = GAMESTATE->m_pCurSong;
const float fStartTime = (pSong->m_LyricSegments[m_iCurLyricNumber].m_fStartTime) - IN_LENGTH.GetValue(); 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; return;
// Clamp this lyric to the beginning of the next or the end of the music. // Clamp this lyric to the beginning of the next or the end of the music.
+2 -2
View File
@@ -61,7 +61,7 @@ void ScreenNameEntry::ScrollingText::Init( const RString &sName, const vector<fl
void ScreenNameEntry::ScrollingText::DrawPrimitives() void ScreenNameEntry::ScrollingText::DrawPrimitives()
{ {
const float fFakeBeat = GAMESTATE->m_fSongBeat; const float fFakeBeat = GAMESTATE->m_Position.m_fSongBeat;
const size_t iClosestIndex = lrintf( fFakeBeat ) % CHARS_CHOICES.size(); const size_t iClosestIndex = lrintf( fFakeBeat ) % CHARS_CHOICES.size();
const float fClosestYOffset = GetClosestCharYOffset( fFakeBeat ); const float fClosestYOffset = GetClosestCharYOffset( fFakeBeat );
@@ -325,7 +325,7 @@ void ScreenNameEntry::Update( float fDelta )
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("name entry") ); SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("name entry") );
m_fFakeBeat += fDelta * FAKE_BEATS_PER_SEC; m_fFakeBeat += fDelta * FAKE_BEATS_PER_SEC;
GAMESTATE->m_fSongBeat = m_fFakeBeat; GAMESTATE->m_Position.m_fSongBeat = m_fFakeBeat;
ScreenWithMenuElements::Update(fDelta); ScreenWithMenuElements::Update(fDelta);
} }
+1 -1
View File
@@ -221,7 +221,7 @@ bool ScreenSyncOverlay::OverlayInput( const InputEventPlus &input )
} }
if( GAMESTATE->m_pCurSong != NULL ) 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; seg.m_fBPS += fDelta;
} }
} }
+1 -1
View File
@@ -44,7 +44,7 @@ void SoundEffectControl::Update( float fDeltaTime )
if( LOCK_TO_HOLD ) if( LOCK_TO_HOLD )
{ {
int iRow = BeatToNoteRow( GAMESTATE->m_fSongBeat ); int iRow = BeatToNoteRow( GAMESTATE->m_Position.m_fSongBeat );
int iHoldsHeld, iHoldsLetGo; int iHoldsHeld, iHoldsLetGo;
HoldsBeingHeld( iRow, iHoldsHeld, iHoldsLetGo ); HoldsBeingHeld( iRow, iHoldsHeld, iHoldsLetGo );