diff --git a/neo/framework/Licensee.h b/neo/framework/Licensee.h index 53bb4374..ddcff1db 100644 --- a/neo/framework/Licensee.h +++ b/neo/framework/Licensee.h @@ -93,7 +93,8 @@ If you have questions concerning this license or the applicable additional terms // NOTE: a seperate core savegame version and game savegame version could be useful // 16: Doom v1.1 // 17: Doom v1.2 / D3XP. Can still read old v16 with defaults for new data -#define SAVEGAME_VERSION 17 +// 18: dhewm3 with CstDoom3 anchored window support - can still read v16 and v17, unless gamedata changed +#define SAVEGAME_VERSION 18 // <= Doom v1.1: 1. no DS_VERSION token ( default ) // Doom v1.2: 2 diff --git a/neo/framework/Session.cpp b/neo/framework/Session.cpp index 65f205e8..713132fa 100644 --- a/neo/framework/Session.cpp +++ b/neo/framework/Session.cpp @@ -2130,8 +2130,7 @@ bool idSessionLocal::LoadGame( const char *saveName ) { // check the version, if it doesn't match, cancel the loadgame, // but still load the map with the persistant playerInfo from the header // so that the player doesn't lose too much progress. - if ( savegameVersion != SAVEGAME_VERSION && - !( savegameVersion == 16 && SAVEGAME_VERSION == 17 ) ) { // handle savegame v16 in v17 + if ( savegameVersion < 16 || savegameVersion > SAVEGAME_VERSION ) { // dhewm3 supports savegames with v16 - v18 common->Warning( "Savegame Version mismatch: aborting loadgame and starting level with persistent data" ); loadingSaveGame = false; fileSystem->CloseFile( savegameFile ); diff --git a/neo/ui/SimpleWindow.cpp b/neo/ui/SimpleWindow.cpp index 4c986710..b5099b2e 100644 --- a/neo/ui/SimpleWindow.cpp +++ b/neo/ui/SimpleWindow.cpp @@ -27,6 +27,7 @@ If you have questions concerning this license or the applicable additional terms */ #include "sys/platform.h" +#include "framework/Session.h" #include "ui/DeviceContext.h" #include "ui/Window.h" #include "ui/UserInterfaceLocal.h" @@ -476,11 +477,14 @@ void idSimpleWindow::ReadFromSaveGame( idFile *savefile ) { shear.ReadFromSaveGame( savefile ); backGroundName.ReadFromSaveGame( savefile ); - //#modified-fva; BEGIN // FIXME: savegame version? - cstAnchor.ReadFromSaveGame(savefile); - cstAnchorTo.ReadFromSaveGame(savefile); - cstAnchorFactor.ReadFromSaveGame(savefile); - savefile->Read(&cstNoClipBackground, sizeof(cstNoClipBackground)); + //#modified-fva; BEGIN + // TODO: why does this have to be read from the savegame anyway, does it change? + if ( session->GetSaveGameVersion() >= 18 ) { + cstAnchor.ReadFromSaveGame(savefile); + cstAnchorTo.ReadFromSaveGame(savefile); + cstAnchorFactor.ReadFromSaveGame(savefile); + savefile->Read(&cstNoClipBackground, sizeof(cstNoClipBackground)); + } // else keep default values, I guess //#modified-fva; END int stringLen; diff --git a/neo/ui/Window.cpp b/neo/ui/Window.cpp index 8a6802b9..5c1196d6 100644 --- a/neo/ui/Window.cpp +++ b/neo/ui/Window.cpp @@ -3782,11 +3782,14 @@ void idWindow::ReadFromSaveGame( idFile *savefile ) { hideCursor = false; } - //#modified-fva; BEGIN // FIXME: savegame version? - cstAnchor.ReadFromSaveGame(savefile); - cstAnchorTo.ReadFromSaveGame(savefile); - cstAnchorFactor.ReadFromSaveGame(savefile); - savefile->Read(&cstNoClipBackground, sizeof(cstNoClipBackground)); + //#modified-fva; BEGIN + // TODO: why does this have to be read from the savegame anyway, does it change? + if ( session->GetSaveGameVersion() >= 18 ) { + cstAnchor.ReadFromSaveGame(savefile); + cstAnchorTo.ReadFromSaveGame(savefile); + cstAnchorFactor.ReadFromSaveGame(savefile); + savefile->Read(&cstNoClipBackground, sizeof(cstNoClipBackground)); + } // else keep default values, I guess //#modified-fva; END // Defined Vars