add diffuse_ramp effect
This commit is contained in:
@@ -211,6 +211,10 @@ void Actor::BeginDraw() // set the world matrix and calculate actor properties
|
||||
for(int i=0; i<4; i++)
|
||||
m_tempState.diffuse[i] = m_effectColor1*fPercentBetweenColors + m_effectColor2*(1.0f-fPercentBetweenColors);
|
||||
break;
|
||||
case diffuse_ramp:
|
||||
for(int i=0; i<4; i++)
|
||||
m_tempState.diffuse[i] = m_effectColor1*fPercentThroughEffect + m_effectColor2*(1.0f-fPercentThroughEffect);
|
||||
break;
|
||||
case glow_blink:
|
||||
m_tempState.glow = bBlinkOn ? m_effectColor1 : m_effectColor2;
|
||||
m_tempState.glow.a *= fOriginalAlpha; // don't glow if the Actor is transparent!
|
||||
@@ -628,6 +632,18 @@ void Actor::SetEffectDiffuseShift( float fEffectPeriodSeconds, RageColor c1, Rag
|
||||
m_effectColor2 = c2;
|
||||
}
|
||||
|
||||
void Actor::SetEffectDiffuseRamp( float fEffectPeriodSeconds, RageColor c1, RageColor c2 )
|
||||
{
|
||||
if( m_Effect != diffuse_ramp )
|
||||
{
|
||||
m_Effect = diffuse_ramp;
|
||||
m_fEffectPeriodSeconds = fEffectPeriodSeconds;
|
||||
m_fSecsIntoEffect = 0;
|
||||
}
|
||||
m_effectColor1 = c1;
|
||||
m_effectColor2 = c2;
|
||||
}
|
||||
|
||||
void Actor::SetEffectGlowBlink( float fEffectPeriodSeconds, RageColor c1, RageColor c2 )
|
||||
{
|
||||
if( m_Effect != glow_blink )
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
TWEEN_SPRING,
|
||||
};
|
||||
enum Effect { no_effect,
|
||||
diffuse_blink, diffuse_shift,
|
||||
diffuse_blink, diffuse_shift, diffuse_ramp,
|
||||
glow_blink, glow_shift,
|
||||
rainbow,
|
||||
wag, bounce, bob, pulse,
|
||||
@@ -255,6 +255,9 @@ public:
|
||||
void SetEffectDiffuseShift( float fEffectPeriodSeconds = 1.f,
|
||||
RageColor c1 = RageColor(0,0,0,1),
|
||||
RageColor c2 = RageColor(1,1,1,1) );
|
||||
void SetEffectDiffuseRamp( float fEffectPeriodSeconds = 1.f,
|
||||
RageColor c1 = RageColor(0,0,0,1),
|
||||
RageColor c2 = RageColor(1,1,1,1) );
|
||||
void SetEffectGlowBlink( float fEffectPeriodSeconds = 1.f,
|
||||
RageColor c1 = RageColor(1,1,1,0.2f),
|
||||
RageColor c2 = RageColor(1,1,1,0.8f) );
|
||||
@@ -498,6 +501,7 @@ public:
|
||||
static int vertalign( T* p, lua_State *L ) { p->SetVertAlignString(SArg(1)); return 0; }
|
||||
static int diffuseblink( T* p, lua_State *L ) { p->SetEffectDiffuseBlink(); return 0; }
|
||||
static int diffuseshift( T* p, lua_State *L ) { p->SetEffectDiffuseShift(); return 0; }
|
||||
static int diffuseramp( T* p, lua_State *L ) { p->SetEffectDiffuseRamp(); return 0; }
|
||||
static int glowblink( T* p, lua_State *L ) { p->SetEffectGlowBlink(); return 0; }
|
||||
static int glowshift( T* p, lua_State *L ) { p->SetEffectGlowShift(); return 0; }
|
||||
static int rainbow( T* p, lua_State *L ) { p->SetEffectRainbow(); return 0; }
|
||||
@@ -596,6 +600,7 @@ public:
|
||||
ADD_METHOD( vertalign )
|
||||
ADD_METHOD( diffuseblink )
|
||||
ADD_METHOD( diffuseshift )
|
||||
ADD_METHOD( diffuseramp )
|
||||
ADD_METHOD( glowblink )
|
||||
ADD_METHOD( glowshift )
|
||||
ADD_METHOD( rainbow )
|
||||
|
||||
Reference in New Issue
Block a user