From 98a752669f51b0530fad173b9832c162a9e515ea Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 14 Oct 2006 02:39:52 +0000 Subject: [PATCH] remove ActorParam --- stepmania/src/ActorUtil.cpp | 29 ----------------------------- stepmania/src/ActorUtil.h | 11 ----------- 2 files changed, 40 deletions(-) diff --git a/stepmania/src/ActorUtil.cpp b/stepmania/src/ActorUtil.cpp index 430967c491..c1375a1414 100644 --- a/stepmania/src/ActorUtil.cpp +++ b/stepmania/src/ActorUtil.cpp @@ -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. diff --git a/stepmania/src/ActorUtil.h b/stepmania/src/ActorUtil.h index e785c1cf8a..8b3af45002 100644 --- a/stepmania/src/ActorUtil.h +++ b/stepmania/src/ActorUtil.h @@ -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 )