Reduce dependency on MAX_BEATS.
Don't call GetLastBeat from GetFirstBeat.
This commit is contained in:
@@ -201,12 +201,11 @@ int NoteData::GetFirstRow() const
|
|||||||
|
|
||||||
float NoteData::GetFirstBeat() const
|
float NoteData::GetFirstBeat() const
|
||||||
{
|
{
|
||||||
float fEarliestBeatFoundSoFar = MAX_BEATS;
|
float fEarliestBeatFoundSoFar = -1;
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
int rows = GetLastRow();
|
for( i=0; i <= int(m_TapNotes[0].size()); i++ )
|
||||||
for( i=0; i<=rows; i++ )
|
|
||||||
{
|
{
|
||||||
if( !IsRowEmpty(i) )
|
if( !IsRowEmpty(i) )
|
||||||
{
|
{
|
||||||
@@ -216,13 +215,15 @@ float NoteData::GetFirstBeat() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
for( i=0; i<GetNumHoldNotes(); i++ )
|
for( i=0; i<GetNumHoldNotes(); i++ )
|
||||||
if( GetHoldNote(i).fStartBeat < fEarliestBeatFoundSoFar )
|
{
|
||||||
|
if( fEarliestBeatFoundSoFar == -1 ||
|
||||||
|
GetHoldNote(i).fStartBeat < fEarliestBeatFoundSoFar )
|
||||||
fEarliestBeatFoundSoFar = GetHoldNote(i).fStartBeat;
|
fEarliestBeatFoundSoFar = GetHoldNote(i).fStartBeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( fEarliestBeatFoundSoFar == -1 ) // there are no notes
|
||||||
if( fEarliestBeatFoundSoFar == MAX_BEATS ) // there are no notes
|
|
||||||
return 0;
|
return 0;
|
||||||
else
|
|
||||||
return fEarliestBeatFoundSoFar;
|
return fEarliestBeatFoundSoFar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -140,7 +140,9 @@ float NoteDataWithScoring::GetActualVoltageRadarValue( float fSongSeconds )
|
|||||||
|
|
||||||
const int BEAT_WINDOW = 8;
|
const int BEAT_WINDOW = 8;
|
||||||
|
|
||||||
for( int i=0; i<MAX_BEATS; i+=BEAT_WINDOW )
|
const int fEndBeat = (int) GetMaxBeat()+1;
|
||||||
|
|
||||||
|
for( int i=0; i<fEndBeat; i+=BEAT_WINDOW )
|
||||||
{
|
{
|
||||||
int iNumNotesThisWindow = 0;
|
int iNumNotesThisWindow = 0;
|
||||||
iNumNotesThisWindow += GetNumTapNotesWithScore(TNS_MARVELOUS,(float)i,(float)i+BEAT_WINDOW);
|
iNumNotesThisWindow += GetNumTapNotesWithScore(TNS_MARVELOUS,(float)i,(float)i+BEAT_WINDOW);
|
||||||
|
|||||||
Reference in New Issue
Block a user