remove ActorParam
This commit is contained in:
@@ -635,35 +635,6 @@ FileType ActorUtil::GetFileType( const RString &sPath )
|
||||
else return FT_Invalid;
|
||||
}
|
||||
|
||||
/* Helper: set actor parameters, and return them to their original value when released. */
|
||||
ActorUtil::ActorParam::ActorParam( RString sName, RString sValue )
|
||||
{
|
||||
m_pOld = new LuaReference;
|
||||
m_sName = sName;
|
||||
Lua *L = LUA->Get();
|
||||
LuaHelpers::Push( L, sValue );
|
||||
ActorUtil::SetParamFromStack( L, m_sName, m_pOld );
|
||||
LUA->Release( L );
|
||||
}
|
||||
|
||||
ActorUtil::ActorParam::~ActorParam()
|
||||
{
|
||||
Release();
|
||||
delete m_pOld;
|
||||
}
|
||||
|
||||
void ActorUtil::ActorParam::Release()
|
||||
{
|
||||
if( !m_pOld->IsSet() )
|
||||
return;
|
||||
/* Restore the old value. */
|
||||
Lua *L = LUA->Get();
|
||||
m_pOld->PushSelf( L );
|
||||
ActorUtil::SetParamFromStack( L, m_sName );
|
||||
m_pOld->Unset();
|
||||
LUA->Release( L );
|
||||
}
|
||||
|
||||
/*
|
||||
* (c) 2003-2004 Chris Danford
|
||||
* All rights reserved.
|
||||
|
||||
@@ -79,17 +79,6 @@ namespace ActorUtil
|
||||
|
||||
void SetParamFromStack( Lua *L, RString sName, LuaReference *pOld=NULL );
|
||||
void GetParam( Lua *L, const RString &sName );
|
||||
|
||||
struct ActorParam
|
||||
{
|
||||
ActorParam( RString sName, RString sValue );
|
||||
~ActorParam();
|
||||
void Release();
|
||||
|
||||
private:
|
||||
RString m_sName;
|
||||
LuaReference *m_pOld;
|
||||
};
|
||||
};
|
||||
|
||||
#define SET_XY( actor ) ActorUtil::SetXY( actor, m_sName )
|
||||
|
||||
Reference in New Issue
Block a user