From e645510909d34418a48136e5c74dc9f98a7d4df1 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 6 Mar 2003 22:25:21 +0000 Subject: [PATCH] Reduce dependency on MAX_BEATS --- stepmania/src/NoteDataWithScoring.cpp | 15 ++++++++++++--- stepmania/src/NoteDataWithScoring.h | 6 +++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/stepmania/src/NoteDataWithScoring.cpp b/stepmania/src/NoteDataWithScoring.cpp index 32b396a25d..56ff60fbdc 100644 --- a/stepmania/src/NoteDataWithScoring.cpp +++ b/stepmania/src/NoteDataWithScoring.cpp @@ -30,10 +30,13 @@ void NoteDataWithScoring::Init() m_fHoldNoteLife.clear(); } -int NoteDataWithScoring::GetNumTapNotesWithScore( TapNoteScore tns, const float fStartBeat, const float fEndBeat ) +int NoteDataWithScoring::GetNumTapNotesWithScore( TapNoteScore tns, const float fStartBeat, float fEndBeat ) { int iNumSuccessfulTapNotes = 0; + if(fEndBeat == -1) + fEndBeat = GetMaxBeat()+1; + unsigned iStartIndex = BeatToNoteRow( fStartBeat ); unsigned iEndIndex = BeatToNoteRow( fEndBeat ); @@ -49,10 +52,13 @@ int NoteDataWithScoring::GetNumTapNotesWithScore( TapNoteScore tns, const float return iNumSuccessfulTapNotes; } -int NoteDataWithScoring::GetNumDoublesWithScore( TapNoteScore tns, const float fStartBeat, const float fEndBeat ) +int NoteDataWithScoring::GetNumDoublesWithScore( TapNoteScore tns, const float fStartBeat, float fEndBeat ) { int iNumSuccessfulDoubles = 0; + if(fEndBeat == -1) + fEndBeat = GetMaxBeat()+1; + unsigned iStartIndex = BeatToNoteRow( fStartBeat ); unsigned iEndIndex = BeatToNoteRow( fEndBeat ); @@ -75,10 +81,13 @@ int NoteDataWithScoring::GetNumDoublesWithScore( TapNoteScore tns, const float f return iNumSuccessfulDoubles; } -int NoteDataWithScoring::GetNumHoldNotesWithScore( HoldNoteScore hns, const float fStartBeat, const float fEndBeat ) +int NoteDataWithScoring::GetNumHoldNotesWithScore( HoldNoteScore hns, const float fStartBeat, float fEndBeat ) { int iNumSuccessfulHolds = 0; + if(fEndBeat == -1) + fEndBeat = GetMaxBeat()+1; + for( int i=0; i