[splittiming] Let's break things again! (222)
We introduced a new class, called "SongPosition", that replaces some instance variables in the GameState class. (GameState::m_Position). Then, you also have it in PlayerState class which keeps track of the position based on their steps. (PlayerState::m_Position). Fixing the build errors: - GAMESTATE->m_fSomething should now be: - GAMESTATE->m_Position.m_fSomething - pPlayerState->m_Position.m_fSomething (or m_pPlayerState for some instance!)
This commit is contained in:
+6
-46
@@ -951,53 +951,13 @@ static Preference<float> g_fVisualDelaySeconds( "VisualDelaySeconds", 0.0f );
|
||||
|
||||
void GameState::UpdateSongPosition( float fPositionSeconds, const TimingData &timing, const RageTimer ×tamp )
|
||||
{
|
||||
if( !timestamp.IsZero() )
|
||||
m_LastBeatUpdate = timestamp;
|
||||
else
|
||||
m_LastBeatUpdate.Touch();
|
||||
|
||||
m_Position.UpdateSongPosition( fPositionSeconds, timing, timestamp );
|
||||
|
||||
// xxx testing: only do this on monotune survivor
|
||||
/*
|
||||
if( m_pCurSong && m_pCurSong->GetDisplayFullTitle() == "monotune survivor" )
|
||||
LOG->Trace( ssprintf("[GameState::UpdateSongPosition] cur BPS = %f, fPositionSeconds = %f",m_fCurBPS,fPositionSeconds) );
|
||||
*/
|
||||
|
||||
timing.GetBeatAndBPSFromElapsedTime( fPositionSeconds, m_fSongBeat, m_fCurBPS, m_bFreeze, m_bDelay, m_iWarpBeginRow, m_fWarpDestination );
|
||||
// "Crash reason : -243478.890625 -48695.773438"
|
||||
ASSERT_M( m_fSongBeat > -2000, ssprintf("Song beat %f at %f seconds", m_fSongBeat, fPositionSeconds) );
|
||||
|
||||
m_fMusicSeconds = fPositionSeconds;
|
||||
|
||||
m_fLightSongBeat = timing.GetBeatFromElapsedTime( fPositionSeconds + g_fLightsAheadSeconds );
|
||||
|
||||
m_fSongBeatNoOffset = timing.GetBeatFromElapsedTimeNoOffset( fPositionSeconds );
|
||||
|
||||
m_fMusicSecondsVisible = fPositionSeconds - g_fVisualDelaySeconds.Get();
|
||||
float fThrowAway, fThrowAway2;
|
||||
bool bThrowAway;
|
||||
int iThrowAway;
|
||||
timing.GetBeatAndBPSFromElapsedTime( m_fMusicSecondsVisible, m_fSongBeatVisible, fThrowAway, bThrowAway, bThrowAway, iThrowAway, fThrowAway2 );
|
||||
|
||||
/*
|
||||
// xxx testing: only do this on monotune survivor
|
||||
if( m_pCurSong && m_pCurSong->GetDisplayFullTitle() == "monotune survivor" )
|
||||
{
|
||||
// and only do it in the known negative bpm region. HACKITY HACK
|
||||
if(m_fSongBeat >= 445.490f && m_fSongBeat <= 453.72f)
|
||||
{
|
||||
LOG->Trace( ssprintf("fPositionSeconds = %f",fPositionSeconds) );
|
||||
LOG->Trace( ssprintf("Song beat: %f (%f seconds), BPS = %f (%f BPM)",m_fSongBeat,m_fMusicSecondsVisible,m_fCurBPS,m_fCurBPS*60.0f) );
|
||||
//LOG->Trace( ssprintf("Music seconds visible %f = fPositionSeconds %f - g_fVisualDelaySeconds %f", m_fMusicSecondsVisible,fPositionSeconds,g_fVisualDelaySeconds.Get()) );
|
||||
}
|
||||
else if(m_fSongBeat == 445.500f)
|
||||
{
|
||||
LOG->Trace( ssprintf("[beat 445.500] fPositionSeconds = %f",fPositionSeconds) );
|
||||
LOG->Trace( ssprintf("Song beat: %f (%f seconds), BPS = %f (%f BPM)",m_fSongBeat,m_fMusicSecondsVisible,m_fCurBPS,m_fCurBPS*60.0f) );
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
Actor::SetBGMTime( m_fMusicSecondsVisible, m_fSongBeatVisible, fPositionSeconds, m_fSongBeatNoOffset );
|
||||
FOREACH_EnabledPlayer( pn )
|
||||
m_pPlayerState[pn]->m_Position.UpdateSongPosition( fPositionSeconds, m_pCurSteps[pn]->m_Timing, timestamp );
|
||||
|
||||
Actor::SetBGMTime( m_Position.m_fMusicSecondsVisible, m_Position.m_fSongBeatVisible, m_Position.fPositionSeconds, m_Position.m_fSongBeatNoOffset );
|
||||
// LOG->Trace( "m_fMusicSeconds = %f, m_fSongBeat = %f, m_fCurBPS = %f, m_bFreeze = %f", m_fMusicSeconds, m_fSongBeat, m_fCurBPS, m_bFreeze );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user