mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-16 09:21:36 +00:00
Lunatic: fix interface when compiled with 'pointered' main arrays. Argh!
git-svn-id: https://svn.eduke32.com/eduke32@2310 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
6ca24a0543
commit
e59e7f0f3c
2 changed files with 12 additions and 2 deletions
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue