remove EffectCommand. Use SetDrawFunction instead; it's cleaner

and can modify any property, not just tweened properties.
This commit is contained in:
Glenn Maynard
2007-02-20 02:06:11 +00:00
parent 30ecc6152b
commit 0d693a0ccb
2 changed files with 2 additions and 28 deletions
-22
View File
@@ -170,7 +170,6 @@ Actor::Actor( const Actor &cpy ):
CPY( m_VertAlign );
CPY( m_Effect );
CPY( m_sEffectCommand );
CPY( m_fSecsIntoEffect );
CPY( m_fEffectDelta );
CPY( m_fEffectRampUp );
@@ -268,19 +267,6 @@ void Actor::BeginDraw() // set the world matrix and calculate actor properties
if( m_Effect == no_effect )
{
}
else if( m_Effect == effect_lua )
{
/* Allow a Lua function to set the frame's draw state. This may be expensive
* and has not been well-benchmarked yet; use wisely. This allows arbitrary
* effects, instead of the mess of parameters below. (In fact, all this does
* is run a command, but to avoid calling RunCommand() all the time, and due
* to the fact that this is the only place where the TempState is meaningful,
* we treat this as an effect.) */
m_pTempState = &tempState;
tempState = m_current;
PlayCommand( m_sEffectCommand );
}
else
{
m_pTempState = &tempState;
@@ -825,12 +811,6 @@ void Actor::SetEffectTiming( float fRampUp, float fAtHalf, float fRampDown, floa
// effect "macros"
void Actor::SetEffectLua( const RString &sCommand )
{
m_Effect = effect_lua;
m_sEffectCommand = sCommand;
}
void Actor::SetEffectDiffuseBlink( float fEffectPeriodSeconds, RageColor c1, RageColor c2 )
{
if( m_Effect != diffuse_blink )
@@ -1292,7 +1272,6 @@ public:
static int shadowlength( T* p, lua_State *L ) { p->SetShadowLength(FArg(1)); return 0; }
static int horizalign( T* p, lua_State *L ) { p->SetHorizAlign(Enum::Check<HorizAlign>(L, 1)); return 0; }
static int vertalign( T* p, lua_State *L ) { p->SetVertAlign(Enum::Check<VertAlign>(L, 1)); return 0; }
static int luaeffect( T* p, lua_State *L ) { p->SetEffectLua(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; }
@@ -1469,7 +1448,6 @@ public:
ADD_METHOD( shadowlength );
ADD_METHOD( horizalign );
ADD_METHOD( vertalign );
ADD_METHOD( luaeffect );
ADD_METHOD( diffuseblink );
ADD_METHOD( diffuseshift );
ADD_METHOD( diffuseramp );
+2 -6
View File
@@ -63,7 +63,7 @@ public:
static void SetBGMTime( float fTime, float fBeat );
static void SetBGMLight( int iLightNumber, float fCabinetLights );
enum Effect { no_effect, effect_lua,
enum Effect { no_effect,
diffuse_blink, diffuse_shift, diffuse_ramp,
glow_blink, glow_shift,
rainbow,
@@ -231,9 +231,7 @@ public:
virtual float GetTweenTimeLeft() const; // Amount of time until all tweens have stopped
TweenState& DestTweenState() // where Actor will end when its tween finish
{
if( m_pTempState != NULL ) // effect_lua running
return *m_pTempState;
else if( m_Tweens.empty() ) // not tweening
if( m_Tweens.empty() ) // not tweening
return m_current;
else
return m_Tweens.back()->state;
@@ -277,7 +275,6 @@ public:
void SetEffectMagnitude( RageVector3 vec ) { m_vEffectMagnitude = vec; }
RageVector3 GetEffectMagnitude() const { return m_vEffectMagnitude; }
void SetEffectLua( const RString &sCommand );
void SetEffectDiffuseBlink(
float fEffectPeriodSeconds = 1.0f,
RageColor c1 = RageColor(0.5f,0.5f,0.5f,1),
@@ -429,7 +426,6 @@ protected:
// Stuff for effects
//
Effect m_Effect;
RString m_sEffectCommand; // effect_lua
float m_fSecsIntoEffect;
float m_fEffectDelta;