From ba9a3f9d1b930b84db4491fbe39cd1809f125c9d Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sun, 11 Mar 2012 17:37:08 +0000 Subject: [PATCH] Save TROR-related information into map states and bump BYTEVERSION. git-svn-id: https://svn.eduke32.com/eduke32@2449 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/duke3d.h | 2 +- polymer/eduke32/source/gameexec.c | 14 +++++++++++++- polymer/eduke32/source/savegame.c | 5 +---- polymer/eduke32/source/savegame.h | 5 +++++ polymer/eduke32/source/sector.h | 5 +++++ 5 files changed, 25 insertions(+), 6 deletions(-) diff --git a/polymer/eduke32/source/duke3d.h b/polymer/eduke32/source/duke3d.h index 2d0c8dad6..537b95b8c 100644 --- a/polymer/eduke32/source/duke3d.h +++ b/polymer/eduke32/source/duke3d.h @@ -68,7 +68,7 @@ extern "C" { #define SAMESIZE_ACTOR_T // increase by 3, because atomic GRP adds 1, and Shareware adds 2 -#define BYTEVERSION_JF 237 +#define BYTEVERSION_JF 240 #define BYTEVERSION_13 27 #define BYTEVERSION_14 116 diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index 0c0a4c5a0..282ad35b6 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -5100,6 +5100,11 @@ void G_SaveMapState(mapstate_t *save) Bmemcpy(&save->headspritestat[0],&headspritestat[0],sizeof(headspritestat)); Bmemcpy(&save->prevspritestat[0],&prevspritestat[0],sizeof(prevspritestat)); Bmemcpy(&save->nextspritestat[0],&nextspritestat[0],sizeof(nextspritestat)); +#ifdef YAX_ENABLE + Bmemcpy(&save->numyaxbunches, &numyaxbunches, sizeof(numyaxbunches)); + Bmemcpy(save->yax_bunchnum, yax_bunchnum, sizeof(yax_bunchnum)); + Bmemcpy(save->yax_nextwall, yax_nextwall, sizeof(yax_nextwall)); +#endif #if !defined SAMESIZE_ACTOR_T for (i=MAXSPRITES-1; i>=0; i--) { @@ -5236,6 +5241,11 @@ void G_RestoreMapState(mapstate_t *save) Bmemcpy(&headspritestat[0],&save->headspritestat[0],sizeof(headspritestat)); Bmemcpy(&prevspritestat[0],&save->prevspritestat[0],sizeof(prevspritestat)); Bmemcpy(&nextspritestat[0],&save->nextspritestat[0],sizeof(nextspritestat)); +#ifdef YAX_ENABLE + Bmemcpy(&numyaxbunches, &save->numyaxbunches, sizeof(numyaxbunches)); + Bmemcpy(yax_bunchnum, save->yax_bunchnum, sizeof(yax_bunchnum)); + Bmemcpy(yax_nextwall, save->yax_nextwall, sizeof(yax_nextwall)); +#endif Bmemcpy(&actor[0],&save->actor[0],sizeof(actor_t)*MAXSPRITES); #if !defined SAMESIZE_ACTOR_T for (i=MAXSPRITES-1; i>=0; i--) @@ -5333,7 +5343,9 @@ void G_RestoreMapState(mapstate_t *save) wall[animwall[x].wallnum].picnum = wall[animwall[x].wallnum].extra; } #endif - +#ifdef YAX_ENABLE + sv_postyaxload(); +#endif G_ResetInterpolations(); Net_ResetPrediction(); diff --git a/polymer/eduke32/source/savegame.c b/polymer/eduke32/source/savegame.c index 1e5e80837..d4b1b2886 100644 --- a/polymer/eduke32/source/savegame.c +++ b/polymer/eduke32/source/savegame.c @@ -1634,9 +1634,6 @@ static uint32_t calcsz(const dataspec_t *spec) static void sv_prespriteextsave(); static void sv_postspriteext(); #endif -#ifdef YAX_ENABLE -static void sv_postyaxload(); -#endif static void sv_calcbitptrsize(); static void sv_prescriptsave_once(); static void sv_prescriptload_once(); @@ -2268,7 +2265,7 @@ static void sv_postspriteext() #endif #ifdef YAX_ENABLE -static void sv_postyaxload() +void sv_postyaxload(void) { yax_update(numyaxbunches>0 ? 2 : 1); } diff --git a/polymer/eduke32/source/savegame.h b/polymer/eduke32/source/savegame.h index b8cd24f57..0e842a47f 100644 --- a/polymer/eduke32/source/savegame.h +++ b/polymer/eduke32/source/savegame.h @@ -71,6 +71,11 @@ int32_t G_LoadPlayer(int32_t spot); int32_t G_LoadSaveHeaderNew(int32_t spot, savehead_t *saveh); //int32_t G_LoadSaveHeader(char spot,struct savehead_ *saveh); void ReadSaveGameHeaders(void); + +#ifdef YAX_ENABLE +extern void sv_postyaxload(void); +#endif + extern char *bitptr; enum diff --git a/polymer/eduke32/source/sector.h b/polymer/eduke32/source/sector.h index c1e91939c..8a9d074de 100644 --- a/polymer/eduke32/source/sector.h +++ b/polymer/eduke32/source/sector.h @@ -77,6 +77,11 @@ typedef struct { spriteext_t spriteext[MAXSPRITES]; spritetype sprite[MAXSPRITES]; walltype wall[MAXWALLS]; +#ifdef YAX_ENABLE + int32_t numyaxbunches; + int16_t yax_bunchnum[MAXSECTORS][2]; + int16_t yax_nextwall[MAXWALLS][2]; +#endif } mapstate_t; extern void G_SaveMapState(mapstate_t *save);