change arg order

This commit is contained in:
Glenn Maynard
2006-09-22 08:48:49 +00:00
parent f29762c59e
commit 709a790f1c
6 changed files with 11 additions and 11 deletions
+4 -4
View File
@@ -140,7 +140,7 @@ void LuaHelpers::ReadArrayFromTableB( Lua *L, vector<bool> &aOut )
static int LuaPanic( lua_State *L ) static int LuaPanic( lua_State *L )
{ {
RString sErr; RString sErr;
LuaHelpers::Pop( sErr, L ); LuaHelpers::Pop( L, sErr );
lua_Debug ar; lua_Debug ar;
int level = 0; int level = 0;
@@ -507,7 +507,7 @@ bool LuaHelpers::RunScript( Lua *L, const RString &sScript, const RString &sName
if( ret ) if( ret )
{ {
LuaHelpers::Pop( sError, L ); LuaHelpers::Pop( L, sError );
return false; return false;
} }
} }
@@ -517,7 +517,7 @@ bool LuaHelpers::RunScript( Lua *L, const RString &sScript, const RString &sName
int ret = lua_pcall( L, 0, iReturnValues, 0 ); int ret = lua_pcall( L, 0, iReturnValues, 0 );
if( ret ) if( ret )
{ {
LuaHelpers::Pop( sError, L ); LuaHelpers::Pop( L, sError );
return false; return false;
} }
} }
@@ -608,7 +608,7 @@ bool LuaHelpers::RunExpressionS( const RString &str, RString &sOut )
if( lua_isfunction( L, -1 ) ) if( lua_isfunction( L, -1 ) )
RageException::Throw( "Result is a function; did you forget \"()\"?" ); RageException::Throw( "Result is a function; did you forget \"()\"?" );
LuaHelpers::Pop( sOut, L ); LuaHelpers::Pop( L, sOut );
LUA->Release( L ); LUA->Release( L );
return true; return true;
+2 -2
View File
@@ -91,7 +91,7 @@ namespace LuaHelpers
bool FromStack( Lua *L, RString &Object, int iOffset ); bool FromStack( Lua *L, RString &Object, int iOffset );
template<class T> template<class T>
bool Pop( T &val, lua_State *L ) bool Pop( lua_State *L, T &val )
{ {
bool bRet = LuaHelpers::FromStack( L, val, -1 ); bool bRet = LuaHelpers::FromStack( L, val, -1 );
lua_pop( L, 1 ); lua_pop( L, 1 );
@@ -109,7 +109,7 @@ namespace LuaHelpers
{ {
lua_rawgeti( L, -1, i+1 ); lua_rawgeti( L, -1, i+1 );
T value = T(); T value = T();
LuaHelpers::Pop( value, L ); LuaHelpers::Pop( L, value );
aOut.push_back( value ); aOut.push_back( value );
} }
} }
+1 -1
View File
@@ -170,7 +170,7 @@ void MenuTimer::SetText( float fSeconds )
lua_call(L, 1, 1); lua_call(L, 1, 1);
RString sText; RString sText;
LuaHelpers::Pop( sText, L ); LuaHelpers::Pop( L, sText );
m_text[i].SetText( sText ); m_text[i].SetText( sText );
} }
+1 -1
View File
@@ -169,7 +169,7 @@ void PercentageDisplay::Refresh()
ASSERT( !lua_isnil(L, -1) ); ASSERT( !lua_isnil(L, -1) );
LuaHelpers::Push( fPercentDancePoints, L ); LuaHelpers::Push( fPercentDancePoints, L );
lua_call( L, 1, 1 ); // 1 args, 1 result lua_call( L, 1, 1 ); // 1 args, 1 result
LuaHelpers::Pop( sNumToDisplay, L ); LuaHelpers::Pop( L, sNumToDisplay );
LUA->Release(L); LUA->Release(L);
// HACK: Use the last frame in the numbers texture as '-' // HACK: Use the last frame in the numbers texture as '-'
+1 -1
View File
@@ -85,7 +85,7 @@ void IPreference::SetFromStack( lua_State *L )
} \ } \
template<> void PrefSetFromStack( lua_State *L, type &v ) \ template<> void PrefSetFromStack( lua_State *L, type &v ) \
{ \ { \
LuaHelpers::Pop( v, L ); \ LuaHelpers::Pop( L, v ); \
} \ } \
template<> void PrefPushValue( lua_State *L, const type &v ) \ template<> void PrefPushValue( lua_State *L, const type &v ) \
{ \ { \
+2 -2
View File
@@ -321,7 +321,7 @@ public:
else else
{ {
m_Value.Unset(); m_Value.Unset();
LuaHelpers::Pop( m_currentValue, L ); LuaHelpers::Pop( L, m_currentValue );
} }
LUA->Release(L); LUA->Release(L);
@@ -349,7 +349,7 @@ public:
m_Value.PushSelf( L ); m_Value.PushSelf( L );
lua_call(L, 0, 1); lua_call(L, 0, 1);
ASSERT( !lua_isnil(L, -1) ); ASSERT( !lua_isnil(L, -1) );
LuaHelpers::Pop( m_currentValue, L ); LuaHelpers::Pop( L, m_currentValue );
LUA->Release(L); LUA->Release(L);
} }