aboutsummaryrefslogtreecommitdiff
path: root/src/lua/common/je_lua_reference.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-12-20 18:34:50 +0800
committerchai <chaifix@163.com>2018-12-20 18:34:50 +0800
commitee8ef0433e36bf354a717bd4af679a0a5af2e6be (patch)
tree2fc748510200f8bc24928d1938300eecc0604deb /src/lua/common/je_lua_reference.cpp
parent7ae40127f15f8f2cb963a7efeb018f7887ebc1ea (diff)
*修改文件结构
Diffstat (limited to 'src/lua/common/je_lua_reference.cpp')
-rw-r--r--src/lua/common/je_lua_reference.cpp42
1 files changed, 0 insertions, 42 deletions
diff --git a/src/lua/common/je_lua_reference.cpp b/src/lua/common/je_lua_reference.cpp
deleted file mode 100644
index 72c1c3e..0000000
--- a/src/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