2004-06-08 00:47:53 +00:00
|
|
|
/* ActorFrame - A container for other actors. */
|
|
|
|
|
|
2002-10-28 05:30:45 +00:00
|
|
|
#ifndef ACTORFRAME_H
|
|
|
|
|
#define ACTORFRAME_H
|
2001-12-11 11:44:26 +00:00
|
|
|
|
|
|
|
|
#include "Actor.h"
|
|
|
|
|
|
2002-01-16 10:01:32 +00:00
|
|
|
class ActorFrame : public Actor
|
2001-12-11 11:44:26 +00:00
|
|
|
{
|
|
|
|
|
public:
|
2004-10-16 02:46:10 +00:00
|
|
|
ActorFrame();
|
2005-07-18 22:59:34 +00:00
|
|
|
ActorFrame( const ActorFrame &cpy );
|
2005-01-15 20:32:35 +00:00
|
|
|
virtual ~ActorFrame();
|
2005-01-16 23:40:21 +00:00
|
|
|
|
2005-01-17 05:28:16 +00:00
|
|
|
void LoadFromNode( const CString& sDir, const XNode* pNode );
|
2005-07-18 22:00:19 +00:00
|
|
|
virtual Actor *Copy() const;
|
2005-01-16 23:40:21 +00:00
|
|
|
|
2003-01-11 08:55:21 +00:00
|
|
|
virtual void AddChild( Actor* pActor );
|
2004-05-02 03:01:27 +00:00
|
|
|
virtual void RemoveChild( Actor* pActor );
|
2005-03-01 21:55:47 +00:00
|
|
|
Actor* GetChild( const CString &sName );
|
2005-03-31 12:57:21 +00:00
|
|
|
int GetNumChildren() const { return m_SubActors.size(); }
|
2005-03-01 21:55:47 +00:00
|
|
|
|
2005-02-20 10:12:50 +00:00
|
|
|
void RemoveAllChildren();
|
2005-01-26 11:21:43 +00:00
|
|
|
void MoveToTail( Actor* pActor );
|
|
|
|
|
void MoveToHead( Actor* pActor );
|
|
|
|
|
void SortByDrawOrder();
|
2005-05-03 09:29:54 +00:00
|
|
|
void SetDrawByZPosition( bool b );
|
2003-01-21 20:44:09 +00:00
|
|
|
|
2005-10-07 02:55:47 +00:00
|
|
|
virtual bool AutoLoadChildren() const { return false; } // derived classes override to automatically LoadChildrenFromNode
|
2005-01-15 20:32:35 +00:00
|
|
|
void DeleteChildrenWhenDone( bool bDelete=true ) { m_bDeleteChildren = bDelete; }
|
2004-01-17 23:14:56 +00:00
|
|
|
void DeleteAllChildren();
|
2001-12-11 11:44:26 +00:00
|
|
|
|
2005-01-26 11:21:43 +00:00
|
|
|
//
|
|
|
|
|
// Commands
|
|
|
|
|
//
|
2005-06-25 05:06:38 +00:00
|
|
|
virtual void PushSelf( lua_State *L );
|
2005-05-29 01:00:05 +00:00
|
|
|
virtual void RunCommandsOnChildren( const LuaReference& cmds ); /* but not on self */
|
2005-06-12 00:35:08 +00:00
|
|
|
void RunCommandsOnChildren( const apActorCommands& cmds ) { this->RunCommandsOnChildren( *cmds ); } // convenience
|
|
|
|
|
virtual void RunCommandsOnLeaves( const LuaReference& cmds, Actor* pParent ); /* but not on self */
|
2004-01-11 07:12:13 +00:00
|
|
|
|
2005-06-11 10:32:58 +00:00
|
|
|
virtual void UpdateInternal( float fDeltaTime );
|
2005-07-12 03:09:34 +00:00
|
|
|
virtual void ProcessMessages( float fDeltaTime );
|
2002-05-19 01:59:48 +00:00
|
|
|
virtual void DrawPrimitives();
|
2001-12-11 11:44:26 +00:00
|
|
|
|
2005-05-29 01:00:05 +00:00
|
|
|
// propagated commands
|
2002-10-28 05:30:45 +00:00
|
|
|
virtual void SetDiffuse( RageColor c );
|
2004-01-11 05:33:24 +00:00
|
|
|
virtual void SetDiffuseAlpha( float f );
|
2005-04-30 07:48:10 +00:00
|
|
|
virtual void SetBaseAlpha( float f );
|
2004-05-15 09:26:21 +00:00
|
|
|
virtual void SetZTestMode( ZTestMode mode );
|
2003-11-18 20:33:18 +00:00
|
|
|
virtual void SetZWrite( bool b );
|
2003-07-20 01:32:42 +00:00
|
|
|
virtual void FinishTweening();
|
2003-11-18 17:50:50 +00:00
|
|
|
virtual void HurryTweening( float factor );
|
2005-03-18 18:57:05 +00:00
|
|
|
|
|
|
|
|
void SetUpdateRate( float fUpdateRate ) { m_fUpdateRate = fUpdateRate; }
|
2005-04-01 21:00:14 +00:00
|
|
|
void SetFOV( float fFOV ) { m_fFOV = fFOV; }
|
2005-05-20 21:11:02 +00:00
|
|
|
void SetVanishPoint( float fX, float fY) { m_fVanishX = fX; m_fVanishY = fY; }
|
2005-03-18 18:57:05 +00:00
|
|
|
|
2005-05-29 01:00:05 +00:00
|
|
|
virtual void SetPropagateCommands( bool b );
|
2005-01-26 11:21:43 +00:00
|
|
|
|
2003-01-01 09:05:21 +00:00
|
|
|
/* Amount of time until all tweens (and all children's tweens) have stopped: */
|
2003-03-02 01:43:33 +00:00
|
|
|
virtual float GetTweenTimeLeft() const;
|
2003-01-01 09:05:21 +00:00
|
|
|
|
2005-06-12 00:35:08 +00:00
|
|
|
virtual void PlayCommand( const CString &sCommandName, Actor* pParent = NULL );
|
|
|
|
|
virtual void RunCommands( const LuaReference& cmds, Actor* pParent = NULL );
|
|
|
|
|
void RunCommands( const apActorCommands& cmds, Actor *pParent = NULL ) { this->RunCommands( *cmds, pParent ); } // convenience
|
2004-02-01 03:14:37 +00:00
|
|
|
|
2002-09-02 21:59:58 +00:00
|
|
|
protected:
|
2005-10-07 02:55:47 +00:00
|
|
|
void LoadChildrenFromNode( const CString& sDir, const XNode* pNode );
|
|
|
|
|
|
2003-01-03 05:56:28 +00:00
|
|
|
vector<Actor*> m_SubActors;
|
2004-10-16 02:46:10 +00:00
|
|
|
bool m_bPropagateCommands;
|
2005-01-15 20:32:35 +00:00
|
|
|
bool m_bDeleteChildren;
|
2005-05-03 09:29:54 +00:00
|
|
|
bool m_bDrawByZPosition;
|
2005-02-28 04:14:25 +00:00
|
|
|
|
|
|
|
|
// state effects
|
|
|
|
|
float m_fUpdateRate;
|
|
|
|
|
float m_fFOV; // -1 = no change
|
2005-05-20 21:11:02 +00:00
|
|
|
float m_fVanishX;
|
|
|
|
|
float m_fVanishY;
|
2005-10-07 02:00:42 +00:00
|
|
|
bool m_bOverrideLighting; // if true, set lighting to m_bLighting
|
2005-02-28 04:14:25 +00:00
|
|
|
bool m_bLighting;
|
2001-12-11 11:44:26 +00:00
|
|
|
};
|
2002-10-28 05:30:45 +00:00
|
|
|
|
2005-03-01 16:59:29 +00:00
|
|
|
class ActorFrameAutoDeleteChildren : public ActorFrame
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
ActorFrameAutoDeleteChildren() { DeleteChildrenWhenDone(true); }
|
2005-10-07 02:55:47 +00:00
|
|
|
virtual bool AutoLoadChildren() const { return true; }
|
2005-07-18 22:00:19 +00:00
|
|
|
virtual Actor *Copy() const;
|
2005-03-01 16:59:29 +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.
|
|
|
|
|
*/
|