Skip to content

Commit a7ca8c7

Browse files
committed
Fix fps drop as songs go play out, need to figure out why fudging was needed.
1 parent 63c5efe commit a7ca8c7

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/Player.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ void Player::Update( float fDeltaTime )
10811081
}
10821082

10831083
// Check for completely judged rows.
1084-
UpdateJudgedRows();
1084+
UpdateJudgedRows(fDeltaTime);
10851085

10861086
// Check for TapNote misses
10871087
if (!GAMESTATE->m_bInStepEditor)
@@ -2491,10 +2491,13 @@ void Player::UpdateTapNotesMissedOlderThan( float fMissIfOlderThanSeconds )
24912491
}
24922492
}
24932493

2494-
void Player::UpdateJudgedRows()
2494+
void Player::UpdateJudgedRows(float fDeltaTime)
24952495
{
2496-
// Look ahead far enough to catch any rows judged early.
2496+
// Look into the past and future only as far as we need to
2497+
// in order to catch misses and early hits
2498+
// TODO: Figure out why fudging value is needed aside from rounding distance
24972499
const int iEndRow = BeatToNoteRow( m_Timing->GetBeatFromElapsedTime( m_pPlayerState->m_Position.m_fMusicSeconds + GetMaxStepDistanceSeconds() ) );
2500+
const int iStartRow = BeatToNoteRow(m_Timing->GetBeatFromElapsedTime(m_pPlayerState->m_Position.m_fMusicSeconds - GetMaxStepDistanceSeconds() - fDeltaTime - 0.1666667f));
24982501
bool bAllJudged = true;
24992502
const bool bSeparately = GAMESTATE->GetCurrentGame()->m_bCountNotesSeparately;
25002503

@@ -2505,6 +2508,10 @@ void Player::UpdateJudgedRows()
25052508
{
25062509
int iRow = iter.Row();
25072510

2511+
// Do not go across rows which are too old
2512+
if (iStartRow > iRow)
2513+
continue;
2514+
25082515
// Do not judge arrows in WarpSegments or FakeSegments
25092516
if (!m_Timing->IsJudgableAtRow(iRow))
25102517
continue;

0 commit comments

Comments
 (0)