Initial revision of animqueue
This commit is contained in:
@@ -29,16 +29,6 @@ LuaDefine(table_equal, "c") {
|
||||
return LS.result();
|
||||
}
|
||||
|
||||
LuaDefine(table_append, "c") {
|
||||
luaL_checktype(L, -2, LUA_TTABLE);
|
||||
int len = lua_objlen(L, -2);
|
||||
lua_pushinteger(L, len+1);
|
||||
lua_pushvalue(L, -2);
|
||||
lua_rawset(L, -4);
|
||||
lua_pop(L, 2);
|
||||
return 0;
|
||||
}
|
||||
|
||||
LuaDefine(table_findremove, "c") {
|
||||
luaL_checktype(L, -2, LUA_TTABLE);
|
||||
int src = 1;
|
||||
@@ -75,6 +65,17 @@ LuaDefine(table_findremove, "c") {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LuaDefine(table_push, "c") {
|
||||
luaL_checktype(L, -2, LUA_TTABLE);
|
||||
int len = lua_objlen(L, -2);
|
||||
lua_pushinteger(L, len+1);
|
||||
lua_pushvalue(L, -2);
|
||||
lua_rawset(L, -4);
|
||||
lua_pop(L, 2);
|
||||
return 0;
|
||||
}
|
||||
|
||||
LuaDefine(table_find, "c") {
|
||||
luaL_checktype(L, -2, LUA_TTABLE);
|
||||
for (int i = 1; ; i++) {
|
||||
@@ -125,9 +126,7 @@ LuaDefine(table_clear, "c") {
|
||||
LuaArg tab;
|
||||
LuaStack LS(L, tab);
|
||||
|
||||
LS.checktable(tab);
|
||||
LS.clearmetatable(tab);
|
||||
|
||||
LS.checktable(tab);
|
||||
lua_pushnil(L);
|
||||
while (lua_next(L, tab.index()) != 0) {
|
||||
lua_pop(L, 1); // Pop the old value.
|
||||
@@ -139,14 +138,6 @@ LuaDefine(table_clear, "c") {
|
||||
return LS.result();
|
||||
}
|
||||
|
||||
LuaDefine(table_coerce, "c") {
|
||||
if (!lua_istable(L, -1)) {
|
||||
lua_pop(L, 1);
|
||||
lua_newtable(L);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
LuaDefine(queue_create, "c") {
|
||||
LuaRet queue;
|
||||
LuaStack LS(L, queue);
|
||||
|
||||
Reference in New Issue
Block a user