- 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
commit 3ee42f6aa6
15 changed files with 150 additions and 604 deletions

View file

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