LuaHelpers::FromStack binding for references
This commit is contained in:
@@ -163,6 +163,21 @@ RString LuaReference::Serialize() const
|
|||||||
return sRet;
|
return sRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool LuaHelpers::FromStack( lua_State *L, LuaReference &Object, int iOffset )
|
||||||
|
{
|
||||||
|
lua_pushvalue( L, iOffset );
|
||||||
|
Object.SetFromStack( L );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LuaHelpers::FromStack( lua_State *L, apActorCommands &Object, int iOffset )
|
||||||
|
{
|
||||||
|
LuaReference *pRef = new LuaReference;
|
||||||
|
FromStack( L, *pRef, iOffset );
|
||||||
|
Object = apActorCommands( pRef );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
LuaTable::LuaTable()
|
LuaTable::LuaTable()
|
||||||
{
|
{
|
||||||
Lua *L = LUA->Get();
|
Lua *L = LUA->Get();
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
#ifndef LUA_REFERENCE_H
|
#ifndef LUA_REFERENCE_H
|
||||||
#define LUA_REFERENCE_H
|
#define LUA_REFERENCE_H
|
||||||
|
|
||||||
|
#include "RageUtil_AutoPtr.h"
|
||||||
|
|
||||||
struct lua_State;
|
struct lua_State;
|
||||||
typedef lua_State Lua;
|
typedef lua_State Lua;
|
||||||
|
|
||||||
@@ -47,6 +49,14 @@ private:
|
|||||||
int m_iReference;
|
int m_iReference;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef AutoPtrCopyOnWrite<LuaReference> apActorCommands;
|
||||||
|
|
||||||
|
namespace LuaHelpers
|
||||||
|
{
|
||||||
|
bool FromStack( lua_State *L, LuaReference &Object, int iOffset );
|
||||||
|
bool FromStack( lua_State *L, apActorCommands &Object, int iOffset );
|
||||||
|
}
|
||||||
|
|
||||||
class LuaTable: public LuaReference
|
class LuaTable: public LuaReference
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user