0
0
Fork 0
mirror of https://github.com/dhewm/dhewm3.git synced 2025-03-21 10:11:01 +00:00

Bump SAVEGAME_VERSION to 18 for the CstDoom3 GUI changes

incl. backwards compat for older savegames.
only partly useful: old savegames only work if you didn't change the
gamedata, with the CstDoom3 .gui files, loading them crashes. I don't
think that can be avoided, apparently Doom3 has no way to detect that
the GUIs have changed?
This commit is contained in:
Daniel Gibson 2025-01-18 03:44:37 +01:00
parent 565d3e3fc1
commit f3192be0f8
4 changed files with 20 additions and 13 deletions

View file

@ -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

View file

@ -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 );

View file

@ -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;

View file

@ -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