Allow TickcountSegments to have a value of 0.

This allows for more accuracy with simfiles.
This commit is contained in:
Jason Felds
2011-03-01 09:30:47 -05:00
parent 13ec2cc57b
commit fcc42c0e4d
4 changed files with 60 additions and 50 deletions
+5
View File
@@ -13,6 +13,11 @@ _____________________________________________________________________________
sm-ssc v1.2.3 | 2011022? sm-ssc v1.2.3 | 2011022?
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
20110301
--------
* Allow Tickcount Segments to have a value of 0 to better replicate some
charts in the Pump series. [Wolfman2000]
20110228 20110228
-------- --------
* Add Fakes to the RadarCategories. [Wolfman2000] * Add Fakes to the RadarCategories. [Wolfman2000]
+6 -1
View File
@@ -2782,7 +2782,9 @@ 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 )
{ {
iCheckpointFrequencyRows = ROWS_PER_BEAT / GAMESTATE->m_pCurSong->m_Timing.GetTickcountAtRow( iLastRowCrossed ); int tickCurrent = GAMESTATE->m_pCurSong->m_Timing.GetTickcountAtRow( iLastRowCrossed );
// There are some charts that don't want tickcounts involved at all.
iCheckpointFrequencyRows = (tickCurrent > 0 ? ROWS_PER_BEAT / tickCurrent : 0);
} }
else if( CHECKPOINTS_USE_TIME_SIGNATURES ) else if( CHECKPOINTS_USE_TIME_SIGNATURES )
{ {
@@ -2792,6 +2794,8 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now )
iCheckpointFrequencyRows = ROWS_PER_BEAT * tSignature.m_iDenominator / (tSignature.m_iNumerator * 4); iCheckpointFrequencyRows = ROWS_PER_BEAT * tSignature.m_iDenominator / (tSignature.m_iNumerator * 4);
} }
if( iCheckpointFrequencyRows > 0 )
{
// "the first row after the start of the range that lands on a beat" // "the first row after the start of the range that lands on a beat"
int iFirstCheckpointInRange = ((m_iFirstUncrossedRow+iCheckpointFrequencyRows-1)/iCheckpointFrequencyRows) * iCheckpointFrequencyRows; int iFirstCheckpointInRange = ((m_iFirstUncrossedRow+iCheckpointFrequencyRows-1)/iCheckpointFrequencyRows) * iCheckpointFrequencyRows;
@@ -2848,6 +2852,7 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now )
} }
} }
} }
}
m_iFirstUncrossedRow = iLastRowCrossed+1; m_iFirstUncrossedRow = iLastRowCrossed+1;
} }
+1 -1
View File
@@ -2644,7 +2644,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
else if ( SM == SM_BackFromTickcountChange ) else if ( SM == SM_BackFromTickcountChange )
{ {
int iTick = atoi( ScreenTextEntry::s_sLastAnswer ); int iTick = atoi( ScreenTextEntry::s_sLastAnswer );
if ( iTick >= 1 && iTick <= ROWS_PER_BEAT ) if ( iTick >= 0 && iTick <= ROWS_PER_BEAT )
{ {
m_pSong->m_Timing.SetTickcountAtBeat( GAMESTATE->m_fSongBeat, iTick ); m_pSong->m_Timing.SetTickcountAtBeat( GAMESTATE->m_fSongBeat, iTick );
} }
+1 -1
View File
@@ -421,7 +421,7 @@ struct TickcountSegment
* @param s the starting row of this segment. * @param s the starting row of this segment.
* @param t the amount of ticks counted per beat. * @param t the amount of ticks counted per beat.
*/ */
TickcountSegment( int s, int t ){ m_iStartRow = max( 0, s ); m_iTicks = max( 1, t ); } TickcountSegment( int s, int t ){ m_iStartRow = max( 0, s ); m_iTicks = max( 0, t ); }
/** /**
* @brief The row in which the TickcountSegment activates. * @brief The row in which the TickcountSegment activates.
*/ */