improve scoping
This commit is contained in:
+17
-14
@@ -696,24 +696,27 @@ void Player::Step( int col, const RageTimer &tm )
|
|||||||
if( iIndexOverlappingNote != -1 )
|
if( iIndexOverlappingNote != -1 )
|
||||||
{
|
{
|
||||||
// compute the score for this hit
|
// compute the score for this hit
|
||||||
const float fStepBeat = NoteRowToBeat( iIndexOverlappingNote );
|
float fNoteOffset;
|
||||||
const float fStepSeconds = GAMESTATE->m_pCurSong->GetElapsedTimeFromBeat(fStepBeat);
|
{
|
||||||
|
const float fStepBeat = NoteRowToBeat( iIndexOverlappingNote );
|
||||||
|
const float fStepSeconds = GAMESTATE->m_pCurSong->GetElapsedTimeFromBeat(fStepBeat);
|
||||||
|
|
||||||
/* We actually stepped on the note this long ago: */
|
/* We actually stepped on the note this long ago: */
|
||||||
const float fTimeSinceStep = tm.Ago();
|
const float fTimeSinceStep = tm.Ago();
|
||||||
|
|
||||||
/* GAMESTATE->m_fMusicSeconds is the music time as of GAMESTATE->m_LastBeatUpdate. Figure
|
/* GAMESTATE->m_fMusicSeconds is the music time as of GAMESTATE->m_LastBeatUpdate. Figure
|
||||||
* out what the music time is as of now. */
|
* out what the music time is as of now. */
|
||||||
const float fCurrentMusicSeconds = GAMESTATE->m_fMusicSeconds + (GAMESTATE->m_LastBeatUpdate.Ago()*GAMESTATE->m_SongOptions.m_fMusicRate);
|
const float fCurrentMusicSeconds = GAMESTATE->m_fMusicSeconds + (GAMESTATE->m_LastBeatUpdate.Ago()*GAMESTATE->m_SongOptions.m_fMusicRate);
|
||||||
|
|
||||||
/* ... which means it happened at this point in the music: */
|
/* ... which means it happened at this point in the music: */
|
||||||
const float fMusicSeconds = fCurrentMusicSeconds - fTimeSinceStep * GAMESTATE->m_SongOptions.m_fMusicRate;
|
const float fMusicSeconds = fCurrentMusicSeconds - fTimeSinceStep * GAMESTATE->m_SongOptions.m_fMusicRate;
|
||||||
|
|
||||||
// The offset from the actual step in seconds:
|
// The offset from the actual step in seconds:
|
||||||
const float fNoteOffset = (fStepSeconds - fMusicSeconds) / GAMESTATE->m_SongOptions.m_fMusicRate; // account for music rate
|
fNoteOffset = (fStepSeconds - fMusicSeconds) / GAMESTATE->m_SongOptions.m_fMusicRate; // account for music rate
|
||||||
// LOG->Trace("step was %.3f ago, music is off by %f: %f vs %f, step was %f off",
|
// LOG->Trace("step was %.3f ago, music is off by %f: %f vs %f, step was %f off",
|
||||||
// fTimeSinceStep, GAMESTATE->m_LastBeatUpdate.Ago()/GAMESTATE->m_SongOptions.m_fMusicRate,
|
// fTimeSinceStep, GAMESTATE->m_LastBeatUpdate.Ago()/GAMESTATE->m_SongOptions.m_fMusicRate,
|
||||||
// fStepSeconds, fMusicSeconds, fNoteOffset );
|
// fStepSeconds, fMusicSeconds, fNoteOffset );
|
||||||
|
}
|
||||||
|
|
||||||
const float fSecondsFromPerfect = fabsf( fNoteOffset );
|
const float fSecondsFromPerfect = fabsf( fNoteOffset );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user