use Lua to execute commands

(needs cleanup)
This commit is contained in:
Chris Danford
2005-01-26 11:21:43 +00:00
parent 1f00c84293
commit 8555a6da45
60 changed files with 816 additions and 246 deletions
+31 -12
View File
@@ -4,6 +4,12 @@
#include "RageUtil.h"
#include "XmlFile.h"
#include "ActorUtil.h"
#include "LuaBinding.h"
#include "ActorCommands.h"
// lua start
LUA_REGISTER_CLASS( ActorFrame )
// lua end
ActorFrame::ActorFrame()
{
@@ -95,16 +101,10 @@ void ActorFrame::DrawPrimitives()
m_SubActors[i]->Draw();
}
void ActorFrame::RunCommandOnChildren( const Commands &cmd )
void ActorFrame::RunCommandsOnChildren( const ActorCommands& cmds )
{
for( unsigned i=0; i<m_SubActors.size(); i++ )
m_SubActors[i]->RunCommands( cmd );
}
void ActorFrame::RunCommandOnChildren( const Command &cmd )
{
for( unsigned i=0; i<m_SubActors.size(); i++ )
m_SubActors[i]->HandleCommand( cmd );
m_SubActors[i]->RunCommands( cmds );
}
void ActorFrame::Update( float fDeltaTime )
@@ -144,7 +144,6 @@ void ActorFrame::SetDiffuseAlpha( float f )
m_SubActors[i]->SetDiffuseAlpha( f );
}
void ActorFrame::FinishTweening()
{
Actor::FinishTweening();
@@ -186,6 +185,20 @@ void ActorFrame::DeleteAllChildren()
m_SubActors.clear();
}
void ActorFrame::RunCommands( const ActorCommands& cmds )
{
if( m_bPropagateCommands )
RunCommandsOnChildren( cmds );
else
Actor::RunCommands( cmds );
}
void ActorFrame::SetPropagateCommands( bool b )
{
m_bPropagateCommands = b;
}
/*
void ActorFrame::HandleCommand( const Command &command )
{
BeginHandleArgs;
@@ -206,12 +219,13 @@ void ActorFrame::HandleCommand( const Command &command )
EndHandleArgs;
} while(0);
/* By default, don't propograte most commands to children; it makes no sense
* to run "x,50" recursively. If m_bPropagateCommands is set, propagate all
* commands. */
// By default, don't propograte most commands to children; it makes no sense
// to run "x,50" recursively. If m_bPropagateCommands is set, propagate all
// commands.
if( m_bPropagateCommands && sName!="propagate" )
RunCommandOnChildren( command );
}
*/
void ActorFrame::GainFocus( float fRate, bool bRewindMovie, bool bLoop )
{
@@ -240,6 +254,11 @@ void ActorFrame::PlayCommand( const CString &sCommandName )
}
}
void ActorFrame::PushSelf( lua_State *L )
{
Luna<ActorFrame,LuaActorFrame>::Push( L, this );
}
/*
* (c) 2001-2004 Chris Danford
* All rights reserved.