From 7853a9db6cd6a60131581107d89f6839ef1f3385 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 2 Nov 2019 22:22:57 +0100 Subject: [PATCH] - do not use EDuke32's savegame identifiers. The engine may be incopatible already and the format will certainly change in the future. --- source/build/src/cache1d.cpp | 1 - source/build/src/defs.cpp | 1 - source/build/src/engine.cpp | 1 - source/build/src/tiles.cpp | 1 - source/duke3d/src/savegame.cpp | 25 +++---------------------- source/rr/src/savegame.cpp | 9 +++------ 6 files changed, 6 insertions(+), 32 deletions(-) diff --git a/source/build/src/cache1d.cpp b/source/build/src/cache1d.cpp index 3c63bc23c..272ed90be 100644 --- a/source/build/src/cache1d.cpp +++ b/source/build/src/cache1d.cpp @@ -16,7 +16,6 @@ #include "cache1d.h" #include "pragmas.h" #include "baselayer.h" -#include "lz4.h" #include "vfs.h" diff --git a/source/build/src/defs.cpp b/source/build/src/defs.cpp index 2f8bedfca..f91098025 100644 --- a/source/build/src/defs.cpp +++ b/source/build/src/defs.cpp @@ -11,7 +11,6 @@ #include "baselayer.h" #include "scriptfile.h" #include "cache1d.h" -#include "lz4.h" #include "common.h" #include "mdsprite.h" // md3model_t #include "colmatch.h" diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 33bfa955c..8c04224e3 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -16,7 +16,6 @@ #include "common.h" #include "compat.h" #include "engine_priv.h" -#include "lz4.h" #include "osd.h" #include "palette.h" #include "pragmas.h" diff --git a/source/build/src/tiles.cpp b/source/build/src/tiles.cpp index 2271a0510..d53892232 100644 --- a/source/build/src/tiles.cpp +++ b/source/build/src/tiles.cpp @@ -11,7 +11,6 @@ #include "baselayer.h" #include "engine_priv.h" #include "cache1d.h" -#include "lz4.h" #include "vfs.h" diff --git a/source/duke3d/src/savegame.cpp b/source/duke3d/src/savegame.cpp index b2e8ca9d1..38d3f9132 100644 --- a/source/duke3d/src/savegame.cpp +++ b/source/duke3d/src/savegame.cpp @@ -1662,7 +1662,7 @@ int32_t sv_saveandmakesnapshot(buildvfs_FILE fil, char const *name, int8_t spot, // create header - Bmemcpy(h.headerstr, "E32SAVEGAME", 11); + Bmemcpy(h.headerstr, "DEDSAVEGAME", 11); h.majorver = SV_MAJOR_VER; h.minorver = SV_MINOR_VER; h.ptrsize = sizeof(intptr_t); @@ -1697,10 +1697,6 @@ int32_t sv_saveandmakesnapshot(buildvfs_FILE fil, char const *name, int8_t spot, { // savegame Bstrncpyz(h.savename, name, sizeof(h.savename)); -#ifdef __ANDROID__ - Bstrncpyz(h.volname, g_volumeNames[ud.volume_number], sizeof(h.volname)); - Bstrncpyz(h.skillname, g_skillNames[ud.player_skill], sizeof(h.skillname)); -#endif } else { @@ -1736,23 +1732,11 @@ int32_t sv_saveandmakesnapshot(buildvfs_FILE fil, char const *name, int8_t spot, buildvfs_fseek_abs(fil, ofs); } -#ifdef DEBUGGINGAIDS - OSD_Printf("sv_saveandmakesnapshot: snapshot size: %d bytes.\n", svsnapsiz); -#endif if (spot >= 0) { // savegame dosaveplayer2(fil, NULL); -#ifdef LUNATIC - if (!g_savedOK) - { - OSD_Printf("sv_saveandmakesnapshot: failed serializing Lunatic gamevar \"%s\".\n", - g_failedVarname); - g_failedVarname = NULL; - return 1; - } -#endif } else { @@ -1783,16 +1767,13 @@ int32_t sv_loadheader(FileReader &fil, int32_t spot, savehead_t *h) return -1; } - if (Bmemcmp(h->headerstr, "E32SAVEGAME", 11) -#if 1 - && Bmemcmp(h->headerstr, "EDuke32SAVE", 11) -#endif + if (Bmemcmp(h->headerstr, "DEDSAVEGAME", 11) ) { char headerCstr[sizeof(h->headerstr) + 1]; Bmemcpy(headerCstr, h->headerstr, sizeof(h->headerstr)); headerCstr[sizeof(h->headerstr)] = '\0'; - OSD_Printf("%s %d header reads \"%s\", expected \"E32SAVEGAME\".\n", + OSD_Printf("%s %d header reads \"%s\", expected \"DEDSAVEGAME\".\n", havedemo ? "Demo":"Savegame", havedemo ? -spot : spot, headerCstr); Bmemset(h->headerstr, 0, sizeof(h->headerstr)); return -2; diff --git a/source/rr/src/savegame.cpp b/source/rr/src/savegame.cpp index abf598c77..b2d4cca44 100644 --- a/source/rr/src/savegame.cpp +++ b/source/rr/src/savegame.cpp @@ -1315,7 +1315,7 @@ int32_t sv_saveandmakesnapshot(FILE *fil, char const *name, int8_t spot, int8_t // create header - Bmemcpy(h.headerstr, "E32SAVEGAME", 11); + Bmemcpy(h.headerstr, "DERSAVEGAME", 11); h.majorver = SV_MAJOR_VER; h.minorver = SV_MINOR_VER; h.ptrsize = sizeof(intptr_t); @@ -1427,16 +1427,13 @@ int32_t sv_loadheader(FileReader &fil, int32_t spot, savehead_t *h) return -1; } - if (Bmemcmp(h->headerstr, "E32SAVEGAME", 11) -#if 1 - && Bmemcmp(h->headerstr, "EDuke32SAVE", 11) -#endif + if (Bmemcmp(h->headerstr, "DERSAVEGAME", 11) ) { char headerCstr[sizeof(h->headerstr) + 1]; Bmemcpy(headerCstr, h->headerstr, sizeof(h->headerstr)); headerCstr[sizeof(h->headerstr)] = '\0'; - OSD_Printf("%s %d header reads \"%s\", expected \"E32SAVEGAME\".\n", + OSD_Printf("%s %d header reads \"%s\", expected \"DERSAVEGAME\".\n", havedemo ? "Demo":"Savegame", havedemo ? -spot : spot, headerCstr); Bmemset(h->headerstr, 0, sizeof(h->headerstr)); return -2;