From 3961acc44782dfca4f4d39bb5dc951a2bdd20b98 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 3 Dec 2004 23:50:20 +0000 Subject: [PATCH] eliminating brute-force search for ticks --- stepmania/src/ScreenEdit.cpp | 3 ++- stepmania/src/ScreenGameplay.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index d9659b4c6b..b04d5ddc73 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -515,7 +515,8 @@ void ScreenEdit::PlayTicks() iRowLastCrossed = iSongRow; int iTickRow = -1; - for( int r=iRowLastCrossed+1; r<=iSongRow; r++ ) // for each index we crossed since the last update + // for each index we crossed since the last update: + FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( m_Player.m_NoteData, r, iRowLastCrossed+1, iSongRow ) if( m_Player.m_NoteData.IsThereATapOrHoldHeadAtRow( r ) ) iTickRow = r; diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 55dbb3ac0a..541a4779e0 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -1168,7 +1168,8 @@ void ScreenGameplay::PlayTicks() iRowLastCrossed = -1; int iTickRow = -1; - for( int r=iRowLastCrossed+1; r<=iSongRow; r++ ) // for each index we crossed since the last update + // for each index we crossed since the last update: + FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( m_Player[GAMESTATE->m_MasterPlayerNumber].m_NoteData, r, iRowLastCrossed+1, iSongRow ) if( m_Player[GAMESTATE->m_MasterPlayerNumber].m_NoteData.IsThereATapOrHoldHeadAtRow( r ) ) iTickRow = r;