You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
486 B
25 lines
486 B
#include "luaobject.h"
|
|
#include "luainterface.h"
|
|
|
|
LuaObject::LuaObject()
|
|
{
|
|
// creates own table
|
|
m_luaTable = g_lua.createTable();
|
|
}
|
|
|
|
LuaObject::~LuaObject()
|
|
{
|
|
|
|
}
|
|
|
|
LuaValuePtr LuaObject::toLuaValue()
|
|
{
|
|
// fills a new userdata with a new LuaObject pointer
|
|
new(g_lua.newUserdata(sizeof(LuaObjectPtr))) LuaObjectPtr(shared_from_this());
|
|
|
|
// set the metatable for the userdata
|
|
g_lua.setMetatable(make_string(getLuaTypeName(), "_mt"));
|
|
|
|
return g_lua.popValue();
|
|
}
|