- removed all savegame compatibility handling, since the data is just too different from what it was before to try to convert it.

This commit is contained in:
Christoph Oelckers 2016-04-03 20:55:23 +02:00
parent 4e5ba49aca
commit 3ee42f6aa6
15 changed files with 153 additions and 607 deletions

View file

@ -1929,13 +1929,6 @@ void G_DoLoadGame ()
BYTE *vars_p = (BYTE *)text; BYTE *vars_p = (BYTE *)text;
C_ReadCVars (&vars_p); C_ReadCVars (&vars_p);
delete[] text; delete[] text;
if (SaveVersion <= 4509)
{
// account for the flag shuffling for making freelook a 3-state option
INTBOOL flag = dmflags & DF_YES_FREELOOK;
dmflags = dmflags & ~DF_YES_FREELOOK;
if (flag) dmflags2 = dmflags2 | DF2_RESPAWN_SUPER;
}
} }
// dearchive all the modifications // dearchive all the modifications

View file

@ -1493,26 +1493,11 @@ void G_SerializeLevel (FArchive &arc, bool hubLoad)
<< level.maptime << level.maptime
<< i; << i;
if (SaveVersion >= 3313)
{
// This is a player property now
int nextmusic;
arc << nextmusic;
}
// Hub transitions must keep the current total time // Hub transitions must keep the current total time
if (!hubLoad) if (!hubLoad)
level.totaltime = i; level.totaltime = i;
if (SaveVersion >= 4507)
{
arc << level.skytexture1 << level.skytexture2; arc << level.skytexture1 << level.skytexture2;
}
else
{
level.skytexture1 = TexMan.GetTexture(arc.ReadName(), FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_ReturnFirst);
level.skytexture2 = TexMan.GetTexture(arc.ReadName(), FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_ReturnFirst);
}
if (arc.IsLoading()) if (arc.IsLoading())
{ {
sky1texture = level.skytexture1; sky1texture = level.skytexture1;
@ -1553,12 +1538,7 @@ void G_SerializeLevel (FArchive &arc, bool hubLoad)
P_SerializeSubsectors(arc); P_SerializeSubsectors(arc);
StatusBar->Serialize (arc); StatusBar->Serialize (arc);
if (SaveVersion >= 4222) arc << level.DefaultSkybox << level.total_monsters << level.total_items << level.total_secrets;
{ // This must be done *after* thinkers are serialized.
arc << level.DefaultSkybox;
}
arc << level.total_monsters << level.total_items << level.total_secrets;
// Does this level have custom translations? // Does this level have custom translations?
FRemapTable *trans; FRemapTable *trans;
@ -1788,8 +1768,6 @@ void G_WriteSnapshots (FILE *file)
void G_ReadSnapshots (PNGHandle *png) void G_ReadSnapshots (PNGHandle *png)
{ {
DWORD chunkLen; DWORD chunkLen;
BYTE namelen;
char mapname[256];
FString MapName; FString MapName;
level_info_t *i; level_info_t *i;
@ -1802,14 +1780,7 @@ void G_ReadSnapshots (PNGHandle *png)
DWORD snapver; DWORD snapver;
arc << snapver; arc << snapver;
if (SaveVersion < 4508) arc << MapName;
{
arc << namelen;
arc.Read(mapname, namelen);
mapname[namelen] = 0;
MapName = mapname;
}
else arc << MapName;
i = FindLevelInfo (MapName); i = FindLevelInfo (MapName);
i->snapshotVer = snapver; i->snapshotVer = snapver;
i->snapshot = new FCompressedMemFile; i->snapshot = new FCompressedMemFile;
@ -1824,14 +1795,7 @@ void G_ReadSnapshots (PNGHandle *png)
DWORD snapver; DWORD snapver;
arc << snapver; arc << snapver;
if (SaveVersion < 4508) arc << MapName;
{
arc << namelen;
arc.Read(mapname, namelen);
mapname[namelen] = 0;
MapName = mapname;
}
else arc << MapName;
TheDefaultLevelInfo.snapshotVer = snapver; TheDefaultLevelInfo.snapshotVer = snapver;
TheDefaultLevelInfo.snapshot = new FCompressedMemFile; TheDefaultLevelInfo.snapshot = new FCompressedMemFile;
TheDefaultLevelInfo.snapshot->Serialize (arc); TheDefaultLevelInfo.snapshot->Serialize (arc);
@ -1842,27 +1806,12 @@ void G_ReadSnapshots (PNGHandle *png)
{ {
FPNGChunkArchive arc (png->File->GetFile(), VIST_ID, chunkLen); FPNGChunkArchive arc (png->File->GetFile(), VIST_ID, chunkLen);
if (SaveVersion < 4508)
{
arc << namelen;
while (namelen != 0)
{
arc.Read(mapname, namelen);
mapname[namelen] = 0;
i = FindLevelInfo(mapname);
i->flags |= LEVEL_VISITED;
arc << namelen;
}
}
else
{
while (arc << MapName, MapName.Len() > 0) while (arc << MapName, MapName.Len() > 0)
{ {
i = FindLevelInfo(MapName); i = FindLevelInfo(MapName);
i->flags |= LEVEL_VISITED; i->flags |= LEVEL_VISITED;
} }
} }
}
chunkLen = (DWORD)M_FindPNGChunk (png, RCLS_ID); chunkLen = (DWORD)M_FindPNGChunk (png, RCLS_ID);
if (chunkLen != 0) if (chunkLen != 0)
@ -1956,8 +1905,6 @@ void P_WriteACSDefereds (FILE *file)
void P_ReadACSDefereds (PNGHandle *png) void P_ReadACSDefereds (PNGHandle *png)
{ {
BYTE namelen;
char mapname[256];
FString MapName; FString MapName;
size_t chunklen; size_t chunklen;
@ -1967,24 +1914,6 @@ void P_ReadACSDefereds (PNGHandle *png)
{ {
FPNGChunkArchive arc (png->File->GetFile(), ACSD_ID, chunklen); FPNGChunkArchive arc (png->File->GetFile(), ACSD_ID, chunklen);
if (SaveVersion < 4508)
{
arc << namelen;
while (namelen != 0)
{
arc.Read(mapname, namelen);
mapname[namelen] = 0;
level_info_t *i = FindLevelInfo(mapname);
if (i == NULL)
{
I_Error("Unknown map '%s' in savegame", mapname);
}
arc << i->defered;
arc << namelen;
}
}
else
{
while (arc << MapName, MapName.Len() > 0) while (arc << MapName, MapName.Len() > 0)
{ {
level_info_t *i = FindLevelInfo(MapName); level_info_t *i = FindLevelInfo(MapName);
@ -1995,7 +1924,6 @@ void P_ReadACSDefereds (PNGHandle *png)
arc << i->defered; arc << i->defered;
} }
} }
}
png->File->ResetFilePtr(); png->File->ResetFilePtr();
} }

View file

@ -24,12 +24,7 @@ IMPLEMENT_CLASS (AHexenArmor)
void ABasicArmor::Serialize (FArchive &arc) void ABasicArmor::Serialize (FArchive &arc)
{ {
Super::Serialize (arc); Super::Serialize (arc);
arc << SavePercent << BonusCount << MaxAbsorb << MaxFullAbsorb << AbsorbCount << ArmorType; arc << SavePercent << BonusCount << MaxAbsorb << MaxFullAbsorb << AbsorbCount << ArmorType << ActualSaveAmount;
if (SaveVersion >= 4511)
{
arc << ActualSaveAmount;
}
} }
//=========================================================================== //===========================================================================

View file

@ -1205,15 +1205,8 @@ IMPLEMENT_CLASS (APowerSpeed)
void APowerSpeed::Serialize(FArchive &arc) void APowerSpeed::Serialize(FArchive &arc)
{ {
Super::Serialize (arc); Super::Serialize (arc);
if (SaveVersion < 4146)
{
SpeedFlags = 0;
}
else
{
arc << SpeedFlags; arc << SpeedFlags;
} }
}
//=========================================================================== //===========================================================================
// //

View file

@ -44,26 +44,6 @@ void DLightningThinker::Serialize (FArchive &arc)
arc << Stopped << NextLightningFlash << LightningFlashCount; arc << Stopped << NextLightningFlash << LightningFlashCount;
if (SaveVersion < 3243)
{
// Do nothing with old savegames and just keep whatever the constructor made
// but read the obsolete data from the savegame
for (i = (numsectors + (numsectors+7)/8); i > 0; --i)
{
if (SaveVersion < 3223)
{
BYTE bytelight;
arc << bytelight;
}
else
{
short shortlight;
arc << shortlight;
}
}
return;
}
if (arc.IsLoading ()) if (arc.IsLoading ())
{ {
if (LightningLightLevels != NULL) if (LightningLightLevels != NULL)

View file

@ -90,16 +90,11 @@ void AWeapon::Serialize (FArchive &arc)
<< MoveCombatDist << MoveCombatDist
<< Ammo1 << Ammo2 << SisterWeapon << GivenAsMorphWeapon << Ammo1 << Ammo2 << SisterWeapon << GivenAsMorphWeapon
<< bAltFire << bAltFire
<< ReloadCounter; << ReloadCounter
if (SaveVersion >= 3615) { << BobStyle << BobSpeed << BobRangeX << BobRangeY
arc << BobStyle << BobSpeed << BobRangeX << BobRangeY; << FOVScale
} << Crosshair
arc << FOVScale << MinSelAmmo1 << MinSelAmmo2;
<< Crosshair;
if (SaveVersion >= 4203)
{
arc << MinSelAmmo1 << MinSelAmmo2;
}
} }
//=========================================================================== //===========================================================================
@ -731,11 +726,8 @@ IMPLEMENT_CLASS(AWeaponGiver)
void AWeaponGiver::Serialize(FArchive &arc) void AWeaponGiver::Serialize(FArchive &arc)
{ {
Super::Serialize(arc); Super::Serialize(arc);
if (SaveVersion >= 4246)
{
arc << DropAmmoFactor; arc << DropAmmoFactor;
} }
}
bool AWeaponGiver::TryPickup(AActor *&toucher) bool AWeaponGiver::TryPickup(AActor *&toucher)
{ {

View file

@ -185,48 +185,18 @@ void DHUDMessage::Serialize (FArchive &arc)
arc << Left << Top << CenterX << HoldTics arc << Left << Top << CenterX << HoldTics
<< Tics << State << TextColor << Tics << State << TextColor
<< SBarID << SourceText << Font << Next << SBarID << SourceText << Font << Next
<< HUDWidth << HUDHeight; << HUDWidth << HUDHeight
if (SaveVersion >= 3960) << NoWrap
{ << ClipX << ClipY << ClipWidth << ClipHeight
arc << NoWrap; << WrapWidth
arc << ClipX << ClipY << ClipWidth << ClipHeight; << HandleAspect
arc << WrapWidth; << VisibilityFlags
} << Style << Alpha;
else
{
NoWrap = false;
ClipX = ClipY = ClipWidth = ClipHeight = WrapWidth = 0;
}
if (SaveVersion >= 4525)
{
arc << HandleAspect;
}
else
{
HandleAspect = true;
}
if (arc.IsLoading()) if (arc.IsLoading())
{ {
Lines = NULL; Lines = NULL;
ResetText(SourceText); ResetText(SourceText);
} }
if (SaveVersion < 3821)
{
VisibilityFlags = 0;
}
else
{
arc << VisibilityFlags;
}
if (SaveVersion < 3824)
{
Style = STYLE_Translucent;
Alpha = 1.;
}
else
{
arc << Style << Alpha;
}
} }
//============================================================================ //============================================================================

View file

@ -1650,20 +1650,12 @@ void DBaseStatusBar::ReceivedWeapon (AWeapon *weapon)
} }
void DBaseStatusBar::Serialize (FArchive &arc) void DBaseStatusBar::Serialize (FArchive &arc)
{
if (SaveVersion < 3821)
{
memset(Messages, 0, sizeof(Messages));
arc << Messages[HUDMSGLayer_Default];
}
else
{ {
for (size_t i = 0; i < countof(Messages); ++i) for (size_t i = 0; i < countof(Messages); ++i)
{ {
arc << Messages[i]; arc << Messages[i];
} }
} }
}
void DBaseStatusBar::ScreenSizeChanged () void DBaseStatusBar::ScreenSizeChanged ()
{ {

View file

@ -1654,13 +1654,13 @@ void FBehavior::StaticSerializeModuleStates (FArchive &arc)
if (arc.IsStoring()) if (arc.IsStoring())
{ {
arc.WriteString (module->ModuleName); arc.WriteString (module->ModuleName);
if (SaveVersion >= 4516) arc << ModSize; arc << ModSize;
} }
else else
{ {
char *modname = NULL; char *modname = NULL;
arc << modname; arc << modname;
if (SaveVersion >= 4516) arc << ModSize; arc << ModSize;
if (stricmp (modname, module->ModuleName) != 0) if (stricmp (modname, module->ModuleName) != 0)
{ {
delete[] modname; delete[] modname;
@ -2898,21 +2898,6 @@ void FBehavior::StaticStopMyScripts (AActor *actor)
//========================================================================== //==========================================================================
void P_SerializeACSScriptNumber(FArchive &arc, int &scriptnum, bool was2byte) void P_SerializeACSScriptNumber(FArchive &arc, int &scriptnum, bool was2byte)
{
if (SaveVersion < 3359)
{
if (was2byte)
{
WORD oldver;
arc << oldver;
scriptnum = oldver;
}
else
{
arc << scriptnum;
}
}
else
{ {
arc << scriptnum; arc << scriptnum;
// If the script number is negative, then it's really a name. // If the script number is negative, then it's really a name.
@ -2930,7 +2915,6 @@ void P_SerializeACSScriptNumber(FArchive &arc, int &scriptnum, bool was2byte)
} }
} }
} }
}
//---- The ACS Interpreter ----// //---- The ACS Interpreter ----//
@ -2969,10 +2953,6 @@ void DACSThinker::Serialize (FArchive &arc)
int scriptcount = 0; int scriptcount = 0;
Super::Serialize (arc); Super::Serialize (arc);
if (SaveVersion < 4515)
arc << Scripts << LastScript;
else
{
if (arc.IsStoring()) if (arc.IsStoring())
{ {
DLevelScript *script; DLevelScript *script;
@ -3016,7 +2996,6 @@ void DACSThinker::Serialize (FArchive &arc)
LastScript = Scripts; LastScript = Scripts;
} }
} }
}
if (arc.IsStoring ()) if (arc.IsStoring ())
{ {
ScriptMap::Iterator it(RunningScripts); ScriptMap::Iterator it(RunningScripts);
@ -3102,8 +3081,6 @@ void DLevelScript::Serialize (FArchive &arc)
DWORD i; DWORD i;
Super::Serialize (arc); Super::Serialize (arc);
if (SaveVersion < 4515)
arc << next << prev;
P_SerializeACSScriptNumber(arc, script, false); P_SerializeACSScriptNumber(arc, script, false);
@ -3140,24 +3117,10 @@ void DLevelScript::Serialize (FArchive &arc)
arc << activefont arc << activefont
<< hudwidth << hudheight; << hudwidth << hudheight;
if (SaveVersion >= 3960)
{
arc << ClipRectLeft << ClipRectTop << ClipRectWidth << ClipRectHeight arc << ClipRectLeft << ClipRectTop << ClipRectWidth << ClipRectHeight
<< WrapWidth; << WrapWidth;
}
else
{
ClipRectLeft = ClipRectTop = ClipRectWidth = ClipRectHeight = WrapWidth = 0;
}
if (SaveVersion >= 4058)
{
arc << InModuleScriptNumber; arc << InModuleScriptNumber;
} }
else
{ // Don't worry about locating profiling info for old saves.
InModuleScriptNumber = -1;
}
}
DLevelScript::DLevelScript () DLevelScript::DLevelScript ()
{ {

View file

@ -275,29 +275,17 @@ void AActor::Serialize(FArchive &arc)
arc << dmg; arc << dmg;
Damage = UncalcDamageValue(dmg, GetDefault()->Damage); Damage = UncalcDamageValue(dmg, GetDefault()->Damage);
} }
if (SaveVersion >= 4530)
{
P_SerializeTerrain(arc, floorterrain); P_SerializeTerrain(arc, floorterrain);
} arc << projectileKickback
if (SaveVersion >= 3227) << flags
{
arc << projectileKickback;
}
arc << flags
<< flags2 << flags2
<< flags3 << flags3
<< flags4 << flags4
<< flags5 << flags5
<< flags6; << flags6
if (SaveVersion >= 4504) << flags7
{ << weaponspecial
arc << flags7; << special1
}
if (SaveVersion >= 4512)
{
arc << weaponspecial;
}
arc << special1
<< special2 << special2
<< specialf1 << specialf1
<< specialf2 << specialf2
@ -313,12 +301,9 @@ void AActor::Serialize(FArchive &arc)
<< threshold << threshold
<< player << player
<< SpawnPoint << SpawnPoint
<< SpawnAngle; << SpawnAngle
if (SaveVersion >= 4506) << StartHealth
{ << skillrespawncount
arc << StartHealth;
}
arc << skillrespawncount
<< tracer << tracer
<< Floorclip << Floorclip
<< tid << tid
@ -332,21 +317,13 @@ void AActor::Serialize(FArchive &arc)
arc << args[0]; arc << args[0];
} }
arc << args[1] << args[2] << args[3] << args[4]; arc << args[1] << args[2] << args[3] << args[4];
if (SaveVersion >= 3427)
{
arc << accuracy << stamina; arc << accuracy << stamina;
}
arc << goal arc << goal
<< waterlevel << waterlevel
<< MinMissileChance << MinMissileChance
<< SpawnFlags << SpawnFlags
<< Inventory << Inventory
<< InventoryID; << InventoryID;
if (SaveVersion < 4513)
{
SDWORD id;
arc << id;
}
arc << FloatBobPhase arc << FloatBobPhase
<< Translation << Translation
<< SeeSound << SeeSound
@ -376,16 +353,9 @@ void AActor::Serialize(FArchive &arc)
<< meleethreshold << meleethreshold
<< meleerange << meleerange
<< DamageType; << DamageType;
if (SaveVersion >= 4501)
{
arc << DamageTypeReceived; arc << DamageTypeReceived;
} arc << PainType
if (SaveVersion >= 3237)
{
arc
<< PainType
<< DeathType; << DeathType;
}
arc << Gravity arc << Gravity
<< FastChaseStrafeCount << FastChaseStrafeCount
<< master << master
@ -396,48 +366,23 @@ void AActor::Serialize(FArchive &arc)
<< pushfactor << pushfactor
<< Species << Species
<< Score; << Score;
if (SaveVersion >= 3113)
{
arc << DesignatedTeam; arc << DesignatedTeam;
}
arc << lastpush << lastbump arc << lastpush << lastbump
<< PainThreshold << PainThreshold
<< DamageFactor; << DamageFactor;
if (SaveVersion >= 4516)
{
arc << DamageMultiply; arc << DamageMultiply;
}
else
{
DamageMultiply = 1.;
}
arc << WeaveIndexXY << WeaveIndexZ arc << WeaveIndexXY << WeaveIndexZ
<< PoisonDamageReceived << PoisonDurationReceived << PoisonPeriodReceived << Poisoner << PoisonDamageReceived << PoisonDurationReceived << PoisonPeriodReceived << Poisoner
<< PoisonDamage << PoisonDuration << PoisonPeriod; << PoisonDamage << PoisonDuration << PoisonPeriod;
if (SaveVersion >= 3235)
{
arc << PoisonDamageType << PoisonDamageTypeReceived; arc << PoisonDamageType << PoisonDamageTypeReceived;
}
arc << ConversationRoot << Conversation; arc << ConversationRoot << Conversation;
if (SaveVersion >= 4509)
{
arc << FriendPlayer; arc << FriendPlayer;
}
if (SaveVersion >= 4517)
{
arc << TeleFogSourceType arc << TeleFogSourceType
<< TeleFogDestType; << TeleFogDestType;
}
if (SaveVersion >= 4518)
{
arc << RipperLevel arc << RipperLevel
<< RipLevelMin << RipLevelMin
<< RipLevelMax; << RipLevelMax;
}
if (SaveVersion >= 4533)
{
arc << DefThreshold; arc << DefThreshold;
}
{ {
FString tagstr; FString tagstr;

View file

@ -341,22 +341,8 @@ void P_SerializeWorld (FArchive &arc)
{ {
arc << sec->floorplane arc << sec->floorplane
<< sec->ceilingplane; << sec->ceilingplane;
if (SaveVersion < 3223)
{
BYTE bytelight;
arc << bytelight;
sec->lightlevel = bytelight;
}
else
{
arc << sec->lightlevel; arc << sec->lightlevel;
}
arc << sec->special; arc << sec->special;
if (SaveVersion < 4523)
{
short tag;
arc << tag;
}
arc << sec->soundtraversed arc << sec->soundtraversed
<< sec->seqType << sec->seqType
<< sec->friction << sec->friction
@ -372,49 +358,12 @@ void P_SerializeWorld (FArchive &arc)
<< sec->heightsec << sec->heightsec
<< sec->bottommap << sec->midmap << sec->topmap << sec->bottommap << sec->midmap << sec->topmap
<< sec->gravity; << sec->gravity;
if (SaveVersion >= 4530)
{
P_SerializeTerrain(arc, sec->terrainnum[0]); P_SerializeTerrain(arc, sec->terrainnum[0]);
P_SerializeTerrain(arc, sec->terrainnum[1]); P_SerializeTerrain(arc, sec->terrainnum[1]);
}
if (SaveVersion >= 4529)
{
arc << sec->damageamount; arc << sec->damageamount;
}
else
{
short dmg;
arc << dmg;
sec->damageamount = dmg;
}
if (SaveVersion >= 4528)
{
arc << sec->damageinterval arc << sec->damageinterval
<< sec->leakydamage << sec->leakydamage
<< sec->damagetype; << sec->damagetype;
}
else
{
short damagemod;
arc << damagemod;
sec->damagetype = MODtoDamageType(damagemod);
if (sec->damageamount < 20)
{
sec->leakydamage = 0;
sec->damageinterval = 32;
}
else if (sec->damageamount < 50)
{
sec->leakydamage = 5;
sec->damageinterval = 32;
}
else
{
sec->leakydamage = 256;
sec->damageinterval = 1;
}
}
arc << sec->SoundTarget arc << sec->SoundTarget
<< sec->SecActTarget << sec->SecActTarget
<< sec->sky << sec->sky
@ -422,13 +371,6 @@ void P_SerializeWorld (FArchive &arc)
<< sec->Flags << sec->Flags
<< sec->SkyBoxes[sector_t::floor] << sec->SkyBoxes[sector_t::ceiling] << sec->SkyBoxes[sector_t::floor] << sec->SkyBoxes[sector_t::ceiling]
<< sec->ZoneNumber; << sec->ZoneNumber;
if (SaveVersion < 4529)
{
short secretsector;
arc << secretsector;
if (secretsector) sec->Flags |= SECF_WASSECRET;
P_InitSectorSpecial(sec, sec->special, true);
}
arc << sec->interpolations[0] arc << sec->interpolations[0]
<< sec->interpolations[1] << sec->interpolations[1]
<< sec->interpolations[2] << sec->interpolations[2]
@ -461,11 +403,6 @@ void P_SerializeWorld (FArchive &arc)
<< li->special << li->special
<< li->Alpha; << li->Alpha;
if (SaveVersion < 4523)
{
int id;
arc << id;
}
if (P_IsACSSpecial(li->special)) if (P_IsACSSpecial(li->special))
{ {
P_SerializeACSScriptNumber(arc, li->args[0], false); P_SerializeACSScriptNumber(arc, li->args[0], false);
@ -476,12 +413,7 @@ void P_SerializeWorld (FArchive &arc)
} }
arc << li->args[1] << li->args[2] << li->args[3] << li->args[4]; arc << li->args[1] << li->args[2] << li->args[3] << li->args[4];
if (SaveVersion >= 4532)
{
arc << li->portalindex; arc << li->portalindex;
}
else li->portalindex = UINT_MAX;
for (j = 0; j < 2; j++) for (j = 0; j < 2; j++)
{ {
if (li->sidedef[j] == NULL) if (li->sidedef[j] == NULL)
@ -517,14 +449,7 @@ void P_SerializeWorld (FArchive &arc)
arc << zn->Environment; arc << zn->Environment;
} }
if (SaveVersion >= 4532)
{
arc << linePortals; arc << linePortals;
}
else
{
linePortals.Clear();
}
P_CollectLinkedPortals(); P_CollectLinkedPortals();
} }

View file

@ -1051,17 +1051,6 @@ double sector_t::NextLowestFloorAt(double x, double y, double z, int flags, doub
//=========================================================================== //===========================================================================
FArchive &operator<< (FArchive &arc, secspecial_t &p) FArchive &operator<< (FArchive &arc, secspecial_t &p)
{
if (SaveVersion < 4529)
{
int special;
arc << special;
sector_t sec;
memset(&sec, 0, sizeof(sec));
P_InitSectorSpecial(&sec, special, true);
sec.GetSpecial(&p);
}
else
{ {
arc << p.special arc << p.special
<< p.damageamount << p.damageamount
@ -1069,7 +1058,6 @@ FArchive &operator<< (FArchive &arc, secspecial_t &p)
<< p.damageinterval << p.damageinterval
<< p.leakydamage << p.leakydamage
<< p.Flags; << p.Flags;
}
return arc; return arc;
} }

View file

@ -665,16 +665,7 @@ IMPLEMENT_CLASS (DLightTransfer)
void DLightTransfer::Serialize (FArchive &arc) void DLightTransfer::Serialize (FArchive &arc)
{ {
Super::Serialize (arc); Super::Serialize (arc);
if (SaveVersion < 3223)
{
BYTE bytelight;
arc << bytelight;
LastLight = bytelight;
}
else
{
arc << LastLight; arc << LastLight;
}
arc << Source << TargetTag << CopyFloor; arc << Source << TargetTag << CopyFloor;
} }
@ -762,16 +753,7 @@ IMPLEMENT_CLASS (DWallLightTransfer)
void DWallLightTransfer::Serialize (FArchive &arc) void DWallLightTransfer::Serialize (FArchive &arc)
{ {
Super::Serialize (arc); Super::Serialize (arc);
if (SaveVersion < 3223)
{
BYTE bytelight;
arc << bytelight;
LastLight = bytelight;
}
else
{
arc << LastLight; arc << LastLight;
}
arc << Source << TargetID << Flags; arc << Source << TargetID << Flags;
} }
@ -1058,7 +1040,7 @@ static void P_SetupSectorDamage(sector_t *sector, int damage, int interval, int
// ('fromload' is necessary to allow conversion upon savegame load.) // ('fromload' is necessary to allow conversion upon savegame load.)
// //
void P_InitSectorSpecial(sector_t *sector, int special, bool nothinkers) void P_InitSectorSpecial(sector_t *sector, int special)
{ {
// [RH] All secret sectors are marked with a BOOM-ish bitfield // [RH] All secret sectors are marked with a BOOM-ish bitfield
if (sector->special & SECRET_MASK) if (sector->special & SECRET_MASK)
@ -1093,28 +1075,28 @@ void P_InitSectorSpecial(sector_t *sector, int special, bool nothinkers)
switch (sector->special) switch (sector->special)
{ {
case Light_Phased: case Light_Phased:
if (!nothinkers) new DPhased (sector, 48, 63 - (sector->lightlevel & 63)); new DPhased (sector, 48, 63 - (sector->lightlevel & 63));
break; break;
// [RH] Hexen-like phased lighting // [RH] Hexen-like phased lighting
case LightSequenceStart: case LightSequenceStart:
if (!nothinkers) new DPhased (sector); new DPhased (sector);
break; break;
case dLight_Flicker: case dLight_Flicker:
if (!nothinkers) new DLightFlash (sector); new DLightFlash (sector);
break; break;
case dLight_StrobeFast: case dLight_StrobeFast:
if (!nothinkers) new DStrobe (sector, STROBEBRIGHT, FASTDARK, false); new DStrobe (sector, STROBEBRIGHT, FASTDARK, false);
break; break;
case dLight_StrobeSlow: case dLight_StrobeSlow:
if (!nothinkers) new DStrobe (sector, STROBEBRIGHT, SLOWDARK, false); new DStrobe (sector, STROBEBRIGHT, SLOWDARK, false);
break; break;
case dLight_Strobe_Hurt: case dLight_Strobe_Hurt:
if (!nothinkers) new DStrobe (sector, STROBEBRIGHT, FASTDARK, false); new DStrobe (sector, STROBEBRIGHT, FASTDARK, false);
P_SetupSectorDamage(sector, 20, 32, 5, NAME_Slime, 0); P_SetupSectorDamage(sector, 20, 32, 5, NAME_Slime, 0);
break; break;
@ -1127,7 +1109,7 @@ void P_InitSectorSpecial(sector_t *sector, int special, bool nothinkers)
break; break;
case dLight_Glow: case dLight_Glow:
if (!nothinkers) new DGlow (sector); new DGlow (sector);
break; break;
case dSector_DoorCloseIn30: case dSector_DoorCloseIn30:
@ -1139,11 +1121,11 @@ void P_InitSectorSpecial(sector_t *sector, int special, bool nothinkers)
break; break;
case dLight_StrobeSlowSync: case dLight_StrobeSlowSync:
if (!nothinkers) new DStrobe (sector, STROBEBRIGHT, SLOWDARK, true); new DStrobe (sector, STROBEBRIGHT, SLOWDARK, true);
break; break;
case dLight_StrobeFastSync: case dLight_StrobeFastSync:
if (!nothinkers) new DStrobe (sector, STROBEBRIGHT, FASTDARK, true); new DStrobe (sector, STROBEBRIGHT, FASTDARK, true);
break; break;
case dSector_DoorRaiseIn5Mins: case dSector_DoorRaiseIn5Mins:
@ -1161,7 +1143,7 @@ void P_InitSectorSpecial(sector_t *sector, int special, bool nothinkers)
break; break;
case dLight_FireFlicker: case dLight_FireFlicker:
if (!nothinkers) new DFireFlicker (sector); new DFireFlicker (sector);
break; break;
case dDamage_LavaWimpy: case dDamage_LavaWimpy:
@ -1174,11 +1156,8 @@ void P_InitSectorSpecial(sector_t *sector, int special, bool nothinkers)
case dScroll_EastLavaDamage: case dScroll_EastLavaDamage:
P_SetupSectorDamage(sector, 5, 32, 256, NAME_Fire, SECF_DMGTERRAINFX); P_SetupSectorDamage(sector, 5, 32, 256, NAME_Fire, SECF_DMGTERRAINFX);
if (!nothinkers)
{
new DStrobe(sector, STROBEBRIGHT, FASTDARK, false); new DStrobe(sector, STROBEBRIGHT, FASTDARK, false);
P_CreateScroller(EScroll::sc_floor, -4., 0, -1, int(sector - sectors), 0); P_CreateScroller(EScroll::sc_floor, -4., 0, -1, int(sector - sectors), 0);
}
keepspecial = true; keepspecial = true;
break; break;
@ -1188,7 +1167,7 @@ void P_InitSectorSpecial(sector_t *sector, int special, bool nothinkers)
case sLight_Strobe_Hurt: case sLight_Strobe_Hurt:
P_SetupSectorDamage(sector, 5, 32, 0, NAME_Slime, 0); P_SetupSectorDamage(sector, 5, 32, 0, NAME_Slime, 0);
if (!nothinkers) new DStrobe (sector, STROBEBRIGHT, FASTDARK, false); new DStrobe (sector, STROBEBRIGHT, FASTDARK, false);
break; break;
case sDamage_Hellslime: case sDamage_Hellslime:
@ -1237,13 +1216,13 @@ void P_InitSectorSpecial(sector_t *sector, int special, bool nothinkers)
int i = sector->special - Scroll_North_Slow; int i = sector->special - Scroll_North_Slow;
double dx = hexenScrollies[i][0] / 2.; double dx = hexenScrollies[i][0] / 2.;
double dy = hexenScrollies[i][1] / 2.; double dy = hexenScrollies[i][1] / 2.;
if (!nothinkers) P_CreateScroller(EScroll::sc_floor, dx, dy, -1, int(sector-sectors), 0); P_CreateScroller(EScroll::sc_floor, dx, dy, -1, int(sector-sectors), 0);
} }
else if (sector->special >= Carry_East5 && else if (sector->special >= Carry_East5 &&
sector->special <= Carry_East35) sector->special <= Carry_East35)
{ // Heretic scroll special { // Heretic scroll special
// Only east scrollers also scroll the texture // Only east scrollers also scroll the texture
if (!nothinkers) P_CreateScroller(EScroll::sc_floor, P_CreateScroller(EScroll::sc_floor,
-0.5 * (1 << ((sector->special & 0xff) - Carry_East5)), 0, -1, int(sector-sectors), 0); -0.5 * (1 << ((sector->special & 0xff) - Carry_East5)), 0, -1, int(sector-sectors), 0);
} }
keepspecial = true; keepspecial = true;
@ -1272,7 +1251,7 @@ void P_SpawnSpecials (void)
if (sector->special == 0) if (sector->special == 0)
continue; continue;
P_InitSectorSpecial(sector, sector->special, false); P_InitSectorSpecial(sector, sector->special);
} }
#ifndef NO_EDATA #ifndef NO_EDATA

View file

@ -643,29 +643,11 @@ void APlayerPawn::Serialize (FArchive &arc)
<< DamageFade << DamageFade
<< PlayerFlags << PlayerFlags
<< FlechetteType; << FlechetteType;
if (SaveVersion < 3829)
{
GruntSpeed = 12;
FallingScreamMinSpeed = 35;
FallingScreamMaxSpeed = 40;
}
else
{
arc << GruntSpeed << FallingScreamMinSpeed << FallingScreamMaxSpeed; arc << GruntSpeed << FallingScreamMinSpeed << FallingScreamMaxSpeed;
}
if (SaveVersion >= 4502)
{
arc << UseRange; arc << UseRange;
}
if (SaveVersion >= 4503)
{
arc << AirCapacity; arc << AirCapacity;
}
if (SaveVersion >= 4526)
{
arc << ViewHeight; arc << ViewHeight;
} }
}
//=========================================================================== //===========================================================================
// //
@ -3039,11 +3021,6 @@ void player_t::Serialize (FArchive &arc)
<< centering << centering
<< health << health
<< inventorytics; << inventorytics;
if (SaveVersion < 4513)
{
bool backpack;
arc << backpack;
}
arc << fragcount arc << fragcount
<< spreecount << spreecount
<< multicount << multicount
@ -3074,50 +3051,14 @@ void player_t::Serialize (FArchive &arc)
<< air_finished << air_finished
<< turnticks << turnticks
<< oldbuttons; << oldbuttons;
if (SaveVersion >= 4929)
{
arc << hazardtype arc << hazardtype
<< hazardinterval; << hazardinterval;
}
bool IsBot = false;
if (SaveVersion >= 4514)
{
arc << Bot; arc << Bot;
}
else
{
arc << IsBot;
}
arc << BlendR arc << BlendR
<< BlendG << BlendG
<< BlendB << BlendB
<< BlendA; << BlendA;
if (SaveVersion < 3427)
{
WORD oldaccuracy, oldstamina;
arc << oldaccuracy << oldstamina;
if (mo != NULL)
{
mo->accuracy = oldaccuracy;
mo->stamina = oldstamina;
}
}
if (SaveVersion < 4041)
{
// Move weapon state flags from cheats and into WeaponState.
WeaponState = ((cheats >> 14) & 1) | ((cheats & (0x37 << 24)) >> (24 - 1));
cheats &= ~((1 << 14) | (0x37 << 24));
}
if (SaveVersion < 4527)
{
BYTE oldWeaponState;
arc << oldWeaponState;
WeaponState = oldWeaponState;
}
else
{
arc << WeaponState; arc << WeaponState;
}
arc << LogText arc << LogText
<< ConversationNPC << ConversationNPC
<< ConversationPC << ConversationPC
@ -3137,45 +3078,10 @@ void player_t::Serialize (FArchive &arc)
<< crouchviewdelta << crouchviewdelta
<< original_cmd << original_cmd
<< original_oldbuttons; << original_oldbuttons;
if (SaveVersion >= 3475)
{
arc << poisontype << poisonpaintype; arc << poisontype << poisonpaintype;
}
else if (poisoner != NULL)
{
poisontype = poisoner->DamageType;
poisonpaintype = poisoner->PainType != NAME_None ? poisoner->PainType : poisoner->DamageType;
}
if (SaveVersion >= 3599)
{
arc << timefreezer; arc << timefreezer;
}
else
{
cheats &= ~(1 << 15); // make sure old CF_TIMEFREEZE bit is cleared
}
if (SaveVersion < 3640)
{
cheats &= ~(1 << 17); // make sure old CF_REGENERATION bit is cleared
}
if (SaveVersion >= 3780)
{
arc << settings_controller; arc << settings_controller;
}
else
{
settings_controller = (this - players == Net_Arbitrator);
}
if (SaveVersion >= 4505)
{
arc << onground; arc << onground;
}
else
{
onground = (mo->Z() <= mo->floorz) || (mo->flags2 & MF2_ONMOBJ) || (mo->BounceFlags & BOUNCE_MBF) || (cheats & CF_NOCLIP2);
}
if (arc.IsLoading ()) if (arc.IsLoading ())
{ {
@ -3188,11 +3094,8 @@ void player_t::Serialize (FArchive &arc)
{ {
userinfo.SkinChanged(skinname, CurrentPlayerClass); userinfo.SkinChanged(skinname, CurrentPlayerClass);
} }
if (SaveVersion >= 4522)
{
arc << MUSINFOactor << MUSINFOtics; arc << MUSINFOactor << MUSINFOtics;
} }
}
bool P_IsPlayerTotallyFrozen(const player_t *player) bool P_IsPlayerTotallyFrozen(const player_t *player)
{ {

View file

@ -72,11 +72,11 @@ const char *GetVersionString();
// SAVESIG should match SAVEVER. // SAVESIG should match SAVEVER.
// MINSAVEVER is the minimum level snapshot version that can be loaded. // MINSAVEVER is the minimum level snapshot version that can be loaded.
#define MINSAVEVER 4535 #define MINSAVEVER 4536
// Use 4500 as the base git save version, since it's higher than the // Use 4500 as the base git save version, since it's higher than the
// SVN revision ever got. // SVN revision ever got.
#define SAVEVER 4535 #define SAVEVER 4536
#define SAVEVERSTRINGIFY2(x) #x #define SAVEVERSTRINGIFY2(x) #x
#define SAVEVERSTRINGIFY(x) SAVEVERSTRINGIFY2(x) #define SAVEVERSTRINGIFY(x) SAVEVERSTRINGIFY2(x)