diff --git a/polymer/eduke32/source/lunatic/defs.ilua b/polymer/eduke32/source/lunatic/defs.ilua index 610516780..66900d5ac 100644 --- a/polymer/eduke32/source/lunatic/defs.ilua +++ b/polymer/eduke32/source/lunatic/defs.ilua @@ -63,6 +63,10 @@ typedef struct { #pragma pack(pop) ]] +assert(ffi.sizeof('sectortype')==40) +assert(ffi.sizeof('walltype')==32) +assert(ffi.sizeof('spritetype')==44) + -- game structs ffi.cdef[[ #pragma pack(push,1) @@ -192,7 +196,11 @@ typedef struct { int32_t engine_main_arrays_are_static; ]] -if (ffi.C.engine_main_arrays_are_static) then +-- NOTE TO SELF: This is not C, never EVER write +-- if (x) +-- when checking a C variable x for 'thuthiness' +if (ffi.C.engine_main_arrays_are_static ~= 0) then +-- print('main arrays are static'); ffi.cdef[[ sectortype sector[]; walltype wall[]; @@ -200,6 +208,7 @@ spritetype sprite[]; spriteext_t spriteext[]; ]] else +-- print('main arrays are pointers'); ffi.cdef[[ sectortype *sector; walltype *wall; @@ -465,7 +474,7 @@ G_.sectorsofbunch = sectorsofbunch G_.TEMP_getvollev = TEMP_getvollev -- REMOVE G_.gamevar = gamevar --- 14.2 continued +-- PiL 14.2 continued setmetatable( G_, { __newindex = function (_, n) diff --git a/polymer/eduke32/source/lunatic/test.elua b/polymer/eduke32/source/lunatic/test.elua index 74e7a64d5..8511427d2 100644 --- a/polymer/eduke32/source/lunatic/test.elua +++ b/polymer/eduke32/source/lunatic/test.elua @@ -50,6 +50,7 @@ if (vol==1 and lev==1) then -- E1L1 end if (vol==1 and lev==8) then + print('tweaking bunch 1'); -- trueror1.map for i in sectorsofbunch(1, gv.CEILING) do sector[i].ceilingz = sector[i].ceilingz - 3*1024;