diff --git a/polymer/eduke32/source/duke3d.h b/polymer/eduke32/source/duke3d.h index 130708464..3ae5f2bcc 100644 --- a/polymer/eduke32/source/duke3d.h +++ b/polymer/eduke32/source/duke3d.h @@ -59,7 +59,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // increase by 3, because atomic GRP adds 1, and Shareware adds 2 #ifdef LUNATIC // Lunatic -# define BYTEVERSION_JF 285 +# define BYTEVERSION_JF 288 #else // Non-Lua build # define BYTEVERSION_JF 285 diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index f0222094e..ffc37b824 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -5557,6 +5557,8 @@ void G_SaveMapState(void) } else save->vars[i] = (intptr_t *)aGameVars[i].val.lValue; } +#else + // TODO! (Not easy.) #endif ototalclock = totalclock; } @@ -5661,6 +5663,8 @@ void G_RestoreMapState(void) } Gv_RefreshPointers(); +#else + // TODO! (Not easy.) #endif // Update g_player[].ps->i (sprite indices of players) to be consistent // with just loaded sprites. diff --git a/polymer/eduke32/source/lunatic/control.lua b/polymer/eduke32/source/lunatic/control.lua index b0d6402de..31473ff70 100644 --- a/polymer/eduke32/source/lunatic/control.lua +++ b/polymer/eduke32/source/lunatic/control.lua @@ -9,6 +9,7 @@ local jit = require("jit") local CF = CF local bit = require("bit") +local debug = require("debug") local io = require("io") local math = require("math") local table = require("table") @@ -1832,10 +1833,18 @@ end -- TODO: saving/restoration of per-player or per-actor gamevars. function _savemapstate() ffiC.G_SaveMapState() + local errmsg = debug.traceback( + "warning: savemapstate: gamevar saving not yet implemented", 2) + ffiC.El_OnError(errmsg) + print(errmsg) end function _loadmapstate() ffiC.G_RestoreMapState() + local errmsg = debug.traceback( + "warning: loadmapstate: gamevar saving not yet implemented", 2) + ffiC.El_OnError(errmsg) + print(errmsg) end -- Gamevar persistence in the configuration file diff --git a/polymer/eduke32/source/lunatic/defs.ilua b/polymer/eduke32/source/lunatic/defs.ilua index 29867e173..13f0df292 100644 --- a/polymer/eduke32/source/lunatic/defs.ilua +++ b/polymer/eduke32/source/lunatic/defs.ilua @@ -593,6 +593,7 @@ int32_t g_RETURN; int32_t g_elCONSize; char *g_elCON; void El_SetCON(const char *conluacode); +void El_OnError(const char *str); char *g_elSavecode; void El_FreeSaveCode(void); @@ -2286,7 +2287,7 @@ do return "local "..modname.."."..lname end - -- Call restore_local. + -- Emit code to call restore_local. sb:addrawf("F(%d,L)", li) end end diff --git a/polymer/eduke32/source/lunatic/dynsymlist b/polymer/eduke32/source/lunatic/dynsymlist index 4cac45fcf..53ddef0f5 100644 --- a/polymer/eduke32/source/lunatic/dynsymlist +++ b/polymer/eduke32/source/lunatic/dynsymlist @@ -94,6 +94,7 @@ g_argv; g_elCONSize; g_elCON; El_SetCON; +El_OnError; g_elSavecode; El_FreeSaveCode; diff --git a/polymer/eduke32/source/lunatic/lunatic_game.c b/polymer/eduke32/source/lunatic/lunatic_game.c index 01bde260c..60b216647 100644 --- a/polymer/eduke32/source/lunatic/lunatic_game.c +++ b/polymer/eduke32/source/lunatic/lunatic_game.c @@ -207,7 +207,7 @@ static int32_t cmp_against_others(const char *str, int32_t slen) return 0; } -static void El_OnError(const char *str) +LUNATIC_EXTERN void El_OnError(const char *str) { if (!el_tooMuchErrors) { diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index 3e9e5012a..913be4182 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -2035,6 +2035,8 @@ void G_FreeMapState(int32_t mapnum) Bfree(mapinfo->savedstate->vars[j]); } } +#else + Bfree(mapinfo->savedstate->savecode); #endif Bfree(mapinfo->savedstate); mapinfo->savedstate = NULL; diff --git a/polymer/eduke32/source/sector.h b/polymer/eduke32/source/sector.h index 4dffebf84..c6f7a12a6 100644 --- a/polymer/eduke32/source/sector.h +++ b/polymer/eduke32/source/sector.h @@ -77,8 +77,11 @@ typedef struct { spriteext_t spriteext[MAXSPRITES]; spritetype sprite[MAXSPRITES]; walltype wall[MAXWALLS]; - +#if !defined LUNATIC intptr_t *vars[MAXGAMEVARS]; +#else + char *savecode; +#endif #ifdef YAX_ENABLE int32_t numyaxbunches; # if !defined NEW_MAP_FORMAT