From c51f77902b7fbf1d4bd1bed2f7e07e1808232386 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 26 Mar 2003 21:35:15 +0000 Subject: [PATCH] UpdateTapNotesMissedOlderThan's return value is never used; remove it Make HandleTapRowScore figure out its values for itself, so we don't duplicate logic --- stepmania/src/Player.cpp | 48 +++++++++++++++++++--------------------- stepmania/src/Player.h | 4 ++-- 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index ecaa218791..81d227f02e 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -448,14 +448,11 @@ void Player::OnRowDestroyed( int iIndexThatWasSteppedOn ) break; } - int iNumNotesInThisRow = 0; for( int c=0; c 0 ) - { - HandleTapRowScore( score, iNumNotesInThisRow ); // update score - m_Combo.SetCombo( GAMESTATE->m_CurStageStats.iCurCombo[m_PlayerNumber] ); - } + HandleTapRowScore( iIndexThatWasSteppedOn ); // update score + m_Combo.SetCombo( GAMESTATE->m_CurStageStats.iCurCombo[m_PlayerNumber] ); m_Judgment.SetJudgment( score ); } -int Player::UpdateTapNotesMissedOlderThan( float fMissIfOlderThanSeconds ) +void Player::UpdateTapNotesMissedOlderThan( float fMissIfOlderThanSeconds ) { //LOG->Trace( "Notes::UpdateTapNotesMissedOlderThan(%f)", fMissIfOlderThanThisBeat ); const float fEarliestTime = GAMESTATE->m_fMusicSeconds - fMissIfOlderThanSeconds; @@ -501,29 +495,26 @@ int Player::UpdateTapNotesMissedOlderThan( float fMissIfOlderThanSeconds ) int iNumMissesFound = 0; for( int r=iStartCheckingAt; r<=iMissIfOlderThanThisIndex; r++ ) { - int iNumMissesThisRow = 0; + bool MissedNoteOnThisRow = false; for( int t=0; t 0 ) - { - HandleTapRowScore( TNS_MISS, iNumMissesThisRow ); - m_Combo.SetCombo( GAMESTATE->m_CurStageStats.iCurCombo[m_PlayerNumber] ); + if( GetTapNote(t, r) == TAP_EMPTY) continue; /* no note here */ + if( GetTapNoteScore(t, r) != TNS_NONE ) continue; /* note here is hit */ + + MissedNoteOnThisRow = true; + SetTapNoteScore(t, r, TNS_MISS); } + + if(!MissedNoteOnThisRow) continue; + + HandleTapRowScore( r ); + m_Combo.SetCombo( GAMESTATE->m_CurStageStats.iCurCombo[m_PlayerNumber] ); } if( iNumMissesFound > 0 ) { m_Judgment.SetJudgment( TNS_MISS ); } - - return iNumMissesFound; } @@ -542,9 +533,16 @@ void Player::CrossedRow( int iNoteRow ) } -void Player::HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow ) +void Player::HandleTapRowScore( unsigned row ) { - ASSERT( iNumTapsInRow >= 1 ); + TapNoteScore scoreOfLastTap = LastTapNoteScore(row); + + int iNumTapsInRow = 0; + for( int c=0; c 0); #ifndef DEBUG // don't accumulate points if AutoPlay is on. diff --git a/stepmania/src/Player.h b/stepmania/src/Player.h index a4a34e9247..bfa5a23d2c 100644 --- a/stepmania/src/Player.h +++ b/stepmania/src/Player.h @@ -52,9 +52,9 @@ public: void FadeToFail(); protected: - int UpdateTapNotesMissedOlderThan( float fMissIfOlderThanThisBeat ); + void UpdateTapNotesMissedOlderThan( float fMissIfOlderThanThisBeat ); void OnRowDestroyed( int iStepIndex ); - void HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow ); + void HandleTapRowScore( unsigned row ); void HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore ); void HandleAutosync(float fNoteOffset);