From d4235bf5322f28b06f24d366196cbcb1d5ed92c3 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 31 Jan 2003 03:07:19 +0000 Subject: [PATCH] fix drawing measure bars (these floats can be negative) --- stepmania/src/NoteField.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stepmania/src/NoteField.cpp b/stepmania/src/NoteField.cpp index b76967ed40..fa5fad13c4 100644 --- a/stepmania/src/NoteField.cpp +++ b/stepmania/src/NoteField.cpp @@ -195,8 +195,8 @@ void NoteField::DrawPrimitives() // // Draw measure bars // - unsigned iFirstMeasureToDraw = int(fFirstBeatToDraw)/BEATS_PER_MEASURE; - unsigned iLastMeasureToDraw = (int(fLastBeatToDraw)/BEATS_PER_MEASURE)+1; + unsigned iFirstMeasureToDraw = max(0, int(fFirstBeatToDraw)/BEATS_PER_MEASURE); + unsigned iLastMeasureToDraw = max(0, (int(fLastBeatToDraw)/BEATS_PER_MEASURE)+1); for( i=iFirstMeasureToDraw; i<=iLastMeasureToDraw; i++ ) DrawMeasureBar( i ); @@ -260,7 +260,7 @@ void NoteField::DrawPrimitives() const HoldNote &hn = GetHoldNote(i); const HoldNoteScore hns = GetHoldNoteScore(i); const float fLife = GetHoldNoteLife(i); - const bool bIsHoldingNote = (i < m_bIsHoldingHoldNote.size())? + const bool bIsHoldingNote = (i < int(m_bIsHoldingHoldNote.size()))? m_bIsHoldingHoldNote[i]: false; if( hns == HNS_OK ) // if this HoldNote was completed