This commit is contained in:
Glenn Maynard
2005-08-25 02:31:07 +00:00
parent 34dbae291f
commit 74c83953cc
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -2,16 +2,16 @@
#include "LuaBinding.h"
#include "RageUtil.h"
void CreateMethodsTable( lua_State *L, const CString &szName )
void CreateMethodsTable( lua_State *L, const CString &sName )
{
lua_pushstring( L, szName );
lua_pushlstring( L, sName.data(), sName.size() );
lua_rawget( L, LUA_GLOBALSINDEX );
if( !lua_isnil(L, -1) )
return;
lua_pop( L, 1 );
lua_newtable( L );
lua_pushstring( L, szName );
lua_pushlstring( L, sName.data(), sName.size() );
lua_pushvalue( L, -2 );
lua_rawset( L, LUA_GLOBALSINDEX );
}
+1 -1
View File
@@ -99,7 +99,7 @@ void LuaManager::UnsetGlobal( const CString &sName )
void LuaHelpers::Push( const bool &Object, lua_State *L ) { lua_pushboolean( L, Object ); }
void LuaHelpers::Push( const float &Object, lua_State *L ) { lua_pushnumber( L, Object ); }
void LuaHelpers::Push( const int &Object, lua_State *L ) { lua_pushnumber( L, Object ); }
void LuaHelpers::Push( const CString &Object, lua_State *L ) { lua_pushstring( L, Object ); }
void LuaHelpers::Push( const CString &Object, lua_State *L ) { lua_pushlstring( L, Object.data(), Object.size() ); }
bool LuaHelpers::FromStack( bool &Object, int iOffset, lua_State *L ) { Object = !!lua_toboolean( L, iOffset ); return true; }
bool LuaHelpers::FromStack( float &Object, int iOffset, lua_State *L ) { Object = (float)lua_tonumber( L, iOffset ); return true; }