From 22f8eb1214a4feca64ed27844181818a975469c0 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 22 Jan 2005 18:37:50 +0000 Subject: [PATCH] simplify --- stepmania/src/NoteDataWithScoring.cpp | 63 +++++---------------------- 1 file changed, 10 insertions(+), 53 deletions(-) diff --git a/stepmania/src/NoteDataWithScoring.cpp b/stepmania/src/NoteDataWithScoring.cpp index 9254ca3364..a742650732 100644 --- a/stepmania/src/NoteDataWithScoring.cpp +++ b/stepmania/src/NoteDataWithScoring.cpp @@ -6,17 +6,9 @@ namespace { -int GetNumTapNotesWithScore( const NoteData &in, TapNoteScore tns, const float fStartBeat = 0, float fEndBeat = -1 ) +int GetNumTapNotesWithScore( const NoteData &in, TapNoteScore tns, int iStartIndex = 0, int iEndIndex = 999999 ) { int iNumSuccessfulTapNotes = 0; - - if( fEndBeat == -1 ) - fEndBeat = in.GetLastBeat(); - - int iStartIndex = BeatToNoteRow( fStartBeat ); - int iEndIndex = BeatToNoteRow( fEndBeat ); - iEndIndex = min( iEndIndex, in.GetLastRow() ); - for( int t=0; t hn.iStartRow || hn.iEndRow > iEndIndex ) + if( !hn.ContainedByRange(iStartIndex, iEndIndex) ) continue; if( hn.result.hns == hns ) iNumSuccessfulHolds++; @@ -85,19 +61,10 @@ int GetNumHoldNotesWithScore( const NoteData &in, HoldNoteScore hns, float fStar return iNumSuccessfulHolds; } -int GetSuccessfulMines( const NoteData &in, float fStartBeat = 0, float fEndBeat = -1 ) +int GetSuccessfulMines( const NoteData &in, int iStartIndex = 0, int iEndIndex = 999999 ) { - if( fEndBeat == -1 ) - fEndBeat = in.GetLastBeat(); - - int iStartIndex = BeatToNoteRow( fStartBeat ); - int iEndIndex = BeatToNoteRow( fEndBeat ); - - iStartIndex = max( iStartIndex, 0 ); - iEndIndex = min( iEndIndex, in.GetLastRow() ); - int iNumSuccessfulMinesNotes = 0; - for( int i=iStartIndex; i<=iEndIndex; i++ ) + FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( in, i, iStartIndex, iEndIndex ) { for( int t=0; t