From 6016f34983aa189e67cce31ad53af92dbb8fe37a Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sat, 26 Mar 2005 19:30:10 +0000 Subject: [PATCH] multiply the alphas so we can fade even while an effect is playing --- stepmania/src/Actor.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index 079b757072..099c2e8533 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -205,15 +205,24 @@ void Actor::BeginDraw() // set the world matrix and calculate actor properties * (That would have the same effect with 1,1,1,1, and allow tweening the diffuse * while blinking and shifting.) */ for(int i=0; i<4; i++) + { m_tempState.diffuse[i] = bBlinkOn ? m_effectColor1 : m_effectColor2; + m_tempState.diffuse[i].a *= fOriginalAlpha; // multiply the alphas so we can fade even while an effect is playing + } break; case diffuse_shift: for(int i=0; i<4; i++) + { m_tempState.diffuse[i] = m_effectColor1*fPercentBetweenColors + m_effectColor2*(1.0f-fPercentBetweenColors); + m_tempState.diffuse[i].a *= fOriginalAlpha; // multiply the alphas so we can fade even while an effect is playing + } break; case diffuse_ramp: for(int i=0; i<4; i++) + { m_tempState.diffuse[i] = m_effectColor1*fPercentThroughEffect + m_effectColor2*(1.0f-fPercentThroughEffect); + m_tempState.diffuse[i].a *= fOriginalAlpha; // multiply the alphas so we can fade even while an effect is playing + } break; case glow_blink: m_tempState.glow = bBlinkOn ? m_effectColor1 : m_effectColor2;