From 231f9433c3b360267955b884ca6b58b72e871ee3 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sun, 15 May 2011 17:39:57 -0400 Subject: [PATCH] [splittiming] Speed Changes working...somewhat. There needs to be some more math involving the beats. --- src/ArrowEffects.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ArrowEffects.cpp b/src/ArrowEffects.cpp index e6f3831849..f8de8cfbdd 100644 --- a/src/ArrowEffects.cpp +++ b/src/ArrowEffects.cpp @@ -222,12 +222,15 @@ float ArrowEffects::GetYOffset( const PlayerState* pPlayerState, int iCol, float float fYOffset = 0; const SongPosition &position = (!GAMESTATE->m_bInStepEditor || GAMESTATE->m_bIsEditorStepTiming) ? pPlayerState->m_Position : GAMESTATE->m_Position; + + float fSongBeat = position.m_fSongBeatVisible; + + Steps *pCurSteps = GAMESTATE->m_pCurSteps[pPlayerState->m_PlayerNumber]; /* Usually, fTimeSpacing is 0 or 1, in which case we use entirely beat spacing or * entirely time spacing (respectively). Occasionally, we tween between them. */ if( pPlayerState->m_PlayerOptions.GetCurrent().m_fTimeSpacing != 1.0f ) { - float fSongBeat = position.m_fSongBeatVisible; float fBeatsUntilStep = fNoteBeat - fSongBeat; float fYOffsetBeatSpacing = fBeatsUntilStep; fYOffset += fYOffsetBeatSpacing * (1-pPlayerState->m_PlayerOptions.GetCurrent().m_fTimeSpacing); @@ -235,8 +238,8 @@ float ArrowEffects::GetYOffset( const PlayerState* pPlayerState, int iCol, float if( pPlayerState->m_PlayerOptions.GetCurrent().m_fTimeSpacing != 0.0f ) { - float fSongSeconds = position.m_fMusicSecondsVisible; - float fNoteSeconds = GAMESTATE->m_pCurSteps[pPlayerState->m_PlayerNumber]->m_Timing.GetElapsedTimeFromBeat(fNoteBeat); + float fSongSeconds = GAMESTATE->m_Position.m_fMusicSecondsVisible; + float fNoteSeconds = pCurSteps->m_Timing.GetElapsedTimeFromBeat(fNoteBeat); float fSecondsUntilStep = fNoteSeconds - fSongSeconds; float fBPM = pPlayerState->m_PlayerOptions.GetCurrent().m_fScrollBPM; float fBPS = fBPM/60.f; @@ -246,7 +249,7 @@ float ArrowEffects::GetYOffset( const PlayerState* pPlayerState, int iCol, float // TODO: If we allow noteskins to have metricable row spacing // (per issue 24), edit this to reflect that. -aj - fYOffset *= ARROW_SPACING; + fYOffset *= ARROW_SPACING * pCurSteps->m_Timing.GetSpeedPercentAtBeat( fSongBeat ); // don't mess with the arrows after they've crossed 0 if( fYOffset < 0 ) @@ -293,6 +296,7 @@ float ArrowEffects::GetYOffset( const PlayerState* pPlayerState, int iCol, float // Factor in scroll speed float fScrollSpeed = pPlayerState->m_PlayerOptions.GetCurrent().m_fScrollSpeed; + if( pPlayerState->m_PlayerOptions.GetCurrent().m_fRandomSpeed > 0 && !bAbsolute ) { // Generate a deterministically "random" speed for each arrow.