handle mod combining properly

This commit is contained in:
Glenn Maynard
2008-05-12 23:22:45 +00:00
parent c62bde404d
commit 34ce2ce7cb
+14 -22
View File
@@ -407,45 +407,37 @@ float ArrowEffects::GetXOffset( const PlayerState* pPlayerState, float fMidiNote
float ArrowEffects::GetRotation( const PlayerState* pPlayerState, float fNoteBeat, bool bIsHoldHead ) float ArrowEffects::GetRotation( const PlayerState* pPlayerState, float fNoteBeat, bool bIsHoldHead )
{ {
const float* fEffects = pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects; const float* fEffects = pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects;
float fRotation = 0;
// Confusion, Confusion + Dizzy
if( fEffects[PlayerOptions::EFFECT_CONFUSION] != 0 ) if( fEffects[PlayerOptions::EFFECT_CONFUSION] != 0 )
{ fRotation += ReceptorGetRotation( pPlayerState );
float fRotation = ReceptorGetRotation( pPlayerState );
return fRotation; // Doesn't affect hold heads, unlike confusion
} if( fEffects[PlayerOptions::EFFECT_DIZZY] != 0 && !bIsHoldHead )
/* Dizzy
* Doesn't affect hold heads, unlike confusion. */
else if( fEffects[PlayerOptions::EFFECT_DIZZY] != 0 && !bIsHoldHead )
{ {
const float fSongBeat = GAMESTATE->m_fSongBeatVisible; const float fSongBeat = GAMESTATE->m_fSongBeatVisible;
float fDizzyRotation = fNoteBeat - fSongBeat; float fDizzyRotation = fNoteBeat - fSongBeat;
fDizzyRotation *= fEffects[PlayerOptions::EFFECT_DIZZY]; fDizzyRotation *= fEffects[PlayerOptions::EFFECT_DIZZY];
fDizzyRotation = fmodf( fDizzyRotation, 2*PI ); fDizzyRotation = fmodf( fDizzyRotation, 2*PI );
fDizzyRotation *= 180/PI; fDizzyRotation *= 180/PI;
return fDizzyRotation; fRotation += fDizzyRotation;
} }
else return fRotation;
return 0;
} }
float ArrowEffects::ReceptorGetRotation( const PlayerState* pPlayerState ) float ArrowEffects::ReceptorGetRotation( const PlayerState* pPlayerState )
{ {
const float* fEffects = pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects; const float* fEffects = pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects;
float fRotation = 0;
/* Confusion, Confusion + Dizzy
* If both confusion and dizzy are on, then the rotation multiplier is the combination of
* the two otherwise only care about what the confusion percentage is */
if( fEffects[PlayerOptions::EFFECT_CONFUSION] != 0 ) if( fEffects[PlayerOptions::EFFECT_CONFUSION] != 0 )
{ {
float fRotation = GAMESTATE->m_fSongBeatVisible; float fConfRotation = GAMESTATE->m_fSongBeatVisible;
fRotation *= (fEffects[PlayerOptions::EFFECT_CONFUSION] + fEffects[PlayerOptions::EFFECT_DIZZY]); fConfRotation *= fEffects[PlayerOptions::EFFECT_CONFUSION];
fRotation = fmodf( fConfRotation, 2*PI ); fConfRotation = fmodf( fConfRotation, 2*PI );
fRotation *= -180/PI; fConfRotation *= -180/PI;
return fConfRotation; fRotation += fConfRotation;
} }
else return fRotation;
return 0;
} }