From bfdbaf3dbbed3a4d231953c746582ae88ef4cad2 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 13 Jun 2003 00:50:24 +0000 Subject: [PATCH] Player::Update: Don't round for CrossedRow + explanation. GetClosestNoteDirectional: Always round up, so we always look far enough. It's harmless to look a little too far. Fixes not being able to hit a note .5 of a note row too soon--there was small window in which you hadn't been graded and should have been able to register a boo, but steps were ignored. (This showed up in MAX3.) --- stepmania/src/Player.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index e92e4859a9..7e0e1de20e 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -288,7 +288,11 @@ void Player::Update( float fDeltaTime ) m_sLastSeenNoteSkin = GAMESTATE->m_PlayerOptions[m_PlayerNumber].m_sNoteSkin; } */ - const int iRowNow = BeatToNoteRow( GAMESTATE->m_fSongBeat ); + // Why was this originally "BeatToNoteRowNotRounded"? It should be rounded. -Chris + /* We want to send the crossed row message exactly when we cross the row--not + * .5 before the row. Use MAX3 as a test case: without rounding, autoplay steps + * early. -glenn */ + const int iRowNow = BeatToNoteRowNotRounded( GAMESTATE->m_fSongBeat ); if( iRowNow >= 0 ) { for( ; m_iRowLastCrossed <= iRowNow; m_iRowLastCrossed++ ) // for each index we crossed since the last update @@ -343,13 +347,16 @@ void Player::DrawPrimitives() m_HoldJudgment[c].Draw(); } +/* It's OK for this function to search a little more than was requested. */ int Player::GetClosestNoteDirectional( int col, float fBeat, float fMaxBeatsDistance, int iDirection ) { // look for the closest matching step const int iIndexStartLookingAt = BeatToNoteRow( fBeat ); - // number of elements to examine on either end of iIndexStartLookingAt - const int iNumElementsToExamine = BeatToNoteRow( fMaxBeatsDistance ); + /* Number of elements to examine on either end of iIndexStartLookingAt. Make + * sure we always round up. */ + const int iNumElementsToExamine = BeatToNoteRow( fMaxBeatsDistance + 1 ); + // Start at iIndexStartLookingAt and search outward. for( int delta=0; delta < iNumElementsToExamine; delta++ ) {