optimize and clean up a little
This commit is contained in:
@@ -255,10 +255,11 @@ float NoteData::GetLastBeat() const
|
||||
return fOldestBeatFoundSoFar;
|
||||
}
|
||||
|
||||
int NoteData::GetNumTapNotes( const float fStartBeat, const float fEndBeat ) const
|
||||
int NoteData::GetNumTapNotes( float fStartBeat, float fEndBeat ) const
|
||||
{
|
||||
int iNumNotes = 0;
|
||||
|
||||
if(fEndBeat == -1) fEndBeat = GetMaxBeat();
|
||||
int iStartIndex = BeatToNoteRow( fStartBeat );
|
||||
int iEndIndex = BeatToNoteRow( fEndBeat );
|
||||
|
||||
@@ -274,10 +275,11 @@ int NoteData::GetNumTapNotes( const float fStartBeat, const float fEndBeat ) con
|
||||
return iNumNotes;
|
||||
}
|
||||
|
||||
int NoteData::GetNumDoubles( const float fStartBeat, const float fEndBeat ) const
|
||||
int NoteData::GetNumDoubles( float fStartBeat, float fEndBeat ) const
|
||||
{
|
||||
int iNumDoubles = 0;
|
||||
|
||||
if(fEndBeat == -1) fEndBeat = GetMaxBeat();
|
||||
int iStartIndex = BeatToNoteRow( fStartBeat );
|
||||
int iEndIndex = BeatToNoteRow( fEndBeat );
|
||||
|
||||
@@ -296,10 +298,11 @@ int NoteData::GetNumDoubles( const float fStartBeat, const float fEndBeat ) cons
|
||||
return iNumDoubles;
|
||||
}
|
||||
|
||||
int NoteData::GetNumHoldNotes( const float fStartBeat, const float fEndBeat ) const
|
||||
int NoteData::GetNumHoldNotes( float fStartBeat, float fEndBeat ) const
|
||||
{
|
||||
int iNumHolds = 0;
|
||||
|
||||
if(fEndBeat == -1) fEndBeat = GetMaxBeat();
|
||||
for( int i=0; i<GetNumHoldNotes(); i++ )
|
||||
{
|
||||
const HoldNote &hn = GetHoldNote(i);
|
||||
|
||||
@@ -107,14 +107,19 @@ public:
|
||||
// statistics
|
||||
bool IsThereANoteAtRow( int iRow ) const;
|
||||
|
||||
/* Return the highest beat/row that might contain notes. (Use GetLastBeat if you need
|
||||
* accuracy.) */
|
||||
float GetMaxBeat() const { return NoteRowToBeat(GetMaxRow()); }
|
||||
int GetMaxRow() const { return int(m_TapNotes[0].size()); }
|
||||
|
||||
float GetFirstBeat() const; // return the beat number of the first note
|
||||
int GetFirstRow() const;
|
||||
float GetLastBeat() const; // return the beat number of the last note
|
||||
int GetLastRow() const;
|
||||
int GetNumTapNotes( const float fStartBeat = 0, const float fEndBeat = MAX_BEATS ) const;
|
||||
int GetNumDoubles( const float fStartBeat = 0, const float fEndBeat = MAX_BEATS ) const;
|
||||
int GetNumTapNotes( const float fStartBeat = 0, const float fEndBeat = -1 ) const;
|
||||
int GetNumDoubles( const float fStartBeat = 0, const float fEndBeat = -1 ) const;
|
||||
/* optimization: for the default of start to end, use the second (faster) */
|
||||
int GetNumHoldNotes( const float fStartBeat, const float fEndBeat = MAX_BEATS ) const;
|
||||
int GetNumHoldNotes( const float fStartBeat, const float fEndBeat = -1 ) const;
|
||||
int GetNumHoldNotes() const { return m_HoldNotes.size(); }
|
||||
|
||||
int GetPossibleDancePoints();
|
||||
|
||||
Reference in New Issue
Block a user