fix massive frame rate drop when using boomerang (versus, Queen of Light, 3x, boomerang)

This commit is contained in:
Chris Danford
2004-01-01 21:14:18 +00:00
parent e79fffbc49
commit 8e7707f16c
+22 -1
View File
@@ -412,7 +412,7 @@ void NoteField::DrawPrimitives()
iLastPixelToDraw = (int)(iLastPixelToDraw * fLastDrawScale * fDrawScale);
// probe for first and last notes on the screen
// Probe for first and last notes on the screen
float fFirstBeatToDraw = FindFirstDisplayedBeat( m_PlayerNumber, iFirstPixelToDraw );
float fLastBeatToDraw = FindLastDisplayedBeat( m_PlayerNumber, iLastPixelToDraw );
@@ -540,6 +540,18 @@ void NoteField::DrawPrimitives()
continue; // skip
}
// TRICKY: If boomerang is on, then all notes in the range
// [iFirstIndexToDraw,iLastIndexToDraw] aren't necessarily visible.
// Test every note to make sure it's on screen before drawing
float fYStartOffset = ArrowGetYOffset( m_PlayerNumber, 0, NoteRowToBeat(hn.iStartRow) );
float fYEndOffset = ArrowGetYOffset( m_PlayerNumber, 0, NoteRowToBeat(hn.iEndRow) );
if( !( iFirstPixelToDraw <= fYEndOffset && fYEndOffset <= iLastPixelToDraw ||
iFirstPixelToDraw <= fYStartOffset && fYStartOffset <= iLastPixelToDraw ||
fYStartOffset < iFirstPixelToDraw && fYEndOffset > iLastPixelToDraw ) )
{
continue; // skip
}
SearchForBeat( CurDisplay, NextDisplay, NoteRowToBeat(hn.iStartRow) );
bool bIsInSelectionRange = false;
@@ -572,6 +584,15 @@ void NoteField::DrawPrimitives()
if( tn == TAP_HOLD_HEAD ) // this is a HoldNote begin marker. Grade it, but don't draw
continue; // skip
// TRICKY: If boomerang is on, then all notes in the range
// [iFirstIndexToDraw,iLastIndexToDraw] aren't necessarily visible.
// Test every note to make sure it's on screen before drawing
float fYOffset = ArrowGetYOffset( m_PlayerNumber, 0, NoteRowToBeat(i) );
if( fYOffset > iLastPixelToDraw ) // off screen
continue; // skip
if( fYOffset < iFirstPixelToDraw ) // off screen
continue; // skip
// See if there is a hold step that begins on this index.
bool bHoldNoteBeginsOnThisBeat = false;
for( int c2=0; c2<GetNumTracks(); c2++ )