[splittiming] Bringing it down. (91)

This commit is contained in:
Jason Felds
2011-05-09 21:03:30 -04:00
parent 71bf72e964
commit f7d1b46f72
10 changed files with 59 additions and 59 deletions
+12 -12
View File
@@ -58,7 +58,7 @@ void AdjustSync::ResetOriginalSyncData()
s_pTimingDataOriginal = new TimingData; s_pTimingDataOriginal = new TimingData;
if( GAMESTATE->m_pCurSong ) if( GAMESTATE->m_pCurSong )
*s_pTimingDataOriginal = GAMESTATE->m_pCurSong->m_Timing; *s_pTimingDataOriginal = GAMESTATE->m_pCurSong->m_SongTiming;
else else
*s_pTimingDataOriginal = TimingData(); *s_pTimingDataOriginal = TimingData();
s_fGlobalOffsetSecondsOriginal = PREFSMAN->m_fGlobalOffsetSeconds; s_fGlobalOffsetSecondsOriginal = PREFSMAN->m_fGlobalOffsetSeconds;
@@ -87,7 +87,7 @@ void AdjustSync::SaveSyncChanges()
{ {
if( GAMESTATE->IsCourseMode() ) if( GAMESTATE->IsCourseMode() )
return; return;
if( GAMESTATE->m_pCurSong && *s_pTimingDataOriginal != GAMESTATE->m_pCurSong->m_Timing ) if( GAMESTATE->m_pCurSong && *s_pTimingDataOriginal != GAMESTATE->m_pCurSong->m_SongTiming )
{ {
if( GAMESTATE->IsEditing() ) if( GAMESTATE->IsEditing() )
{ {
@@ -110,7 +110,7 @@ void AdjustSync::RevertSyncChanges()
if( GAMESTATE->IsCourseMode() ) if( GAMESTATE->IsCourseMode() )
return; return;
PREFSMAN->m_fGlobalOffsetSeconds.Set( s_fGlobalOffsetSecondsOriginal ); PREFSMAN->m_fGlobalOffsetSeconds.Set( s_fGlobalOffsetSecondsOriginal );
GAMESTATE->m_pCurSong->m_Timing = *s_pTimingDataOriginal; GAMESTATE->m_pCurSong->m_SongTiming = *s_pTimingDataOriginal;
ResetOriginalSyncData(); ResetOriginalSyncData();
s_fStandardDeviation = 0.0f; s_fStandardDeviation = 0.0f;
s_fAverageError = 0.0f; s_fAverageError = 0.0f;
@@ -186,7 +186,7 @@ void AdjustSync::AutosyncOffset()
switch( GAMESTATE->m_SongOptions.GetCurrent().m_AutosyncType ) switch( GAMESTATE->m_SongOptions.GetCurrent().m_AutosyncType )
{ {
case SongOptions::AUTOSYNC_SONG: case SongOptions::AUTOSYNC_SONG:
GAMESTATE->m_pCurSong->m_Timing.m_fBeat0OffsetInSeconds += mean; GAMESTATE->m_pCurSong->m_SongTiming.m_fBeat0OffsetInSeconds += mean;
break; break;
case SongOptions::AUTOSYNC_MACHINE: case SongOptions::AUTOSYNC_MACHINE:
PREFSMAN->m_fGlobalOffsetSeconds.Set( PREFSMAN->m_fGlobalOffsetSeconds + mean ); PREFSMAN->m_fGlobalOffsetSeconds.Set( PREFSMAN->m_fGlobalOffsetSeconds + mean );
@@ -232,15 +232,15 @@ void AdjustSync::AutosyncTempo()
if( !CalcLeastSquares( s_vAutosyncTempoData, fSlope, fIntercept, fFilteredError ) ) if( !CalcLeastSquares( s_vAutosyncTempoData, fSlope, fIntercept, fFilteredError ) )
return; return;
GAMESTATE->m_pCurSong->m_Timing.m_fBeat0OffsetInSeconds += fIntercept; GAMESTATE->m_pCurSong->m_SongTiming.m_fBeat0OffsetInSeconds += fIntercept;
const float fScaleBPM = 1.0f/(1.0f - fSlope); const float fScaleBPM = 1.0f/(1.0f - fSlope);
FOREACH( BPMSegment, GAMESTATE->m_pCurSong->m_Timing.m_BPMSegments, i ) FOREACH( BPMSegment, GAMESTATE->m_pCurSong->m_SongTiming.m_BPMSegments, i )
i->SetBPM( i->GetBPM() * fScaleBPM ); i->SetBPM( i->GetBPM() * fScaleBPM );
// We assume that the stops were measured as a number of beats. // We assume that the stops were measured as a number of beats.
// Therefore, if we change the bpms, we need to make a similar // Therefore, if we change the bpms, we need to make a similar
// change to the stops. // change to the stops.
FOREACH( StopSegment, GAMESTATE->m_pCurSong->m_Timing.m_StopSegments, i ) FOREACH( StopSegment, GAMESTATE->m_pCurSong->m_SongTiming.m_StopSegments, i )
i->m_fStopSeconds *= 1.0f - fSlope; i->m_fStopSeconds *= 1.0f - fSlope;
SCREENMAN->SystemMessage( AUTOSYNC_CORRECTION_APPLIED.GetValue() ); SCREENMAN->SystemMessage( AUTOSYNC_CORRECTION_APPLIED.GetValue() );
@@ -296,7 +296,7 @@ void AdjustSync::GetSyncChangeTextSong( vector<RString> &vsAddTo )
{ {
float fOld = Quantize( AdjustSync::s_pTimingDataOriginal->m_fBeat0OffsetInSeconds, 0.001f ); float fOld = Quantize( AdjustSync::s_pTimingDataOriginal->m_fBeat0OffsetInSeconds, 0.001f );
float fNew = Quantize( GAMESTATE->m_pCurSong->m_Timing.m_fBeat0OffsetInSeconds, 0.001f ); float fNew = Quantize( GAMESTATE->m_pCurSong->m_SongTiming.m_fBeat0OffsetInSeconds, 0.001f );
float fDelta = fNew - fOld; float fDelta = fNew - fOld;
if( fabsf(fDelta) > 0.0001f ) if( fabsf(fDelta) > 0.0001f )
@@ -309,10 +309,10 @@ void AdjustSync::GetSyncChangeTextSong( vector<RString> &vsAddTo )
} }
} }
for( unsigned i=0; i<GAMESTATE->m_pCurSong->m_Timing.m_BPMSegments.size(); i++ ) for( unsigned i=0; i<GAMESTATE->m_pCurSong->m_SongTiming.m_BPMSegments.size(); i++ )
{ {
float fOld = Quantize( AdjustSync::s_pTimingDataOriginal->m_BPMSegments[i].GetBPM(), 0.001f ); float fOld = Quantize( AdjustSync::s_pTimingDataOriginal->m_BPMSegments[i].GetBPM(), 0.001f );
float fNew = Quantize( GAMESTATE->m_pCurSong->m_Timing.m_BPMSegments[i].GetBPM(), 0.001f ); float fNew = Quantize( GAMESTATE->m_pCurSong->m_SongTiming.m_BPMSegments[i].GetBPM(), 0.001f );
float fDelta = fNew - fOld; float fDelta = fNew - fOld;
if( fabsf(fDelta) > 0.0001f ) if( fabsf(fDelta) > 0.0001f )
@@ -330,10 +330,10 @@ void AdjustSync::GetSyncChangeTextSong( vector<RString> &vsAddTo )
} }
} }
for( unsigned i=0; i<GAMESTATE->m_pCurSong->m_Timing.m_StopSegments.size(); i++ ) for( unsigned i=0; i<GAMESTATE->m_pCurSong->m_SongTiming.m_StopSegments.size(); i++ )
{ {
float fOld = Quantize( AdjustSync::s_pTimingDataOriginal->m_StopSegments[i].m_fStopSeconds, 0.001f ); float fOld = Quantize( AdjustSync::s_pTimingDataOriginal->m_StopSegments[i].m_fStopSeconds, 0.001f );
float fNew = Quantize( GAMESTATE->m_pCurSong->m_Timing.m_StopSegments[i].m_fStopSeconds, 0.001f ); float fNew = Quantize( GAMESTATE->m_pCurSong->m_SongTiming.m_StopSegments[i].m_fStopSeconds, 0.001f );
float fDelta = fNew - fOld; float fDelta = fNew - fOld;
if( fabsf(fDelta) > 0.0001f ) if( fabsf(fDelta) > 0.0001f )
+3 -3
View File
@@ -419,7 +419,7 @@ void BackgroundImpl::LoadFromRandom( float fFirstBeat, float fEndBeat, const Bac
int iStartRow = BeatToNoteRow(fFirstBeat); int iStartRow = BeatToNoteRow(fFirstBeat);
int iEndRow = BeatToNoteRow(fEndBeat); int iEndRow = BeatToNoteRow(fEndBeat);
const TimingData &timing = m_pSong->m_Timing; const TimingData &timing = m_pSong->m_SongTiming;
// change BG every time signature change or 4 measures // change BG every time signature change or 4 measures
FOREACH_CONST( TimeSignatureSegment, timing.m_vTimeSignatureSegments, iter ) FOREACH_CONST( TimeSignatureSegment, timing.m_vTimeSignatureSegments, iter )
@@ -697,7 +697,7 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus
float fBeat, fBPS, fThrowAway; float fBeat, fBPS, fThrowAway;
bool bFreeze; bool bFreeze;
int iThrowAway; int iThrowAway;
pSong->m_Timing.GetBeatAndBPSFromElapsedTime( fCurrentTime, fBeat, fBPS, bFreeze, bFreeze, iThrowAway, fThrowAway ); pSong->m_SongTiming.GetBeatAndBPSFromElapsedTime( fCurrentTime, fBeat, fBPS, bFreeze, bFreeze, iThrowAway, fThrowAway );
// Calls to Update() should *not* be scaled by music rate; fCurrentTime is. Undo it. // Calls to Update() should *not* be scaled by music rate; fCurrentTime is. Undo it.
const float fRate = GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate; const float fRate = GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate;
@@ -762,7 +762,7 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus
m_pCurrentBGA->PlayCommand( "GainFocus" ); m_pCurrentBGA->PlayCommand( "GainFocus" );
/* How much time of this BGA have we skipped? (This happens with SetSeconds.) */ /* How much time of this BGA have we skipped? (This happens with SetSeconds.) */
const float fStartSecond = pSong->m_Timing.GetElapsedTimeFromBeat( change.m_fStartBeat ); const float fStartSecond = pSong->m_SongTiming.GetElapsedTimeFromBeat( change.m_fStartBeat );
/* This is affected by the music rate. */ /* This is affected by the music rate. */
fDeltaTime = fCurrentTime - fStartSecond; fDeltaTime = fCurrentTime - fStartSecond;
+1 -1
View File
@@ -27,7 +27,7 @@ void GameplayAssist::PlayTicks( const NoteData &nd )
* come out on time; the actual precise timing is handled by SetStartTime. */ * come out on time; the actual precise timing is handled by SetStartTime. */
float fPositionSeconds = GAMESTATE->m_fMusicSeconds; float fPositionSeconds = GAMESTATE->m_fMusicSeconds;
fPositionSeconds += SOUNDMAN->GetPlayLatency() + (float)CommonMetrics::TICK_EARLY_SECONDS + 0.250f; fPositionSeconds += SOUNDMAN->GetPlayLatency() + (float)CommonMetrics::TICK_EARLY_SECONDS + 0.250f;
const TimingData &timing = GAMESTATE->m_pCurSong->m_Timing; const TimingData &timing = GAMESTATE->m_pCurSong->m_SongTiming;
const float fSongBeat = timing.GetBeatFromElapsedTimeNoOffset( fPositionSeconds ); const float fSongBeat = timing.GetBeatFromElapsedTimeNoOffset( fPositionSeconds );
const int iSongRow = max( 0, BeatToNoteRowNotRounded( fSongBeat ) ); const int iSongRow = max( 0, BeatToNoteRowNotRounded( fSongBeat ) );
+2 -2
View File
@@ -73,8 +73,8 @@ void SongMeterDisplay::Update( float fDeltaTime )
{ {
if( GAMESTATE->m_pCurSong ) if( GAMESTATE->m_pCurSong )
{ {
float fSongStartSeconds = GAMESTATE->m_pCurSong->m_Timing.GetElapsedTimeFromBeat( GAMESTATE->m_pCurSong->m_fFirstBeat ); float fSongStartSeconds = GAMESTATE->m_pCurSong->m_SongTiming.GetElapsedTimeFromBeat( GAMESTATE->m_pCurSong->m_fFirstBeat );
float fSongEndSeconds = GAMESTATE->m_pCurSong->m_Timing.GetElapsedTimeFromBeat( GAMESTATE->m_pCurSong->m_fLastBeat ); float fSongEndSeconds = GAMESTATE->m_pCurSong->m_SongTiming.GetElapsedTimeFromBeat( GAMESTATE->m_pCurSong->m_fLastBeat );
float fPercentPositionSong = SCALE( GAMESTATE->m_fMusicSeconds, fSongStartSeconds, fSongEndSeconds, 0.0f, 1.0f ); float fPercentPositionSong = SCALE( GAMESTATE->m_fMusicSeconds, fSongStartSeconds, fSongEndSeconds, 0.0f, 1.0f );
CLAMP( fPercentPositionSong, 0, 1 ); CLAMP( fPercentPositionSong, 0, 1 );
+9 -9
View File
@@ -742,7 +742,7 @@ void NoteField::DrawPrimitives()
// Draw beat bars // Draw beat bars
if( GAMESTATE->IsEditing() || SHOW_BEAT_BARS ) if( GAMESTATE->IsEditing() || SHOW_BEAT_BARS )
{ {
const vector<TimeSignatureSegment> &vTimeSignatureSegments = GAMESTATE->m_pCurSong->m_Timing.m_vTimeSignatureSegments; const vector<TimeSignatureSegment> &vTimeSignatureSegments = GAMESTATE->m_pCurSong->m_SongTiming.m_vTimeSignatureSegments;
int iMeasureIndex = 0; int iMeasureIndex = 0;
FOREACH_CONST( TimeSignatureSegment, vTimeSignatureSegments, iter ) FOREACH_CONST( TimeSignatureSegment, vTimeSignatureSegments, iter )
{ {
@@ -786,7 +786,7 @@ void NoteField::DrawPrimitives()
ASSERT(GAMESTATE->m_pCurSong); ASSERT(GAMESTATE->m_pCurSong);
// BPM text // BPM text
FOREACH_CONST( BPMSegment, GAMESTATE->m_pCurSong->m_Timing.m_BPMSegments, seg ) FOREACH_CONST( BPMSegment, GAMESTATE->m_pCurSong->m_SongTiming.m_BPMSegments, seg )
{ {
if( seg->m_iStartRow >= iFirstRowToDraw && seg->m_iStartRow <= iLastRowToDraw ) if( seg->m_iStartRow >= iFirstRowToDraw && seg->m_iStartRow <= iLastRowToDraw )
{ {
@@ -797,7 +797,7 @@ void NoteField::DrawPrimitives()
} }
// Freeze text // Freeze text
FOREACH_CONST( StopSegment, GAMESTATE->m_pCurSong->m_Timing.m_StopSegments, seg ) FOREACH_CONST( StopSegment, GAMESTATE->m_pCurSong->m_SongTiming.m_StopSegments, seg )
{ {
if( seg->m_iStartRow >= iFirstRowToDraw && seg->m_iStartRow <= iLastRowToDraw ) if( seg->m_iStartRow >= iFirstRowToDraw && seg->m_iStartRow <= iLastRowToDraw )
{ {
@@ -808,7 +808,7 @@ void NoteField::DrawPrimitives()
} }
// Warp text // Warp text
FOREACH_CONST( WarpSegment, GAMESTATE->m_pCurSong->m_Timing.m_WarpSegments, seg ) FOREACH_CONST( WarpSegment, GAMESTATE->m_pCurSong->m_SongTiming.m_WarpSegments, seg )
{ {
if( seg->m_iStartRow >= iFirstRowToDraw && seg->m_iStartRow <= iLastRowToDraw ) if( seg->m_iStartRow >= iFirstRowToDraw && seg->m_iStartRow <= iLastRowToDraw )
{ {
@@ -819,7 +819,7 @@ void NoteField::DrawPrimitives()
} }
// Time Signature text // Time Signature text
FOREACH_CONST( TimeSignatureSegment, GAMESTATE->m_pCurSong->m_Timing.m_vTimeSignatureSegments, seg ) FOREACH_CONST( TimeSignatureSegment, GAMESTATE->m_pCurSong->m_SongTiming.m_vTimeSignatureSegments, seg )
{ {
if( seg->m_iStartRow >= iFirstRowToDraw && seg->m_iStartRow <= iLastRowToDraw ) if( seg->m_iStartRow >= iFirstRowToDraw && seg->m_iStartRow <= iLastRowToDraw )
{ {
@@ -830,7 +830,7 @@ void NoteField::DrawPrimitives()
} }
// Tickcount text // Tickcount text
FOREACH_CONST( TickcountSegment, GAMESTATE->m_pCurSong->m_Timing.m_TickcountSegments, seg ) FOREACH_CONST( TickcountSegment, GAMESTATE->m_pCurSong->m_SongTiming.m_TickcountSegments, seg )
{ {
if( seg->m_iStartRow >= iFirstRowToDraw && seg->m_iStartRow <= iLastRowToDraw ) if( seg->m_iStartRow >= iFirstRowToDraw && seg->m_iStartRow <= iLastRowToDraw )
{ {
@@ -841,7 +841,7 @@ void NoteField::DrawPrimitives()
} }
// Combo text // Combo text
FOREACH_CONST( ComboSegment, GAMESTATE->m_pCurSong->m_Timing.m_ComboSegments, seg ) FOREACH_CONST( ComboSegment, GAMESTATE->m_pCurSong->m_SongTiming.m_ComboSegments, seg )
{ {
if( seg->m_iStartRow >= iFirstRowToDraw && seg->m_iStartRow <= iLastRowToDraw ) if( seg->m_iStartRow >= iFirstRowToDraw && seg->m_iStartRow <= iLastRowToDraw )
{ {
@@ -852,7 +852,7 @@ void NoteField::DrawPrimitives()
} }
// Label text // Label text
FOREACH_CONST( LabelSegment, GAMESTATE->m_pCurSong->m_Timing.m_LabelSegments, seg ) FOREACH_CONST( LabelSegment, GAMESTATE->m_pCurSong->m_SongTiming.m_LabelSegments, seg )
{ {
if( seg->m_iStartRow >= iFirstRowToDraw && seg->m_iStartRow <= iLastRowToDraw ) if( seg->m_iStartRow >= iFirstRowToDraw && seg->m_iStartRow <= iLastRowToDraw )
{ {
@@ -872,7 +872,7 @@ void NoteField::DrawPrimitives()
FOREACH_CONST( Attack, ce.attacks, a ) FOREACH_CONST( Attack, ce.attacks, a )
{ {
float fSecond = a->fStartSecond; float fSecond = a->fStartSecond;
float fBeat = GAMESTATE->m_pCurSong->m_Timing.GetBeatFromElapsedTime( fSecond ); float fBeat = GAMESTATE->m_pCurSong->m_SongTiming.GetBeatFromElapsedTime( fSecond );
if( BeatToNoteRow(fBeat) >= iFirstRowToDraw && if( BeatToNoteRow(fBeat) >= iFirstRowToDraw &&
BeatToNoteRow(fBeat) <= iLastRowToDraw) BeatToNoteRow(fBeat) <= iLastRowToDraw)
+12 -12
View File
@@ -1528,7 +1528,7 @@ int Player::GetClosestNoteDirectional( int col, int iStartRow, int iEndRow, bool
// Is this the row we want? // Is this the row we want?
do { do {
const TapNote &tn = begin->second; const TapNote &tn = begin->second;
if( GAMESTATE->m_pCurSong->m_Timing.IsWarpAtRow( begin->first ) ) if( GAMESTATE->m_pCurSong->m_SongTiming.IsWarpAtRow( begin->first ) )
break; break;
if( tn.type == TapNote::empty ) if( tn.type == TapNote::empty )
break; break;
@@ -1579,7 +1579,7 @@ int Player::GetClosestNonEmptyRowDirectional( int iStartRow, int iEndRow, bool b
++iter; ++iter;
continue; continue;
} }
if( GAMESTATE->m_pCurSong->m_Timing.IsWarpAtRow( iter.Row() ) ) if( GAMESTATE->m_pCurSong->m_SongTiming.IsWarpAtRow( iter.Row() ) )
{ {
++iter; ++iter;
continue; continue;
@@ -2011,8 +2011,8 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b
* "jack hammers." Hmm. * "jack hammers." Hmm.
*/ */
const int iStepSearchRows = max( const int iStepSearchRows = max(
BeatToNoteRow( GAMESTATE->m_pCurSong->m_Timing.GetBeatFromElapsedTime( GAMESTATE->m_fMusicSeconds + StepSearchDistance ) ) - iSongRow, BeatToNoteRow( GAMESTATE->m_pCurSong->m_SongTiming.GetBeatFromElapsedTime( GAMESTATE->m_fMusicSeconds + StepSearchDistance ) ) - iSongRow,
iSongRow - BeatToNoteRow( GAMESTATE->m_pCurSong->m_Timing.GetBeatFromElapsedTime( GAMESTATE->m_fMusicSeconds - StepSearchDistance ) ) iSongRow - BeatToNoteRow( GAMESTATE->m_pCurSong->m_SongTiming.GetBeatFromElapsedTime( GAMESTATE->m_fMusicSeconds - StepSearchDistance ) )
) + ROWS_PER_BEAT; ) + ROWS_PER_BEAT;
int iRowOfOverlappingNoteOrRow = row; int iRowOfOverlappingNoteOrRow = row;
if( row == -1 ) if( row == -1 )
@@ -2089,7 +2089,7 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b
// Stepped too close to mine? // Stepped too close to mine?
if( !bRelease && ( REQUIRE_STEP_ON_MINES == !bHeld ) && if( !bRelease && ( REQUIRE_STEP_ON_MINES == !bHeld ) &&
fSecondsFromExact <= GetWindowSeconds(TW_Mine) && fSecondsFromExact <= GetWindowSeconds(TW_Mine) &&
!GAMESTATE->m_pCurSong->m_Timing.IsWarpAtRow(iSongRow) ) !GAMESTATE->m_pCurSong->m_SongTiming.IsWarpAtRow(iSongRow) )
score = TNS_HitMine; score = TNS_HitMine;
break; break;
@@ -2564,7 +2564,7 @@ void Player::UpdateTapNotesMissedOlderThan( float fMissIfOlderThanSeconds )
float fThrowAway; float fThrowAway;
int iWarpBeginRow; int iWarpBeginRow;
float fWarpLength; float fWarpLength;
GAMESTATE->m_pCurSong->m_Timing.GetBeatAndBPSFromElapsedTime( fEarliestTime, fMissIfOlderThanThisBeat, fThrowAway, bFreeze, bDelay, iWarpBeginRow, fWarpLength ); GAMESTATE->m_pCurSong->m_SongTiming.GetBeatAndBPSFromElapsedTime( fEarliestTime, fMissIfOlderThanThisBeat, fThrowAway, bFreeze, bDelay, iWarpBeginRow, fWarpLength );
iMissIfOlderThanThisRow = BeatToNoteRow( fMissIfOlderThanThisBeat ); iMissIfOlderThanThisRow = BeatToNoteRow( fMissIfOlderThanThisBeat );
if( bFreeze || bDelay ) if( bFreeze || bDelay )
@@ -2587,7 +2587,7 @@ void Player::UpdateTapNotesMissedOlderThan( float fMissIfOlderThanSeconds )
continue; continue;
// Ignore all notes that are skipped via WARPS. // Ignore all notes that are skipped via WARPS.
if( GAMESTATE->m_pCurSong->m_Timing.IsWarpAtRow( iter.Row() ) ) if( GAMESTATE->m_pCurSong->m_SongTiming.IsWarpAtRow( iter.Row() ) )
continue; continue;
if( tn.type == TapNote::mine ) if( tn.type == TapNote::mine )
@@ -2622,7 +2622,7 @@ void Player::UpdateJudgedRows()
int iRow = iter.Row(); int iRow = iter.Row();
// If row is within a warp section, ignore it. -aj // If row is within a warp section, ignore it. -aj
if( GAMESTATE->m_pCurSong->m_Timing.IsWarpAtRow(iRow) ) if( GAMESTATE->m_pCurSong->m_SongTiming.IsWarpAtRow(iRow) )
continue; continue;
if( iLastSeenRow != iRow ) if( iLastSeenRow != iRow )
@@ -2843,13 +2843,13 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now )
int iCheckpointFrequencyRows = ROWS_PER_BEAT/2; int iCheckpointFrequencyRows = ROWS_PER_BEAT/2;
if( CHECKPOINTS_USE_TICKCOUNTS ) if( CHECKPOINTS_USE_TICKCOUNTS )
{ {
int tickCurrent = GAMESTATE->m_pCurSong->m_Timing.GetTickcountAtRow( iLastRowCrossed ); int tickCurrent = GAMESTATE->m_pCurSong->m_SongTiming.GetTickcountAtRow( iLastRowCrossed );
// There are some charts that don't want tickcounts involved at all. // There are some charts that don't want tickcounts involved at all.
iCheckpointFrequencyRows = (tickCurrent > 0 ? ROWS_PER_BEAT / tickCurrent : 0); iCheckpointFrequencyRows = (tickCurrent > 0 ? ROWS_PER_BEAT / tickCurrent : 0);
} }
else if( CHECKPOINTS_USE_TIME_SIGNATURES ) else if( CHECKPOINTS_USE_TIME_SIGNATURES )
{ {
TimeSignatureSegment tSignature = GAMESTATE->m_pCurSong->m_Timing.GetTimeSignatureSegmentAtBeat( NoteRowToBeat( iLastRowCrossed ) ); TimeSignatureSegment tSignature = GAMESTATE->m_pCurSong->m_SongTiming.GetTimeSignatureSegmentAtBeat( NoteRowToBeat( iLastRowCrossed ) );
// Most songs are in 4/4 time. The frequency for checking tick counts should reflect that. // Most songs are in 4/4 time. The frequency for checking tick counts should reflect that.
iCheckpointFrequencyRows = ROWS_PER_BEAT * tSignature.m_iDenominator / (tSignature.m_iNumerator * 4); iCheckpointFrequencyRows = ROWS_PER_BEAT * tSignature.m_iDenominator / (tSignature.m_iNumerator * 4);
@@ -2957,7 +2957,7 @@ void Player::HandleTapRowScore( unsigned row )
#endif #endif
// Warp hackery. -aj // Warp hackery. -aj
if( GAMESTATE->m_pCurSong->m_Timing.IsWarpAtRow( row ) ) if( GAMESTATE->m_pCurSong->m_SongTiming.IsWarpAtRow( row ) )
return; return;
if( GAMESTATE->m_bDemonstrationOrJukebox ) if( GAMESTATE->m_bDemonstrationOrJukebox )
@@ -3061,7 +3061,7 @@ void Player::HandleHoldCheckpoint( int iRow, int iNumHoldsHeldThisRow, int iNumH
#endif #endif
// More warp hackery. -aj // More warp hackery. -aj
if( GAMESTATE->m_pCurSong->m_Timing.IsWarpAtRow( iRow ) ) if( GAMESTATE->m_pCurSong->m_SongTiming.IsWarpAtRow( iRow ) )
return; return;
// don't accumulate combo if AutoPlay is on. // don't accumulate combo if AutoPlay is on.
+2 -2
View File
@@ -443,7 +443,7 @@ void ScoreKeeperNormal::HandleComboInternal( int iNumHitContinueCombo, int iNumH
if( iNumBreakCombo == 0 ) if( iNumBreakCombo == 0 )
{ {
TimingData td = GAMESTATE->m_pCurSong->m_Timing; TimingData td = GAMESTATE->m_pCurSong->m_SongTiming;
int multiplier = ( iRow == -1 ? 1 : td.GetComboSegmentAtRow( iRow ).m_iCombo ); int multiplier = ( iRow == -1 ? 1 : td.GetComboSegmentAtRow( iRow ).m_iCombo );
m_pPlayerStageStats->m_iCurCombo += iNumHitContinueCombo * multiplier; m_pPlayerStageStats->m_iCurCombo += iNumHitContinueCombo * multiplier;
} }
@@ -463,7 +463,7 @@ void ScoreKeeperNormal::HandleRowComboInternal( TapNoteScore tns, int iNumTapsIn
if ( tns >= m_MinScoreToContinueCombo ) if ( tns >= m_MinScoreToContinueCombo )
{ {
m_pPlayerStageStats->m_iCurMissCombo = 0; m_pPlayerStageStats->m_iCurMissCombo = 0;
TimingData td = GAMESTATE->m_pCurSong->m_Timing; TimingData td = GAMESTATE->m_pCurSong->m_SongTiming;
int multiplier = ( iRow == -1 ? 1 : td.GetComboSegmentAtRow( iRow ).m_iCombo ); int multiplier = ( iRow == -1 ? 1 : td.GetComboSegmentAtRow( iRow ).m_iCombo );
m_pPlayerStageStats->m_iCurCombo += iNumTapsInRow * multiplier; m_pPlayerStageStats->m_iCurCombo += iNumTapsInRow * multiplier;
} }
+1 -1
View File
@@ -1423,7 +1423,7 @@ void ScreenGameplay::UpdateSongPosition( float fDeltaTime )
RageTimer tm; RageTimer tm;
const float fSeconds = m_pSoundMusic->GetPositionSeconds( NULL, &tm ); const float fSeconds = m_pSoundMusic->GetPositionSeconds( NULL, &tm );
const float fAdjust = SOUND->GetFrameTimingAdjustment( fDeltaTime ); const float fAdjust = SOUND->GetFrameTimingAdjustment( fDeltaTime );
GAMESTATE->UpdateSongPosition( fSeconds+fAdjust, GAMESTATE->m_pCurSong->m_Timing, tm+fAdjust ); GAMESTATE->UpdateSongPosition( fSeconds+fAdjust, GAMESTATE->m_pCurSong->m_SongTiming, tm+fAdjust );
} }
void ScreenGameplay::BeginScreen() void ScreenGameplay::BeginScreen()
+1 -1
View File
@@ -1763,7 +1763,7 @@ void ScreenSelectMusic::AfterMusicChange()
case SampleMusicPreviewMode_LastSong: // fall through case SampleMusicPreviewMode_LastSong: // fall through
// play the sample music // play the sample music
m_sSampleMusicToPlay = pSong->GetMusicPath(); m_sSampleMusicToPlay = pSong->GetMusicPath();
m_pSampleMusicTimingData = &pSong->m_Timing; m_pSampleMusicTimingData = &pSong->m_SongTiming;
m_fSampleStartSeconds = pSong->m_fMusicSampleStartSeconds; m_fSampleStartSeconds = pSong->m_fMusicSampleStartSeconds;
m_fSampleLengthSeconds = pSong->m_fMusicSampleLengthSeconds; m_fSampleLengthSeconds = pSong->m_fMusicSampleLengthSeconds;
break; break;
+16 -16
View File
@@ -167,7 +167,7 @@ void Song::GetDisplayBpms( DisplayBpms &AddTo ) const
else else
{ {
float fMinBPM, fMaxBPM; float fMinBPM, fMaxBPM;
m_Timing.GetActualBPM( fMinBPM, fMaxBPM ); m_SongTiming.GetActualBPM( fMinBPM, fMaxBPM );
AddTo.Add( fMinBPM ); AddTo.Add( fMinBPM );
AddTo.Add( fMaxBPM ); AddTo.Add( fMaxBPM );
} }
@@ -488,16 +488,16 @@ void Song::TidyUpData()
m_sArtist = "Unknown artist"; m_sArtist = "Unknown artist";
TranslateTitles(); TranslateTitles();
if( m_Timing.m_BPMSegments.empty() ) if( m_SongTiming.m_BPMSegments.empty() )
{ {
LOG->UserLog( "Song file", m_sSongDir + m_sSongFileName, "has no BPM segments, default provided." ); LOG->UserLog( "Song file", m_sSongDir + m_sSongFileName, "has no BPM segments, default provided." );
m_Timing.AddBPMSegment( BPMSegment(0, 60) ); m_SongTiming.AddBPMSegment( BPMSegment(0, 60) );
} }
// Make sure the first BPM segment starts at beat 0. // Make sure the first BPM segment starts at beat 0.
if( m_Timing.m_BPMSegments[0].m_iStartRow != 0 ) if( m_SongTiming.m_BPMSegments[0].m_iStartRow != 0 )
m_Timing.m_BPMSegments[0].m_iStartRow = 0; m_SongTiming.m_BPMSegments[0].m_iStartRow = 0;
if( m_fMusicSampleStartSeconds == -1 || if( m_fMusicSampleStartSeconds == -1 ||
@@ -791,10 +791,10 @@ void Song::TidyUpData()
} }
// If no time signature specified, assume 4/4 time for the whole song. // If no time signature specified, assume 4/4 time for the whole song.
if( m_Timing.m_vTimeSignatureSegments.empty() ) if( m_SongTiming.m_vTimeSignatureSegments.empty() )
{ {
TimeSignatureSegment seg(0, 4, 4); TimeSignatureSegment seg(0, 4, 4);
m_Timing.m_vTimeSignatureSegments.push_back( seg ); m_SongTiming.m_vTimeSignatureSegments.push_back( seg );
} }
/* /*
@@ -802,24 +802,24 @@ void Song::TidyUpData()
* per beat for the entire song. The default of 2 is chosen more * per beat for the entire song. The default of 2 is chosen more
* for compatibility with the Pump Pro series than anything else. * for compatibility with the Pump Pro series than anything else.
*/ */
if( m_Timing.m_TickcountSegments.empty() ) if( m_SongTiming.m_TickcountSegments.empty() )
{ {
TickcountSegment seg(0, 2); TickcountSegment seg(0, 2);
m_Timing.m_TickcountSegments.push_back( seg ); m_SongTiming.m_TickcountSegments.push_back( seg );
} }
// Have a default combo segment of one just in case. // Have a default combo segment of one just in case.
if( m_Timing.m_ComboSegments.empty() ) if( m_SongTiming.m_ComboSegments.empty() )
{ {
ComboSegment seg(0, 1); ComboSegment seg(0, 1);
m_Timing.m_ComboSegments.push_back( seg ); m_SongTiming.m_ComboSegments.push_back( seg );
} }
// Have a default label segment just in case. // Have a default label segment just in case.
if( m_Timing.m_LabelSegments.empty() ) if( m_SongTiming.m_LabelSegments.empty() )
{ {
LabelSegment seg(0, "Song Start"); LabelSegment seg(0, "Song Start");
m_Timing.m_LabelSegments.push_back( seg ); m_SongTiming.m_LabelSegments.push_back( seg );
} }
} }
@@ -1465,7 +1465,7 @@ bool Song::IsEditAlreadyLoaded( Steps* pSteps ) const
bool Song::HasSignificantBpmChangesOrStops() const bool Song::HasSignificantBpmChangesOrStops() const
{ {
if( m_Timing.HasStops() ) if( m_SongTiming.HasStops() )
return true; return true;
// Don't consider BPM changes that only are only for maintaining sync as // Don't consider BPM changes that only are only for maintaining sync as
@@ -1475,7 +1475,7 @@ bool Song::HasSignificantBpmChangesOrStops() const
if( m_fSpecifiedBPMMin != m_fSpecifiedBPMMax ) if( m_fSpecifiedBPMMin != m_fSpecifiedBPMMax )
return true; return true;
} }
else if( m_Timing.HasBpmChanges() ) else if( m_SongTiming.HasBpmChanges() )
{ {
return true; return true;
} }
@@ -1568,7 +1568,7 @@ public:
} }
static int GetTimingData( T* p, lua_State *L ) static int GetTimingData( T* p, lua_State *L )
{ {
p->m_Timing.PushSelf(L); p->m_SongTiming.PushSelf(L);
return 1; return 1;
} }
// has functions // has functions