Unknown mess

This commit is contained in:
2026-02-17 13:28:09 -05:00
57 changed files with 2518 additions and 1318 deletions

View File

@@ -1227,20 +1227,6 @@ LUA_API int lua_nkeys (lua_State *L, int idx) {
return n;
}
LUA_API int lua_nthkey (lua_State *L, int idx, int n) {
StkId t;
lua_lock(L);
t = index2addr(L, idx);
api_check(L, ttistable(t), "table expected");
api_incr_top(L);
api_incr_top(L);
int res = luaH_nthkey(L, hvalue(t), n, L->top - 2);
if (res == 0)
L->top -= 2;
lua_unlock(L);
return res;
}
LUA_API void lua_concat (lua_State *L, int n) {
lua_lock(L);
api_checknelems(L, n);

View File

@@ -163,27 +163,6 @@ int luaH_nkeys (Table *t) {
return t->nnkeys;
}
int luaH_nthkey (lua_State *L, Table *t, int n, StkId pair) {
n -= 1; /* convert to C indexing */
if ((n < 0) || (n >= t->nnkeys)) {
setnilvalue(pair+0);
setnilvalue(pair+1);
return 0;
}
int index = t->sequence[n];
if (index < t->sizearray) {
setnvalue(pair + 0, index + 1);
setobj2s(L, pair + 1, &t->array[index].i_val);
return 1;
} else {
index -= t->sizearray;
Node *n = t->node + index;
setobj2s(L, pair + 0, gkey(n));
setobj2s(L, pair + 1, gval(n));
return 1;
}
}
int successorindex (lua_State *L, Table *t, StkId key) {
int i, seqno;
if (ttisnil(key)) {
@@ -706,34 +685,13 @@ void luaH_setint (lua_State *L, Table *t, int key, TValue *value) {
}
/*
** Try to find a boundary in table `t'. A `boundary' is an integer index
** such that t[i] is non-nil and t[i+1] is nil (and 0 if t[1] is nil).
** Return the number of keys in the table.
*/
int luaH_getn (Table *t) {
unsigned int j = 1;
unsigned int i = 0;
/* find `i' and `j' such that i is present and j is not */
while (!ttisnil(luaH_getint(t, j))) {
i = j;
j *= 2;
if (j > cast(unsigned int, MAX_INT)) { /* overflow? */
/* table was built with bad purposes: resort to linear search */
i = 1;
while (!ttisnil(luaH_getint(t, i))) i++;
return i - 1;
}
}
/* now do a binary search between them */
while (j - i > 1) {
unsigned int m = (i+j)/2;
if (ttisnil(luaH_getint(t, m))) j = m;
else i = m;
}
return i;
return t->nnkeys;
}
#if defined(LUA_DEBUG)
Node *luaH_mainposition (const Table *t, const TValue *key) {

View File

@@ -37,7 +37,6 @@ LUAI_FUNC void luaH_resize (lua_State *L, Table *t, int nasize, int nhsize);
LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, int nasize);
LUAI_FUNC void luaH_free (lua_State *L, Table *t);
LUAI_FUNC int luaH_nkeys (Table *t);
LUAI_FUNC int luaH_nthkey (lua_State *L, Table *t, int n, StkId pair);
LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key);
LUAI_FUNC int luaH_getn (Table *t);

View File

@@ -317,7 +317,6 @@ LUA_API lua_Alloc (lua_getallocf) (lua_State *L, void **ud);
LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud);
LUA_API int (lua_nkeys) (lua_State *L, int idx);
LUA_API int (lua_nthkey) (lua_State *L, int idx, int n);
/*
** ===============================================================

View File

@@ -28,6 +28,11 @@ function engio.move(action, xyz, facing)
tangible.animate{tan=actor, anim={action=action, interactive=true, xyz=xyz, facing=facing}}
end
function moveto(x, y)
local z = tangible.animfinal(actor).xyz[3]
tangible.animate{tan=actor, anim={action="moveto", xyz={x, y, z}, facing=math.auto}}
end
function cube.lookhotkeys(keys)
keys:add("Z", "Cube Hi", function () dprint("Doing Cube Hi") end)
keys:add("X", "Cube Bye", function () dprint("Doing Cube Bye") end)