diff --git a/Docs/Changelog_sm-ssc.txt b/Docs/Changelog_sm-ssc.txt index 7b4cefe479..3a8e0e6ed6 100644 --- a/Docs/Changelog_sm-ssc.txt +++ b/Docs/Changelog_sm-ssc.txt @@ -13,6 +13,11 @@ _____________________________________________________________________________ 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 -------- * Add Fakes to the RadarCategories. [Wolfman2000] diff --git a/src/Player.cpp b/src/Player.cpp index 66bdc60d44..cc2d2fafa2 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -2782,7 +2782,9 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now ) int iCheckpointFrequencyRows = ROWS_PER_BEAT/2; 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 ) { @@ -2792,59 +2794,62 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now ) iCheckpointFrequencyRows = ROWS_PER_BEAT * tSignature.m_iDenominator / (tSignature.m_iNumerator * 4); } - // "the first row after the start of the range that lands on a beat" - int iFirstCheckpointInRange = ((m_iFirstUncrossedRow+iCheckpointFrequencyRows-1)/iCheckpointFrequencyRows) * iCheckpointFrequencyRows; - - // "the last row or first row earlier that lands on a beat" - int iLastCheckpointInRange = ((iLastRowCrossed)/iCheckpointFrequencyRows) * iCheckpointFrequencyRows; - - for( int r = iFirstCheckpointInRange; r <= iLastCheckpointInRange; r += iCheckpointFrequencyRows ) + if( iCheckpointFrequencyRows > 0 ) { - //LOG->Trace( "%d...", r ); - vector viColsWithHold; - int iNumHoldsHeldThisRow = 0; - int iNumHoldsMissedThisRow = 0; + // "the first row after the start of the range that lands on a beat" + int iFirstCheckpointInRange = ((m_iFirstUncrossedRow+iCheckpointFrequencyRows-1)/iCheckpointFrequencyRows) * iCheckpointFrequencyRows; - // start at r-1 so that we consider holds whose end rows are equal to the checkpoint row - NoteData::all_tracks_iterator iter = m_NoteData.GetTapNoteRangeAllTracks( r-1, r, true ); - for( ; !iter.IsAtEnd(); ++iter ) + // "the last row or first row earlier that lands on a beat" + int iLastCheckpointInRange = ((iLastRowCrossed)/iCheckpointFrequencyRows) * iCheckpointFrequencyRows; + + for( int r = iFirstCheckpointInRange; r <= iLastCheckpointInRange; r += iCheckpointFrequencyRows ) { - TapNote &tn = *iter; - if( tn.type != TapNote::hold_head ) - continue; + //LOG->Trace( "%d...", r ); + vector viColsWithHold; + int iNumHoldsHeldThisRow = 0; + int iNumHoldsMissedThisRow = 0; - int iStartRow = iter.Row(); - int iEndRow = iStartRow + tn.iDuration; - int iTrack = iter.Track(); - - // "the first row after the hold head that lands on a beat" - int iFirstCheckpointOfHold = ((iStartRow+iCheckpointFrequencyRows)/iCheckpointFrequencyRows) * iCheckpointFrequencyRows; - - // "the end row or the first earlier row that lands on a beat" - int iLastCheckpointOfHold = ((iEndRow)/iCheckpointFrequencyRows) * iCheckpointFrequencyRows; - - // count the end of the hold as a checkpoint - bool bHoldOverlapsRow = iFirstCheckpointOfHold <= r && r <= iLastCheckpointOfHold; - if( !bHoldOverlapsRow ) - continue; - - viColsWithHold.push_back( iTrack ); - if( tn.HoldResult.fLife > 0 ) + // start at r-1 so that we consider holds whose end rows are equal to the checkpoint row + NoteData::all_tracks_iterator iter = m_NoteData.GetTapNoteRangeAllTracks( r-1, r, true ); + for( ; !iter.IsAtEnd(); ++iter ) { - ++iNumHoldsHeldThisRow; - ++tn.HoldResult.iCheckpointsHit; - } - else - { - ++iNumHoldsMissedThisRow; - ++tn.HoldResult.iCheckpointsMissed; - } - } + TapNote &tn = *iter; + if( tn.type != TapNote::hold_head ) + continue; - // TODO: Find a better way of handling hold checkpoints with other taps. - if( !viColsWithHold.empty() && ( CHECKPOINTS_TAPS_SEPARATE_JUDGMENT || m_NoteData.GetNumTapNotesInRow( iLastRowCrossed ) == 0 ) ) - { - HandleHoldCheckpoint( r, iNumHoldsHeldThisRow, iNumHoldsMissedThisRow, viColsWithHold ); + int iStartRow = iter.Row(); + int iEndRow = iStartRow + tn.iDuration; + int iTrack = iter.Track(); + + // "the first row after the hold head that lands on a beat" + int iFirstCheckpointOfHold = ((iStartRow+iCheckpointFrequencyRows)/iCheckpointFrequencyRows) * iCheckpointFrequencyRows; + + // "the end row or the first earlier row that lands on a beat" + int iLastCheckpointOfHold = ((iEndRow)/iCheckpointFrequencyRows) * iCheckpointFrequencyRows; + + // count the end of the hold as a checkpoint + bool bHoldOverlapsRow = iFirstCheckpointOfHold <= r && r <= iLastCheckpointOfHold; + if( !bHoldOverlapsRow ) + continue; + + viColsWithHold.push_back( iTrack ); + if( tn.HoldResult.fLife > 0 ) + { + ++iNumHoldsHeldThisRow; + ++tn.HoldResult.iCheckpointsHit; + } + else + { + ++iNumHoldsMissedThisRow; + ++tn.HoldResult.iCheckpointsMissed; + } + } + + // TODO: Find a better way of handling hold checkpoints with other taps. + if( !viColsWithHold.empty() && ( CHECKPOINTS_TAPS_SEPARATE_JUDGMENT || m_NoteData.GetNumTapNotesInRow( iLastRowCrossed ) == 0 ) ) + { + HandleHoldCheckpoint( r, iNumHoldsHeldThisRow, iNumHoldsMissedThisRow, viColsWithHold ); + } } } } diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 4f515bcea9..33934c6aba 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -2644,7 +2644,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) else if ( SM == SM_BackFromTickcountChange ) { 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 ); } diff --git a/src/TimingData.h b/src/TimingData.h index d8c83c1e1b..9c2e0b9fe9 100644 --- a/src/TimingData.h +++ b/src/TimingData.h @@ -421,7 +421,7 @@ struct TickcountSegment * @param s the starting row of this segment. * @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. */