From dd5353bd94174413083ba21cc2d32cef73cc0538 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 22 Oct 2005 05:17:10 +0000 Subject: [PATCH] cleanup wrap fExpandSeconds --- stepmania/src/ArrowEffects.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/stepmania/src/ArrowEffects.cpp b/stepmania/src/ArrowEffects.cpp index 880fa947c8..a26a4c3e14 100644 --- a/stepmania/src/ArrowEffects.cpp +++ b/stepmania/src/ArrowEffects.cpp @@ -124,14 +124,17 @@ float ArrowEffects::GetYOffset( const PlayerState* pPlayerState, int iCol, float if( fAccels[PlayerOptions::ACCEL_EXPAND] != 0 ) { - static float g_fExpandSeconds = 0; + static float fExpandSeconds = 0; static float fLastTime = 0; float fTime = RageTimer::GetTimeSinceStartFast(); if( !GAMESTATE->m_bFreeze ) - g_fExpandSeconds += fTime - fLastTime; + { + fExpandSeconds += fTime - fLastTime; + fExpandSeconds = fmodf( fExpandSeconds, PI*2 ); + } fLastTime = fTime; - float fExpandMultiplier = SCALE( RageFastCos(g_fExpandSeconds*3), -1, 1, 0.75f, 1.75f ); + float fExpandMultiplier = SCALE( RageFastCos(fExpandSeconds*3), -1, 1, 0.75f, 1.75f ); fScrollSpeed *= SCALE( fAccels[PlayerOptions::ACCEL_EXPAND], 0.f, 1.f, 1.f, fExpandMultiplier ); }