diff --git a/stepmania/src/LuaManager.cpp b/stepmania/src/LuaManager.cpp index 6f5fe0286d..1abc4a4c38 100644 --- a/stepmania/src/LuaManager.cpp +++ b/stepmania/src/LuaManager.cpp @@ -96,7 +96,7 @@ bool LuaHelpers::FromStack( CString &Object, int iOffset, lua_State *L ) return pStr != NULL; } -void LuaManager::CreateTableFromArrayB( const vector &aIn, Lua *L ) +void LuaHelpers::CreateTableFromArrayB( Lua *L, const vector &aIn ) { lua_newtable( L ); for( unsigned i = 0; i < aIn.size(); ++i ) @@ -106,7 +106,7 @@ void LuaManager::CreateTableFromArrayB( const vector &aIn, Lua *L ) } } -void LuaManager::ReadArrayFromTableB( vector &aOut, Lua *L ) +void LuaHelpers::ReadArrayFromTableB( Lua *L, vector &aOut ) { luaL_checktype( L, -1, LUA_TTABLE ); diff --git a/stepmania/src/LuaManager.h b/stepmania/src/LuaManager.h index fae836860c..062380f6a0 100644 --- a/stepmania/src/LuaManager.h +++ b/stepmania/src/LuaManager.h @@ -88,12 +88,6 @@ public: void SetGlobal( const CString &sName ); - /* Create a Lua array (a table with indices starting at 1) of the given vector, - * and push it on the stack. */ - static void CreateTableFromArrayB( const vector &aIn, Lua *L ); - /* Read the table at the top of the stack back into a vector. */ - static void ReadArrayFromTableB( vector &aOut, Lua *L ); - lua_State *L; private: @@ -106,6 +100,13 @@ private: namespace LuaHelpers { + /* Create a Lua array (a table with indices starting at 1) of the given vector, + * and push it on the stack. */ + void CreateTableFromArrayB( Lua *L, const vector &aIn ); + + /* Read the table at the top of the stack back into a vector. */ + void ReadArrayFromTableB( Lua *L, vector &aOut ); + template void ReadArrayFromTable( vector &aOut, lua_State *L ) { diff --git a/stepmania/src/OptionRowHandler.cpp b/stepmania/src/OptionRowHandler.cpp index adb10adc71..9325da9d14 100644 --- a/stepmania/src/OptionRowHandler.cpp +++ b/stepmania/src/OptionRowHandler.cpp @@ -703,7 +703,7 @@ public: vbSelOut[i] = false; /* Create the vbSelectedOut table. */ - LUA->CreateTableFromArrayB( vbSelOut, LUA->L ); + LuaHelpers::CreateTableFromArrayB( LUA->L, vbSelOut ); ASSERT( lua_gettop(LUA->L) == 1 ); /* vbSelectedOut table */ /* Get the function to call from m_LuaTable. */ @@ -731,7 +731,7 @@ public: lua_pop( LUA->L, 1 ); /* pop option table */ - LUA->ReadArrayFromTableB( vbSelOut, LUA->L ); + LuaHelpers::ReadArrayFromTableB( LUA->L, vbSelOut ); lua_pop( LUA->L, 1 ); /* pop vbSelectedOut table */ @@ -753,7 +753,7 @@ public: vector vbSelectedCopy = vbSel; /* Create the vbSelectedOut table. */ - LUA->CreateTableFromArrayB( vbSelectedCopy, LUA->L ); + LuaHelpers::CreateTableFromArrayB( LUA->L, vbSelectedCopy ); ASSERT( lua_gettop(LUA->L) == 1 ); /* vbSelectedOut table */ /* Get the function to call. */