mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 02:30:46 +00:00
LunaCON: in {save,load}mapstate, warn that saving/restoring gamevars is NYI.
git-svn-id: https://svn.eduke32.com/eduke32@4118 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
65cdf97bfa
commit
6c88824792
8 changed files with 24 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -94,6 +94,7 @@ g_argv;
|
|||
g_elCONSize;
|
||||
g_elCON;
|
||||
El_SetCON;
|
||||
El_OnError;
|
||||
|
||||
g_elSavecode;
|
||||
El_FreeSaveCode;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue