Lunatic: fix for running with static main engine arrays.

git-svn-id: https://svn.eduke32.com/eduke32@2291 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-01-28 14:36:34 +00:00
parent 48ec616480
commit 3a0734a7b0
3 changed files with 19 additions and 1 deletions

View file

@ -51,6 +51,9 @@
#if !defined DEBUG_MAIN_ARRAYS #if !defined DEBUG_MAIN_ARRAYS
# define HAVE_CLIPSHAPE_FEATURE # define HAVE_CLIPSHAPE_FEATURE
const int32_t engine_main_arrays_are_static = 0; // for Lunatic
#else
const int32_t engine_main_arrays_are_static = 1;
#endif #endif
float debug1, debug2; float debug1, debug2;

View file

@ -79,14 +79,27 @@ typedef struct
const int8_t _do_not_use[24]; const int8_t _do_not_use[24];
} actor_t; } actor_t;
#pragma pack(pop) #pragma pack(pop)
int32_t engine_main_arrays_are_static;
]] ]]
ffi.cdef[[ if (ffi.C.engine_main_arrays_are_static) then
ffi.cdef[[
sectortype sector[];
walltype wall[];
spritetype sprite[];
spriteext_t spriteext[];
]]
else
ffi.cdef[[
sectortype *sector; sectortype *sector;
walltype *wall; walltype *wall;
spritetype *sprite; spritetype *sprite;
spriteext_t *spriteext; spriteext_t *spriteext;
]]
end
ffi.cdef[[
const int16_t numsectors, numwalls; const int16_t numsectors, numwalls;
const int16_t headspritesect[16384+1], headspritestat[1024+1]; const int16_t headspritesect[16384+1], headspritestat[1024+1];

View file

@ -1,4 +1,6 @@
{ {
engine_main_arrays_are_static;
sector; sector;
wall; wall;
sprite; sprite;