diff options
Diffstat (limited to 'src/libjin-lua/common/je_lua_reference.cpp')
-rw-r--r-- | src/libjin-lua/common/je_lua_reference.cpp | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/src/libjin-lua/common/je_lua_reference.cpp b/src/libjin-lua/common/je_lua_reference.cpp deleted file mode 100644 index 72c1c3e..0000000 --- a/src/libjin-lua/common/je_lua_reference.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include "common/je_lua.h" - -#include "je_lua_reference.h" - -namespace JinEngine -{ - namespace Lua - { - - LuaRef::LuaRef(lua_State* L, int i) - : mL(L) - { - // Get value. - luax_pushvalue(mL, i); - // Set reference. - luax_getreferencestable(L); - luax_pushvalue(mL, -2); - mIndex = luax_ref(mL, -2); - luax_pop(L, 3); - } - - LuaRef::~LuaRef() - { - unref(); - } - - void LuaRef::unref() - { - luax_getreferencestable(mL); - luax_unref(mL, -1, mIndex); - luax_pop(mL, 1); - } - - void LuaRef::push() - { - luax_getreferencestable(mL); - luax_rawgeti(mL, -1, mIndex); - luax_remove(mL, -2); - } - - } -}
\ No newline at end of file |