try to improve performance with scroll segments:

- optimize GetDisplayedBeat (seems to be a bottleneck here).
- make sure that fFirstBeatToDraw <= fBeat <= fLastBeatToDraw in IS_ON_SCREEN.
This commit is contained in:
Thai Pangsakulyanont
2011-06-04 19:02:45 +07:00
parent a1681faa06
commit 49042c4878
2 changed files with 13 additions and 5 deletions
+1 -1
View File
@@ -832,7 +832,7 @@ void NoteField::DrawPrimitives()
//LOG->Trace( "start = %f.1, end = %f.1", fFirstBeatToDraw-fSongBeat, fLastBeatToDraw-fSongBeat );
//LOG->Trace( "Drawing elements %d through %d", iFirstRowToDraw, iLastRowToDraw );
#define IS_ON_SCREEN( fBeat ) IsOnScreen( fBeat, 0, iDrawDistanceAfterTargetsPixels, iDrawDistanceBeforeTargetsPixels )
#define IS_ON_SCREEN( fBeat ) ( fFirstBeatToDraw <= (fBeat) && (fBeat) <= fLastBeatToDraw && IsOnScreen( fBeat, 0, iDrawDistanceAfterTargetsPixels, iDrawDistanceBeforeTargetsPixels ) )
// Draw board
if( SHOW_BOARD )