From 08756640d6e4e9cbea223c92a824c642189cb19b Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 25 Oct 2003 03:17:39 +0000 Subject: [PATCH] optimize --- stepmania/src/Player.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index db4e0cbaf0..0defe441dd 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -336,6 +336,10 @@ void PlayerMinus::Update( float fDeltaTime ) { const GameState::TransformToApply_t &tr = GAMESTATE->m_TransformsToApply[m_PlayerNumber][j]; + /* Note that runtime effects like these currently must not change hold + * notes. CopyRange below converts through 4s, which means the hold note + * array will be reconstructed; if hold notes end up in a different order, + * they won't align with this->m_HoldNoteScores. */ LOG->Trace( "Applying transform from %f to %f", tr.fStartBeat, tr.fEndBeat ); switch( tr.trans ) { @@ -822,6 +826,7 @@ void PlayerMinus::RandomiseNotes( int iNoteRow ) { const int NewNoteRow = (int)(iNoteRow + 50 / GAMESTATE->m_PlayerOptions[m_PlayerNumber].m_fScrollSpeed); // change the row to look ahead from based upon their speed mod + bool UpdateNoteField = false; int iNumOfTracks = GetNumTracks(); for( int t=0; t+1 < iNumOfTracks; t++ ) { @@ -833,10 +838,11 @@ void PlayerMinus::RandomiseNotes( int iNoteRow ) { SetTapNote(t, NewNoteRow, t2); SetTapNote(iRandomTrackToSwapWith, NewNoteRow, t1); + UpdateNoteField = true; } } - - m_pNoteField->CopyRange( this, NewNoteRow, NewNoteRow, NewNoteRow ); + if( UpdateNoteField ) + m_pNoteField->CopyRange( this, NewNoteRow, NewNoteRow, NewNoteRow ); } void PlayerMinus::HandleTapRowScore( unsigned row )