From 07918fe3ab5a9b15229e3bf6c8320e1011324cf4 Mon Sep 17 00:00:00 2001 From: Flameshadowxeroshin Date: Wed, 17 Jan 2018 15:07:57 -0600 Subject: [PATCH] fix invisible notes near beginning of song with ProgressAlternate --- src/NoteDisplay.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/NoteDisplay.cpp b/src/NoteDisplay.cpp index 8450f5ce19..b82b9bba1f 100644 --- a/src/NoteDisplay.cpp +++ b/src/NoteDisplay.cpp @@ -1339,9 +1339,10 @@ void NoteDisplay::DrawActor(const TapNote& tn, Actor* pActor, NotePart part, break; case NoteColorType_ProgressAlternate: fScaledBeat = fBeat * cache->m_iNoteColorCount[part]; - //knock it back into the last frame if it's on a boundary - if (fScaledBeat - int64_t(fScaledBeat) == 0.0f) - fScaledBeat -= 1.0f; + if( fScaledBeat - int64_t(fScaledBeat) == 0.0f ) + //we're on a boundary, so move to the previous frame. + //doing it this way ensures that fScaledBeat is never negative so fmodf works. + fScaledBeat += cache->m_iNoteColorCount[part] - 1; color = fmodf( ceilf( fScaledBeat ), (float)cache->m_iNoteColorCount[part] ); break; default: