From af56d0fcc262be9da924cc0052f58ff2278788a8 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 13 Jun 2003 00:24:33 +0000 Subject: [PATCH] Fix notes being judged as misses an index too early. Obvious on ridiculously slow songs (MAX3), but could affect reasonably slow sections, too (Sakura). --- stepmania/src/Player.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 4a8859f8ae..e92e4859a9 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -343,14 +343,13 @@ void Player::DrawPrimitives() m_HoldJudgment[c].Draw(); } -int Player::GetClosestNoteDirectional( int col, float fBeat, float fMaxSecondsDistance, int iDirection ) +int Player::GetClosestNoteDirectional( int col, float fBeat, float fMaxBeatsDistance, int iDirection ) { // look for the closest matching step const int iIndexStartLookingAt = BeatToNoteRow( fBeat ); // number of elements to examine on either end of iIndexStartLookingAt - const int iNumElementsToExamine = BeatToNoteRow( fMaxSecondsDistance ); - + const int iNumElementsToExamine = BeatToNoteRow( fMaxBeatsDistance ); // Start at iIndexStartLookingAt and search outward. for( int delta=0; delta < iNumElementsToExamine; delta++ ) { @@ -544,9 +543,19 @@ void Player::UpdateTapNotesMissedOlderThan( float fMissIfOlderThanSeconds ) { //LOG->Trace( "Notes::UpdateTapNotesMissedOlderThan(%f)", fMissIfOlderThanThisBeat ); const float fEarliestTime = GAMESTATE->m_fMusicSeconds - fMissIfOlderThanSeconds; - const float fMissIfOlderThanThisBeat = GAMESTATE->m_pCurSong->GetBeatFromElapsedTime(fEarliestTime); + bool bFreeze; + float fMissIfOlderThanThisBeat; + float fThrowAway; + GAMESTATE->m_pCurSong->GetBeatAndBPSFromElapsedTime( fEarliestTime, fMissIfOlderThanThisBeat, fThrowAway, bFreeze ); int iMissIfOlderThanThisIndex = BeatToNoteRow( fMissIfOlderThanThisBeat ); + if( bFreeze ) + { + /* iMissIfOlderThanThisIndex is a freeze. Include the index of the freeze, + * too. Otherwise we won't show misses for tap notes on freezes until the + * freeze finishes. */ + iMissIfOlderThanThisIndex++; + } // Since this is being called every frame, let's not check the whole array every time. // Instead, only check 10 elements back. Even 10 is overkill. @@ -554,12 +563,8 @@ void Player::UpdateTapNotesMissedOlderThan( float fMissIfOlderThanSeconds ) //LOG->Trace( "iStartCheckingAt: %d iMissIfOlderThanThisIndex: %d", iStartCheckingAt, iMissIfOlderThanThisIndex ); - /* If we're on a freeze, and the freeze has been running for fMissIfOlderThanSeconds, - * then iMissIfOlderThanThisIndex will be the freeze itself, in which case we do - * want to update the row of the freeze itself; otherwise we won't show misses - * for tap notes on freezes until the freeze finishes. */ int iNumMissesFound = 0; - for( int r=iStartCheckingAt; r<=iMissIfOlderThanThisIndex; r++ ) + for( int r=iStartCheckingAt; r