fixes to confusion code to not break dizzy
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user