From 10b71b09c85b777bc049f0c3a0964f5682835ded Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 5 Jan 2008 09:12:05 +0000 Subject: [PATCH] - Changed savegame versioning to use the SVN revision number instead of an arbitrarily defined value. This reduces the amount of relevant values that have to be defined in version.h to 1 (the minimum compatible savegame version) instead of previously 3. SVN r666 (trunk) --- docs/rh-log.txt | 6 ++++++ src/g_game.cpp | 4 ++-- src/version.h | 6 +++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index f780a2e5f0..fdfa61a065 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,9 @@ +January 5, 2008 (Changes by Graf Zahl) +- Changed savegame versioning to use the SVN revision number instead of + an arbitrarily defined value. This reduces the amount of relevant values + that have to be defined in version.h to 1 (the minimum compatible savegame + version) instead of previously 3. + January 4, 2008 - Fixed: FBarShader::PrepareShader() set a member variable to point at a local variable just before returning. Then I made some more changes so that diff --git a/src/g_game.cpp b/src/g_game.cpp index 104abf94e9..0ad90534fd 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -1684,7 +1684,7 @@ static void ReadArrayVars (PNGHandle *png, FWorldGlobalArray *vars, size_t count void G_DoLoadGame () { - char sigcheck[16]; + char sigcheck[20]; char *text = NULL; char *map; @@ -1733,7 +1733,7 @@ void G_DoLoadGame () delete[] engine; } - if (!M_GetPNGText (png, "ZDoom Save Version", sigcheck, 16) || + if (!M_GetPNGText (png, "ZDoom Save Version", sigcheck, 20) || 0 != strncmp (sigcheck, SAVESIG, 9) || // ZDOOMSAVE is the first 9 chars (SaveVersion = atoi (sigcheck+9)) < MINSAVEVER) { diff --git a/src/version.h b/src/version.h index 0d1c098a15..1962e07c05 100644 --- a/src/version.h +++ b/src/version.h @@ -73,8 +73,8 @@ // SAVEVER is the version of the information stored in level snapshots. // Note that SAVEVER is not directly comparable to VERSION. // SAVESIG should match SAVEVER. -#define SAVEVER 237 -#define SAVESIG "ZDOOMSAVE237" +#define SAVEVER SVN_REVISION_NUMBER +#define SAVESIG "ZDOOMSAVE"SVN_REVISION_STRING // This is so that derivates can use the same savegame versions without worrying about engine compatibility #define GAMESIG "ZDOOM" @@ -92,7 +92,7 @@ #endif // MINSAVEVER is the minimum level snapshot version that can be loaded. -#define MINSAVEVER 237 // Used by 2.1.8 +#define MINSAVEVER 665 // The maximum length of one save game description for the menus. #define SAVESTRINGSIZE 24