From 3a0734a7b041a424100024025d3dbdf888ceae88 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sat, 28 Jan 2012 14:36:34 +0000 Subject: [PATCH] Lunatic: fix for running with static main engine arrays. git-svn-id: https://svn.eduke32.com/eduke32@2291 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/engine.c | 3 +++ polymer/eduke32/source/lunatic/defs.ilua | 15 ++++++++++++++- polymer/eduke32/source/lunatic/dynsymlist | 2 ++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 4389aca9a..fdac7b856 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -51,6 +51,9 @@ #if !defined DEBUG_MAIN_ARRAYS # 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 float debug1, debug2; diff --git a/polymer/eduke32/source/lunatic/defs.ilua b/polymer/eduke32/source/lunatic/defs.ilua index 3b18fea3d..7e6324fcc 100644 --- a/polymer/eduke32/source/lunatic/defs.ilua +++ b/polymer/eduke32/source/lunatic/defs.ilua @@ -79,14 +79,27 @@ typedef struct const int8_t _do_not_use[24]; } actor_t; #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; walltype *wall; spritetype *sprite; spriteext_t *spriteext; +]] +end +ffi.cdef[[ const int16_t numsectors, numwalls; const int16_t headspritesect[16384+1], headspritestat[1024+1]; diff --git a/polymer/eduke32/source/lunatic/dynsymlist b/polymer/eduke32/source/lunatic/dynsymlist index 8e783efff..22fe81a83 100644 --- a/polymer/eduke32/source/lunatic/dynsymlist +++ b/polymer/eduke32/source/lunatic/dynsymlist @@ -1,4 +1,6 @@ { +engine_main_arrays_are_static; + sector; wall; sprite;