Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

ActorFrame.h

Go to the documentation of this file.
00001 /* ActorFrame - A container for other actors. */ 00002 00003 #ifndef ACTORFRAME_H 00004 #define ACTORFRAME_H 00005 00006 #include "Actor.h" 00007 00008 #define LUA_ActorFrame_METHODS( T ) \ 00009 LUA_Actor_METHODS( T ) \ 00010 static int propagate( T* p, lua_State *L ) { p->SetPropagateCommands( BArg(1) ); return 0; } \ 00011 00012 #define LUA_ActorFrame_METHODS_MAP( T ) \ 00013 LUA_Actor_METHODS_MAP( T ) \ 00014 LUA_METHOD_MAP( T, propagate ) \ 00015 00016 class ActorFrame : public Actor 00017 { 00018 public: 00019 ActorFrame(); 00020 virtual ~ActorFrame(); 00021 00022 void LoadFromNode( const CString& sDir, const XNode* pNode ); 00023 00024 virtual void AddChild( Actor* pActor ); 00025 virtual void RemoveChild( Actor* pActor ); 00026 void MoveToTail( Actor* pActor ); 00027 void MoveToHead( Actor* pActor ); 00028 void SortByDrawOrder(); 00029 00030 void DeleteChildrenWhenDone( bool bDelete=true ) { m_bDeleteChildren = bDelete; } 00031 void DeleteAllChildren(); 00032 00033 // 00034 // Commands 00035 // 00036 void PushSelf( lua_State *L ); 00037 void RunCommandsOnChildren( const ActorCommands& cmds ); /* but not on self */ 00038 void RunCommandsOnChildren( const apActorCommands& cmds ) { RunCommandsOnChildren( *cmds ); } // convenience 00039 00040 virtual void Update( float fDeltaTime ); 00041 virtual void DrawPrimitives(); 00042 00043 virtual void SetDiffuse( RageColor c ); 00044 virtual void SetDiffuseAlpha( float f ); 00045 00046 virtual void SetZTestMode( ZTestMode mode ); 00047 virtual void SetZWrite( bool b ); 00048 virtual void FinishTweening(); 00049 virtual void HurryTweening( float factor ); 00050 00051 void SetPropagateCommands( bool b ); 00052 00053 /* Amount of time until all tweens (and all children's tweens) have stopped: */ 00054 virtual float GetTweenTimeLeft() const; 00055 00056 virtual void GainFocus( float fRate, bool bRewindMovie, bool bLoop ); 00057 virtual void LoseFocus(); 00058 virtual void PlayCommand( const CString &sCommandName ); 00059 virtual void RunCommands( const ActorCommands& cmds ); 00060 void RunCommands( const apActorCommands& cmds ) { ActorFrame::RunCommands( *cmds ); } // convenience 00061 00062 protected: 00063 vector<Actor*> m_SubActors; 00064 bool m_bPropagateCommands; 00065 bool m_bDeleteChildren; 00066 }; 00067 00068 #endif 00069 00070 /* 00071 * (c) 2001-2004 Chris Danford 00072 * All rights reserved. 00073 * 00074 * Permission is hereby granted, free of charge, to any person obtaining a 00075 * copy of this software and associated documentation files (the 00076 * "Software"), to deal in the Software without restriction, including 00077 * without limitation the rights to use, copy, modify, merge, publish, 00078 * distribute, and/or sell copies of the Software, and to permit persons to 00079 * whom the Software is furnished to do so, provided that the above 00080 * copyright notice(s) and this permission notice appear in all copies of 00081 * the Software and that both the above copyright notice(s) and this 00082 * permission notice appear in supporting documentation. 00083 * 00084 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00085 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00086 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00087 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00088 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00089 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00090 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00091 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00092 * PERFORMANCE OF THIS SOFTWARE. 00093 */

Generated on Thu Jan 27 20:57:17 2005 for StepMania by doxygen 1.3.7