Actor::RunCommands, etc. can take any LuaReference, not just
ActorCommands
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include "Command.h"
|
||||
#include "ActorCommands.h"
|
||||
#include "ThemeManager.h"
|
||||
#include "LuaReference.h"
|
||||
|
||||
|
||||
// lua start
|
||||
@@ -692,7 +693,7 @@ void Actor::AddRotationR( float rot )
|
||||
RageQuatMultiply( &DestTweenState().quat, DestTweenState().quat, RageQuatFromR(rot) );
|
||||
}
|
||||
|
||||
void Actor::RunCommands( const ActorCommands& cmds )
|
||||
void Actor::RunCommands( const LuaReference& cmds )
|
||||
{
|
||||
cmds.PushSelf( LUA->L );
|
||||
ASSERT( !lua_isnil(LUA->L, -1) );
|
||||
@@ -843,7 +844,7 @@ void Actor::HandleCommand( const Command &command )
|
||||
}
|
||||
*/
|
||||
|
||||
float Actor::GetCommandsLengthSeconds( const ActorCommands& cmds )
|
||||
float Actor::GetCommandsLengthSeconds( const LuaReference& cmds )
|
||||
{
|
||||
Actor temp;
|
||||
temp.RunCommands(cmds);
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <map>
|
||||
struct XNode;
|
||||
struct lua_State;
|
||||
class LuaReference;
|
||||
#include "LuaBinding.h"
|
||||
|
||||
|
||||
@@ -310,10 +311,10 @@ public:
|
||||
virtual void PushSelf( lua_State *L );
|
||||
void AddCommand( const CString &sCmdName, apActorCommands apac );
|
||||
virtual void PlayCommand( const CString &sCommandName );
|
||||
virtual void RunCommands( const ActorCommands& cmds );
|
||||
virtual void RunCommands( const LuaReference& cmds );
|
||||
void RunCommands( const apActorCommands& cmds ) { this->RunCommands( *cmds ); } // convenience
|
||||
|
||||
static float GetCommandsLengthSeconds( const ActorCommands& cmds );
|
||||
static float GetCommandsLengthSeconds( const LuaReference& cmds );
|
||||
static float GetCommandsLengthSeconds( const apActorCommands& cmds ) { return GetCommandsLengthSeconds( *cmds ); } // convenience
|
||||
|
||||
//
|
||||
|
||||
@@ -101,7 +101,7 @@ void ActorFrame::DrawPrimitives()
|
||||
m_SubActors[i]->Draw();
|
||||
}
|
||||
|
||||
void ActorFrame::RunCommandsOnChildren( const ActorCommands& cmds )
|
||||
void ActorFrame::RunCommandsOnChildren( const LuaReference& cmds )
|
||||
{
|
||||
for( unsigned i=0; i<m_SubActors.size(); i++ )
|
||||
m_SubActors[i]->RunCommands( cmds );
|
||||
@@ -185,7 +185,7 @@ void ActorFrame::DeleteAllChildren()
|
||||
m_SubActors.clear();
|
||||
}
|
||||
|
||||
void ActorFrame::RunCommands( const ActorCommands& cmds )
|
||||
void ActorFrame::RunCommands( const LuaReference& cmds )
|
||||
{
|
||||
if( m_bPropagateCommands )
|
||||
RunCommandsOnChildren( cmds );
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
// Commands
|
||||
//
|
||||
void PushSelf( lua_State *L );
|
||||
void RunCommandsOnChildren( const ActorCommands& cmds ); /* but not on self */
|
||||
void RunCommandsOnChildren( const LuaReference& cmds ); /* but not on self */
|
||||
void RunCommandsOnChildren( const apActorCommands& cmds ) { RunCommandsOnChildren( *cmds ); } // convenience
|
||||
|
||||
virtual void Update( float fDeltaTime );
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
virtual void GainFocus( float fRate, bool bRewindMovie, bool bLoop );
|
||||
virtual void LoseFocus();
|
||||
virtual void PlayCommand( const CString &sCommandName );
|
||||
virtual void RunCommands( const ActorCommands& cmds );
|
||||
virtual void RunCommands( const LuaReference& cmds );
|
||||
void RunCommands( const apActorCommands& cmds ) { ActorFrame::RunCommands( *cmds ); } // convenience
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user