From acc2a2f70eb6d1c7b63bda69548f47460cf52252 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Wed, 14 Mar 2012 22:31:49 +0000 Subject: [PATCH] Save 'Numsprites' into savegames and mapstates. Bump savegame minor version. git-svn-id: https://svn.eduke32.com/eduke32@2483 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/gameexec.c | 4 ++++ polymer/eduke32/source/savegame.c | 1 + polymer/eduke32/source/savegame.h | 2 +- polymer/eduke32/source/sector.h | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index ae46f6464..3e1c5fc89 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -5053,6 +5053,8 @@ void G_SaveMapState(mapstate_t *save) for (i=0; ispriteext[0],&spriteext[0],sizeof(spriteext_t)*MAXSPRITES); + + save->numsprites = Numsprites; save->tailspritefree = tailspritefree; Bmemcpy(&save->headspritesect[0],&headspritesect[0],sizeof(headspritesect)); Bmemcpy(&save->prevspritesect[0],&prevspritesect[0],sizeof(prevspritesect)); @@ -5150,6 +5152,8 @@ void G_RestoreMapState(mapstate_t *save) else for (i=0; inumsprites; tailspritefree = save->tailspritefree; Bmemcpy(&headspritesect[0],&save->headspritesect[0],sizeof(headspritesect)); Bmemcpy(&prevspritesect[0],&save->prevspritesect[0],sizeof(prevspritesect)); diff --git a/polymer/eduke32/source/savegame.c b/polymer/eduke32/source/savegame.c index 784ba87ef..ca49034a3 100644 --- a/polymer/eduke32/source/savegame.c +++ b/polymer/eduke32/source/savegame.c @@ -878,6 +878,7 @@ static const dataspec_t svgm_secwsp[] = { DS_CNT(numwalls), yax_nextwall, sizeof(yax_nextwall[0]), (intptr_t)&numwalls }, { DS_LOADFN|DS_PROTECTFN, (void *)&sv_postyaxload, 0, 1 }, #endif + { 0, &Numsprites, sizeof(Numsprites), 1 }, { 0, &tailspritefree, sizeof(tailspritefree), 1 }, { 0, &headspritesect[0], sizeof(headspritesect[0]), MAXSECTORS+1 }, { 0, &prevspritesect[0], sizeof(prevspritesect[0]), MAXSPRITES }, diff --git a/polymer/eduke32/source/savegame.h b/polymer/eduke32/source/savegame.h index 7b8673705..208ef5fe3 100644 --- a/polymer/eduke32/source/savegame.h +++ b/polymer/eduke32/source/savegame.h @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define __savegame_h__ #define SV_MAJOR_VER 1 -#define SV_MINOR_VER 2 +#define SV_MINOR_VER 3 #pragma pack(push,1) typedef struct diff --git a/polymer/eduke32/source/sector.h b/polymer/eduke32/source/sector.h index ecb45cfea..a9256cad6 100644 --- a/polymer/eduke32/source/sector.h +++ b/polymer/eduke32/source/sector.h @@ -53,6 +53,8 @@ typedef struct { int16_t g_numAnimWalls; int16_t g_numClouds,clouds[128],cloudx[128],cloudy[128]; int16_t g_numCyclers; + + int32_t numsprites; int16_t tailspritefree; int16_t headspritesect[MAXSECTORS+1]; int16_t headspritestat[MAXSTATUS+1];