Files
itgmania212121/stepmania/src/Actor.h
T

516 lines
19 KiB
C++
Raw Normal View History

2004-06-08 00:47:53 +00:00
/* Actor - Base class for all objects that appear on the screen. */
#ifndef ACTOR_H
#define ACTOR_H
2001-11-03 10:52:42 +00:00
#include "RageTypes.h"
2005-07-04 21:45:16 +00:00
#include "RageUtil_AutoPtr.h"
#include "LuaReference.h"
2006-09-26 20:00:27 +00:00
#include "EnumHelper.h"
2005-01-04 10:41:32 +00:00
#include <map>
class XNode;
2005-01-26 11:21:43 +00:00
struct lua_State;
2005-07-04 21:45:16 +00:00
class LuaClass;
#include "MessageManager.h"
#include "Tween.h"
2006-09-21 02:35:30 +00:00
typedef AutoPtrCopyOnWrite<LuaReference> apActorCommands;
2001-11-03 10:52:42 +00:00
2006-01-20 08:54:46 +00:00
#define DRAW_ORDER_BEFORE_EVERYTHING -200
#define DRAW_ORDER_UNDERLAY -100
2005-02-25 01:51:40 +00:00
// normal screen elements go here
2006-01-20 08:54:46 +00:00
#define DRAW_ORDER_OVERLAY +100
2005-02-25 01:51:40 +00:00
#define DRAW_ORDER_TRANSITIONS +110
#define DRAW_ORDER_AFTER_EVERYTHING +200
2004-05-02 03:01:27 +00:00
2006-09-26 19:50:53 +00:00
enum HorizAlign
{
HorizAlign_Left,
HorizAlign_Center,
HorizAlign_Right,
NUM_HorizAlign,
HorizAlign_Invalid
};
2006-09-26 20:00:27 +00:00
LuaDeclareType( HorizAlign );
2006-09-26 19:50:53 +00:00
enum VertAlign
{
VertAlign_Top,
VertAlign_Middle,
VertAlign_Bottom,
NUM_VertAlign,
VertAlign_Invalid
};
2006-09-26 20:00:27 +00:00
LuaDeclareType( VertAlign );
#define align_left 0.0f
#define align_center 0.5f
#define align_right 1.0f
#define align_top 0.0f
#define align_middle 0.5f
#define align_bottom 1.0f
2006-09-26 19:50:53 +00:00
class Actor : public MessageSubscriber
2001-11-03 10:52:42 +00:00
{
public:
Actor();
Actor( const Actor &cpy );
virtual ~Actor();
2005-07-18 22:00:19 +00:00
virtual Actor *Copy() const;
2006-05-30 09:08:00 +00:00
virtual void InitState();
virtual void LoadFromNode( const XNode* pNode );
2002-01-16 10:01:32 +00:00
2005-04-28 23:55:47 +00:00
static void SetBGMTime( float fTime, float fBeat );
2005-04-29 00:07:33 +00:00
static void SetBGMLight( int iLightNumber, float fCabinetLights );
2004-07-07 21:17:47 +00:00
enum Effect { no_effect,
2006-01-20 08:54:46 +00:00
diffuse_blink, diffuse_shift, diffuse_ramp,
glow_blink, glow_shift,
rainbow,
wag, bounce, bob, pulse,
spin, vibrate
};
2001-11-03 10:52:42 +00:00
2002-01-16 10:01:32 +00:00
struct TweenState
{
void Init();
static void MakeWeightedAverage( TweenState& average_out, const TweenState& ts1, const TweenState& ts2, float fPercentBetween );
bool operator==( const TweenState &other ) const;
bool operator!=( const TweenState &other ) const { return !operator==(other); }
2002-01-16 10:01:32 +00:00
// start and end position for tweening
2006-01-20 08:54:46 +00:00
RageVector3 pos;
RageVector3 rotation;
RageVector4 quat;
RageVector3 scale;
2005-05-02 21:43:27 +00:00
float fSkewX;
RectF crop; // 0 = no cropping, 1 = fully cropped
2003-11-08 19:23:40 +00:00
RectF fade; // 0 = no fade
2006-01-20 08:54:46 +00:00
RageColor diffuse[4];
RageColor glow;
2005-05-03 20:27:50 +00:00
float aux;
};
2005-04-28 23:55:47 +00:00
enum EffectClock
{
CLOCK_TIMER,
CLOCK_BGM_TIME,
CLOCK_BGM_BEAT,
CLOCK_LIGHT_1 = 1000,
CLOCK_LIGHT_LAST = 1100,
NUM_CLOCKS
};
2003-12-18 10:31:42 +00:00
void Draw(); // calls, EarlyAbortDraw, BeginDraw, DrawPrimitives, EndDraw
2005-08-25 00:57:53 +00:00
virtual bool EarlyAbortDraw() const { return false; } // return true to early abort drawing of this Actor
virtual void BeginDraw(); // pushes transform onto world matrix stack
2006-01-20 08:54:46 +00:00
virtual void SetGlobalRenderStates(); // Actor should call this at beginning of their DrawPrimitives()
virtual void SetTextureRenderStates(); // Actor should call this after setting a texture
virtual void DrawPrimitives() {}; // Derivatives should override
virtual void EndDraw(); // pops transform from world matrix stack
// TODO: make Update non virtual and change all classes to override UpdateInternal
// instead.
2004-12-27 22:30:51 +00:00
bool IsFirstUpdate() const;
virtual void Update( float fDeltaTime ); // this can short circuit UpdateInternal
virtual void UpdateInternal( float fDeltaTime ); // override this
void UpdateTweening( float fDeltaTime );
2003-04-12 06:16:12 +00:00
2006-01-22 01:00:06 +00:00
const RString &GetName() const { return m_sName; }
virtual void SetName( const RString &sName ) { m_sName = sName; }
2006-08-15 19:34:41 +00:00
void SetParent( Actor *pParent );
2006-08-17 06:42:54 +00:00
Actor *GetParent() { return m_pParent; }
2003-04-12 06:16:12 +00:00
float GetX() const { return m_current.pos.x; };
float GetY() const { return m_current.pos.y; };
float GetZ() const { return m_current.pos.z; };
2006-01-15 07:12:05 +00:00
float GetDestX() const { return DestTweenState().pos.x; };
float GetDestY() const { return DestTweenState().pos.y; };
float GetDestZ() const { return DestTweenState().pos.z; };
2006-01-20 08:54:46 +00:00
void SetX( float x ) { DestTweenState().pos.x = x; };
void SetY( float y ) { DestTweenState().pos.y = y; };
void SetZ( float z ) { DestTweenState().pos.z = z; };
void SetXY( float x, float y ) { DestTweenState().pos.x = x; DestTweenState().pos.y = y; };
void AddX( float x ) { SetX( GetDestX()+x ); }
void AddY( float y ) { SetY( GetDestY()+y ); }
void AddZ( float z ) { SetZ( GetDestZ()+z ); }
2003-03-02 01:43:33 +00:00
// height and width vary depending on zoom
2006-01-20 08:54:46 +00:00
float GetUnzoomedWidth() const { return m_size.x; }
float GetUnzoomedHeight() const { return m_size.y; }
float GetZoomedWidth() const { return m_size.x * m_baseScale.x * DestTweenState().scale.x; }
float GetZoomedHeight() const { return m_size.y * m_baseScale.y * DestTweenState().scale.y; }
void SetWidth( float width ) { m_size.x = width; }
void SetHeight( float height ) { m_size.y = height; }
2003-03-02 01:43:33 +00:00
2005-04-30 07:48:10 +00:00
// Base
2006-01-20 08:54:46 +00:00
float GetBaseZoomX() const { return m_baseScale.x; }
void SetBaseZoomX( float zoom ) { m_baseScale.x = zoom; }
void SetBaseZoomY( float zoom ) { m_baseScale.y = zoom; }
void SetBaseZoomZ( float zoom ) { m_baseScale.z = zoom; }
void SetBaseZoom( const RageVector3 &zoom ) { m_baseScale = zoom; }
void SetBaseRotationX( float rot ) { m_baseRotation.x = rot; }
void SetBaseRotationY( float rot ) { m_baseRotation.y = rot; }
void SetBaseRotationZ( float rot ) { m_baseRotation.z = rot; }
2004-10-16 16:59:17 +00:00
void SetBaseRotation( const RageVector3 &rot ) { m_baseRotation = rot; }
2005-04-30 07:48:10 +00:00
virtual void SetBaseAlpha( float fAlpha ) { m_fBaseAlpha = fAlpha; }
2006-01-20 08:54:46 +00:00
float GetZoom() const { return DestTweenState().scale.x; } // not accurate in some cases
float GetZoomX() const { return DestTweenState().scale.x; }
float GetZoomY() const { return DestTweenState().scale.y; }
float GetZoomZ() const { return DestTweenState().scale.z; }
void SetZoom( float zoom ) { DestTweenState().scale.x = zoom; DestTweenState().scale.y = zoom; DestTweenState().scale.z = zoom; }
void SetZoomX( float zoom ) { DestTweenState().scale.x = zoom; }
void SetZoomY( float zoom ) { DestTweenState().scale.y = zoom; }
void SetZoomZ( float zoom ) { DestTweenState().scale.z = zoom; }
void ZoomTo( float fX, float fY ) { ZoomToWidth(fX); ZoomToHeight(fY); }
void ZoomToWidth( float zoom ) { SetZoomX( zoom / GetUnzoomedWidth() ); }
void ZoomToHeight( float zoom ) { SetZoomY( zoom / GetUnzoomedHeight() ); }
2003-03-02 01:43:33 +00:00
2006-01-20 08:54:46 +00:00
float GetRotationX() const { return DestTweenState().rotation.x; }
float GetRotationY() const { return DestTweenState().rotation.y; }
float GetRotationZ() const { return DestTweenState().rotation.z; }
void SetRotationX( float rot ) { DestTweenState().rotation.x = rot; }
void SetRotationY( float rot ) { DestTweenState().rotation.y = rot; }
void SetRotationZ( float rot ) { DestTweenState().rotation.z = rot; }
void AddRotationH( float rot );
void AddRotationP( float rot );
void AddRotationR( float rot );
2003-03-02 01:43:33 +00:00
2006-01-20 08:54:46 +00:00
void SetSkewX( float fAmount ) { DestTweenState().fSkewX = fAmount; }
float GetSkewX( float fAmount ) const { return DestTweenState().fSkewX; }
2005-05-02 21:43:27 +00:00
2006-01-20 08:54:46 +00:00
float GetCropLeft() const { return DestTweenState().crop.left; }
float GetCropTop() const { return DestTweenState().crop.top; }
float GetCropRight() const { return DestTweenState().crop.right; }
float GetCropBottom() const { return DestTweenState().crop.bottom; }
void SetCropLeft( float percent ) { DestTweenState().crop.left = percent; }
void SetCropTop( float percent ) { DestTweenState().crop.top = percent; }
void SetCropRight( float percent ) { DestTweenState().crop.right = percent;}
void SetCropBottom( float percent ) { DestTweenState().crop.bottom = percent;}
2006-01-20 08:54:46 +00:00
void SetFadeLeft( float percent ) { DestTweenState().fade.left = percent; }
void SetFadeTop( float percent ) { DestTweenState().fade.top = percent; }
void SetFadeRight( float percent ) { DestTweenState().fade.right = percent;}
void SetFadeBottom( float percent ) { DestTweenState().fade.bottom = percent;}
void SetGlobalDiffuseColor( RageColor c );
2006-01-20 08:54:46 +00:00
virtual void SetDiffuse( RageColor c ) { for(int i=0; i<4; i++) DestTweenState().diffuse[i] = c; };
virtual void SetDiffuseAlpha( float f ) { for(int i = 0; i < 4; ++i) { RageColor c = GetDiffuses( i ); c.a = f; SetDiffuses( i, c ); } }
2006-02-27 03:06:43 +00:00
float GetCurrentDiffuseAlpha() const { return m_current.diffuse[0].a; }
void SetDiffuseColor( RageColor c );
void SetDiffuses( int i, RageColor c ) { DestTweenState().diffuse[i] = c; };
void SetDiffuseUpperLeft( RageColor c ) { DestTweenState().diffuse[0] = c; };
void SetDiffuseUpperRight( RageColor c ) { DestTweenState().diffuse[1] = c; };
void SetDiffuseLowerLeft( RageColor c ) { DestTweenState().diffuse[2] = c; };
void SetDiffuseLowerRight( RageColor c ) { DestTweenState().diffuse[3] = c; };
void SetDiffuseTopEdge( RageColor c ) { DestTweenState().diffuse[0] = DestTweenState().diffuse[1] = c; };
void SetDiffuseRightEdge( RageColor c ) { DestTweenState().diffuse[1] = DestTweenState().diffuse[3] = c; };
void SetDiffuseBottomEdge( RageColor c ) { DestTweenState().diffuse[2] = DestTweenState().diffuse[3] = c; };
void SetDiffuseLeftEdge( RageColor c ) { DestTweenState().diffuse[0] = DestTweenState().diffuse[2] = c; };
2006-01-20 08:54:46 +00:00
RageColor GetDiffuse() const { return DestTweenState().diffuse[0]; };
RageColor GetDiffuses( int i ) const { return DestTweenState().diffuse[i]; };
float GetDiffuseAlpha() const { return DestTweenState().diffuse[0].a; };
void SetGlow( RageColor c ) { DestTweenState().glow = c; };
RageColor GetGlow() const { return DestTweenState().glow; };
2003-03-02 01:43:33 +00:00
2006-01-20 08:54:46 +00:00
void SetAux( float f ) { DestTweenState().aux = f; }
float GetAux() const { return m_current.aux; }
2003-03-02 01:43:33 +00:00
void BeginTweening( float time, ITween *pInterp );
void BeginTweening( float time, TweenType tt = TWEEN_LINEAR );
void StopTweening();
2004-04-24 18:38:18 +00:00
void Sleep( float time );
2006-01-22 01:00:06 +00:00
void QueueCommand( const RString& sCommandName );
void QueueMessage( const RString& sMessageName );
virtual void FinishTweening();
virtual void HurryTweening( float factor );
// Let ActorFrame and BGAnimation override
2003-03-02 01:43:33 +00:00
virtual float GetTweenTimeLeft() const; // Amount of time until all tweens have stopped
2006-01-15 07:12:05 +00:00
TweenState& DestTweenState() // where Actor will end when its tween finish
2003-03-02 01:43:33 +00:00
{
if( m_Tweens.empty() ) // not tweening
2003-03-02 01:43:33 +00:00
return m_current;
else
return m_Tweens.back()->state;
2003-03-02 01:43:33 +00:00
}
2006-01-15 07:12:05 +00:00
const TweenState& DestTweenState() const { return const_cast<Actor*>(this)->DestTweenState(); }
2003-03-02 01:43:33 +00:00
enum StretchType { fit_inside, cover };
2004-09-22 02:20:50 +00:00
void ScaleToCover( const RectF &rect ) { ScaleTo( rect, cover ); }
void ScaleToFitInside( const RectF &rect ) { ScaleTo( rect, fit_inside); };
void ScaleTo( const RectF &rect, StretchType st );
2003-03-02 01:43:33 +00:00
void StretchTo( const RectF &rect );
//
// Alignment settings. These need to be virtual for BitmapText
//
2007-03-01 08:14:33 +00:00
virtual void SetHorizAlign( float f ) { m_fHorizAlign = f; }
virtual void SetVertAlign( float f ) { m_fVertAlign = f; }
void SetHorizAlign( HorizAlign ha ) { SetHorizAlign( (ha == HorizAlign_Left)? 0.0f: (ha == HorizAlign_Center)? 0.5f: +1.0f ); }
void SetVertAlign( VertAlign va ) { SetVertAlign( (va == VertAlign_Top)? 0.0f: (va == VertAlign_Middle)? 0.5f: +1.0f ); }
2003-03-02 01:43:33 +00:00
//
2003-03-02 01:43:33 +00:00
// effects
//
2006-01-20 08:54:46 +00:00
void StopEffect() { m_Effect = no_effect; }
Effect GetEffect() const { return m_Effect; }
float GetSecsIntoEffect() const { return m_fSecsIntoEffect; }
float GetEffectDelta() const { return m_fEffectDelta; }
2005-04-28 11:24:14 +00:00
2006-01-20 08:54:46 +00:00
void SetEffectColor1( RageColor c ) { m_effectColor1 = c; }
void SetEffectColor2( RageColor c ) { m_effectColor2 = c; }
void SetEffectPeriod( float fTime );
float GetEffectPeriod();
void SetEffectTiming( float fRampUp, float fAtHalf, float fRampDown, float fAtZero );
2006-01-20 08:54:46 +00:00
void SetEffectOffset( float fTime ) { m_fEffectOffset = fTime; }
2003-12-18 10:31:42 +00:00
void SetEffectClock( EffectClock c ) { m_EffectClock = c; }
2006-01-22 01:00:06 +00:00
void SetEffectClockString( const RString &s ); // convenience
2003-12-18 10:31:42 +00:00
2003-03-02 01:43:33 +00:00
void SetEffectMagnitude( RageVector3 vec ) { m_vEffectMagnitude = vec; }
2005-05-03 20:27:50 +00:00
RageVector3 GetEffectMagnitude() const { return m_vEffectMagnitude; }
2003-03-02 01:43:33 +00:00
void SetEffectDiffuseBlink(
float fEffectPeriodSeconds = 1.0f,
RageColor c1 = RageColor(0.5f,0.5f,0.5f,1),
RageColor c2 = RageColor(1,1,1,1) );
void SetEffectDiffuseShift( float fEffectPeriodSeconds = 1.f,
RageColor c1 = RageColor(0,0,0,1),
RageColor c2 = RageColor(1,1,1,1) );
2005-03-21 10:49:51 +00:00
void SetEffectDiffuseRamp( float fEffectPeriodSeconds = 1.f,
RageColor c1 = RageColor(0,0,0,1),
RageColor c2 = RageColor(1,1,1,1) );
2003-03-02 01:43:33 +00:00
void SetEffectGlowBlink( float fEffectPeriodSeconds = 1.f,
RageColor c1 = RageColor(1,1,1,0.2f),
RageColor c2 = RageColor(1,1,1,0.8f) );
void SetEffectGlowShift(
float fEffectPeriodSeconds = 1.0f,
RageColor c1 = RageColor(1,1,1,0.2f),
RageColor c2 = RageColor(1,1,1,0.8f) );
2003-03-05 02:52:40 +00:00
void SetEffectRainbow(
float fEffectPeriodSeconds = 2.0f );
2003-03-02 01:43:33 +00:00
void SetEffectWag(
float fPeriod = 2.f,
2004-01-23 08:26:02 +00:00
RageVector3 vect = RageVector3(0,0,20) );
2003-03-02 01:43:33 +00:00
void SetEffectBounce(
float fPeriod = 2.f,
2005-08-29 15:27:18 +00:00
RageVector3 vect = RageVector3(0,20,0) );
2003-03-02 01:43:33 +00:00
void SetEffectBob(
float fPeriod = 2.f,
2005-08-29 15:27:18 +00:00
RageVector3 vect = RageVector3(0,20,0) );
2003-03-05 02:52:40 +00:00
void SetEffectPulse(
float fPeriod = 2.f,
float fMinZoom = 0.5f,
float fMaxZoom = 1.f );
2006-01-20 08:54:46 +00:00
void SetEffectSpin( RageVector3 vect = RageVector3(0,0,180) );
void SetEffectVibrate( RageVector3 vect = RageVector3(10,10,10) );
2003-03-02 01:43:33 +00:00
//
// other properties
//
bool GetVisible() const { return m_bVisible; }
void SetVisible( bool b ) { m_bVisible = b; }
2006-07-29 06:18:09 +00:00
void SetShadowLength( float fLength ) { m_fShadowLength = fLength; }
// TODO: Implement hibernate as a tween type?
2006-01-20 08:54:46 +00:00
void SetHibernate( float fSecs ) { m_fHibernateSecondsLeft = fSecs; }
void SetDrawOrder( int iOrder ) { m_iDrawOrder = iOrder; }
2004-05-02 03:01:27 +00:00
int GetDrawOrder() const { return m_iDrawOrder; }
2003-03-02 01:43:33 +00:00
virtual void EnableAnimation( bool b ) { m_bIsAnimating = b; } // Sprite needs to overload this
2006-07-29 06:18:09 +00:00
void StartAnimating() { this->EnableAnimation(true); }
void StopAnimating() { this->EnableAnimation(false); }
2003-03-02 01:43:33 +00:00
//
// render states
//
2006-01-20 08:54:46 +00:00
void SetBlendMode( BlendMode mode ) { m_BlendMode = mode; }
void SetTextureWrapping( bool b ) { m_bTextureWrapping = b; }
2007-03-24 00:39:19 +00:00
void SetTextureFiltering( bool b ) { m_bTextureFiltering = b; }
2006-01-20 08:54:46 +00:00
void SetClearZBuffer( bool b ) { m_bClearZBuffer = b; }
void SetUseZBuffer( bool b ) { SetZTestMode(b?ZTEST_WRITE_ON_PASS:ZTEST_OFF); SetZWrite(b); }
virtual void SetZTestMode( ZTestMode mode ) { m_ZTestMode = mode; }
virtual void SetZWrite( bool b ) { m_bZWrite = b; }
void SetZBias( float f ) { m_fZBias = f; }
virtual void SetCullMode( CullMode mode ) { m_CullMode = mode; }
2003-03-02 01:43:33 +00:00
//
2005-06-21 05:23:25 +00:00
// Lua
2003-03-02 01:43:33 +00:00
//
2005-01-26 11:21:43 +00:00
virtual void PushSelf( lua_State *L );
2006-08-09 23:22:54 +00:00
virtual void PushContext( lua_State *L );
2005-06-21 05:23:25 +00:00
//
// Named commands
2005-06-21 05:23:25 +00:00
//
2006-01-22 01:00:06 +00:00
void AddCommand( const RString &sCmdName, apActorCommands apac );
bool HasCommand( const RString &sCmdName );
const apActorCommands *GetCommand( const RString &sCommandName ) const;
void PlayCommand( const RString &sCommandName ) { HandleMessage( Message(sCommandName) ); } // convenience
2007-02-22 00:38:05 +00:00
void PlayCommandNoRecurse( const Message &msg );
//
// Commands by reference
//
virtual void RunCommands( const LuaReference& cmds, const LuaReference *pParamTable = NULL );
void RunCommands( const apActorCommands& cmds, const LuaReference *pParamTable = NULL ) { this->RunCommands( *cmds, pParamTable ); } // convenience
virtual void RunCommandsRecursively( const LuaReference& cmds, const LuaReference *pParamTable = NULL ) { RunCommands(cmds, pParamTable); }
// If we're a leaf, then execute this command.
virtual void RunCommandsOnLeaves( const LuaReference& cmds, const LuaReference *pParamTable = NULL ) { RunCommands(cmds, pParamTable); }
2005-01-26 11:21:43 +00:00
//
// Messages
//
2006-11-13 23:11:25 +00:00
virtual void HandleMessage( const Message &msg );
//
// Animation
//
virtual int GetNumStates() const { return 1; }
virtual void SetState( int iNewState ) {}
virtual float GetAnimationLengthSeconds() const { return 0; }
virtual void SetSecondsIntoAnimation( float fSeconds ) {}
virtual void SetUpdateRate( float fRate ) {}
2004-02-01 03:14:37 +00:00
HiddenPtr<LuaClass> m_pLuaInstance;
2003-01-16 05:07:54 +00:00
protected:
2006-01-22 01:00:06 +00:00
RString m_sName;
2006-08-15 19:02:31 +00:00
Actor *m_pParent;
2003-01-16 05:07:54 +00:00
struct TweenInfo
{
2002-01-16 10:01:32 +00:00
// counters for tweening
TweenInfo();
~TweenInfo();
TweenInfo( const TweenInfo &cpy );
TweenInfo &operator=( const TweenInfo &rhs );
ITween *m_pTween;
2002-01-16 10:01:32 +00:00
float m_fTimeLeftInTween; // how far into the tween are we?
float m_fTweenTime; // seconds between Start and End positions/zooms
2006-01-22 01:00:06 +00:00
RString m_sCommandName; // command to execute when this TweenState goes into effect
2002-01-16 10:01:32 +00:00
};
RageVector3 m_baseRotation;
RageVector3 m_baseScale;
2005-04-30 07:48:10 +00:00
float m_fBaseAlpha;
RageVector2 m_size;
TweenState m_current;
TweenState m_start;
2005-01-16 04:35:47 +00:00
struct TweenStateAndInfo
{
TweenState state;
TweenInfo info;
};
vector<TweenStateAndInfo *> m_Tweens;
//
// Temporary variables that are filled just before drawing
//
2003-10-07 04:26:14 +00:00
TweenState *m_pTempState;
2003-01-16 05:07:54 +00:00
bool m_bFirstUpdate;
//
// Stuff for alignment
//
float m_fHorizAlign; /* 0.0 left 0.5 center 1.0 right */
float m_fVertAlign; /* 0.0 top 0.5 center 1.0 bottom */
2002-01-16 10:01:32 +00:00
2001-11-03 10:52:42 +00:00
//
// Stuff for effects
//
2001-11-28 20:26:45 +00:00
Effect m_Effect;
2006-07-29 06:18:09 +00:00
float m_fSecsIntoEffect;
float m_fEffectDelta;
// units depend on m_EffectClock
float m_fEffectRampUp;
float m_fEffectHoldAtHalf;
float m_fEffectRampDown;
float m_fEffectHoldAtZero;
2004-01-20 23:25:38 +00:00
float m_fEffectOffset;
2003-12-18 10:31:42 +00:00
EffectClock m_EffectClock;
2004-10-18 04:19:20 +00:00
/* This can be used in lieu of the fDeltaTime parameter to Update() to
* follow the effect clock. Actor::Update must be called first. */
2006-01-20 08:54:46 +00:00
float GetEffectDeltaTime() const { return m_fEffectDelta; }
2004-10-18 04:19:20 +00:00
2006-01-20 08:54:46 +00:00
RageColor m_effectColor1;
RageColor m_effectColor2;
RageVector3 m_vEffectMagnitude;
2002-01-16 10:01:32 +00:00
//
// other properties
//
2006-01-20 08:54:46 +00:00
bool m_bVisible;
2006-07-29 06:18:09 +00:00
bool m_bIsAnimating;
2006-01-20 08:54:46 +00:00
float m_fHibernateSecondsLeft;
float m_fShadowLength; // 0 == no shadow
2006-07-29 06:18:09 +00:00
int m_iDrawOrder; // lower first
//
// render states
//
BlendMode m_BlendMode;
2004-05-15 09:26:21 +00:00
ZTestMode m_ZTestMode;
2006-07-29 06:18:09 +00:00
CullMode m_CullMode;
bool m_bTextureWrapping;
2007-03-24 00:39:19 +00:00
bool m_bTextureFiltering;
2006-07-29 06:18:09 +00:00
bool m_bClearZBuffer;
2004-05-15 09:26:21 +00:00
bool m_bZWrite;
float m_fZBias; // 0 = no bias; 1 = full bias
2004-10-15 22:10:27 +00:00
//
// global state
//
static float g_fCurrentBGMTime, g_fCurrentBGMBeat;
2005-01-04 10:41:32 +00:00
2005-04-28 23:55:47 +00:00
private:
2005-01-04 10:41:32 +00:00
//
// commands
//
2006-01-22 01:00:06 +00:00
map<RString, apActorCommands> m_mapNameToCommands;
2001-11-03 10:52:42 +00:00
};
2002-11-16 08:08:46 +00:00
#endif
2004-06-08 00:47:53 +00:00
/*
* (c) 2001-2004 Chris Danford
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons to
* whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/