From 76a61ddae41fa97ec1938136c44f21071f698d29 Mon Sep 17 00:00:00 2001 From: Mike Hawkins Date: Sat, 10 May 2008 01:06:49 +0000 Subject: [PATCH] fixes to confusion code to not break dizzy --- stepmania/src/ArrowEffects.cpp | 31 +++++++++++++------------------ stepmania/src/ArrowEffects.h | 2 +- stepmania/src/NoteDisplay.cpp | 7 +++---- 3 files changed, 17 insertions(+), 23 deletions(-) diff --git a/stepmania/src/ArrowEffects.cpp b/stepmania/src/ArrowEffects.cpp index a9bff2a17a..c2b7313788 100644 --- a/stepmania/src/ArrowEffects.cpp +++ b/stepmania/src/ArrowEffects.cpp @@ -404,11 +404,22 @@ float ArrowEffects::GetXOffset( const PlayerState* pPlayerState, float fMidiNote return fXOffset; } -float ArrowEffects::GetRotation( const PlayerState* pPlayerState, float fNoteBeat ) +float ArrowEffects::GetRotation( const PlayerState* pPlayerState, float fNoteBeat, bool bIsHoldHead ) { + /* TODO: + * Find a way to make dizzy and confusion work together well. Currently, if both are on, + * dizzy is ignored otherwise the arrows will not line up properly with the receptor */ + const float* fEffects = pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects; + // Confusion + if( fEffects[PlayerOptions::EFFECT_CONFUSION] != 0 ) + { + float fConfRotation = ReceptorGetRotation( pPlayerState ); + return fConfRotation; + } // Dizzy - if( fEffects[PlayerOptions::EFFECT_DIZZY] != 0 && fEffects[PlayerOptions::EFFECT_CONFUSION] == 0 ) + // Doesn't affect hold heads, unlike confusion + else if( fEffects[PlayerOptions::EFFECT_DIZZY] != 0 && !bIsHoldHead ) { const float fSongBeat = GAMESTATE->m_fSongBeatVisible; float fDizzyRotation = fNoteBeat - fSongBeat; @@ -417,22 +428,6 @@ float ArrowEffects::GetRotation( const PlayerState* pPlayerState, float fNoteBea fDizzyRotation *= 180/PI; return fDizzyRotation; } - // Confusion - else if( fEffects[PlayerOptions::EFFECT_DIZZY] == 0 && fEffects[PlayerOptions::EFFECT_CONFUSION] != 0 ) - { - float fConfRotation = ReceptorGetRotation( pPlayerState ); - fConfRotation *= fEffects[PlayerOptions::EFFECT_DIZZY]; - return fConfRotation; - } - // Dizzy + Confusion - if( fEffects[PlayerOptions::EFFECT_DIZZY] != 0 && fEffects[PlayerOptions::EFFECT_CONFUSION] != 0 ) - { - float fRotation = ReceptorGetRotation( pPlayerState ); - float fDizzy = fEffects[PlayerOptions::EFFECT_DIZZY]; - float fConf = fEffects[PlayerOptions::EFFECT_CONFUSION]; - fRotation *= (fDizzy + fConf ); - return fRotation; - } else return 0; } diff --git a/stepmania/src/ArrowEffects.h b/stepmania/src/ArrowEffects.h index f61844adc0..6ac376f08f 100644 --- a/stepmania/src/ArrowEffects.h +++ b/stepmania/src/ArrowEffects.h @@ -32,7 +32,7 @@ public: // fRotation is Z rotation of an arrow. This will depend on the column of // the arrow and possibly the Arrow effect and the fYOffset (in the case of // EFFECT_DIZZY). - static float GetRotation( const PlayerState* pPlayerState, float fNoteBeat ); + static float GetRotation( const PlayerState* pPlayerState, float fNoteBeat, bool bIsHoldHead ); static float ReceptorGetRotation( const PlayerState* pPlayerState ); diff --git a/stepmania/src/NoteDisplay.cpp b/stepmania/src/NoteDisplay.cpp index 1ab3089a44..a9555e372e 100644 --- a/stepmania/src/NoteDisplay.cpp +++ b/stepmania/src/NoteDisplay.cpp @@ -657,11 +657,10 @@ void NoteDisplay::DrawActor( const TapNote& tn, Actor* pActor, NotePart part, in const RageColor diffuse = RageColor(fColorScale,fColorScale,fColorScale,fAlpha); const RageColor glow = RageColor(1,1,1,fGlow); float fRotation = 0; - if( tn.type != TapNote::hold_head ) - { - fRotation = ArrowEffects::GetRotation( m_pPlayerState, fBeat ); + + fRotation = ArrowEffects::GetRotation( m_pPlayerState, fBeat, tn.type == tn.hold_head ); + if( tn.type != tn.hold_head ) fColorScale *= ArrowEffects::GetBrightness( m_pPlayerState, fBeat ); - } pActor->SetRotationZ( fRotation ); pActor->SetXY( fX, fY );