mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-31 16:03:24 +00:00
Let Kyra1 and Kyra2 use a common savegame version number. (cleanup)
svn-id: r31155
This commit is contained in:
parent
91a800cf02
commit
c7ede8337e
@ -216,7 +216,6 @@ protected:
|
||||
|
||||
// save/load
|
||||
virtual uint32 saveGameID() const = 0;
|
||||
virtual uint32 curSaveVersion() const = 0;
|
||||
|
||||
const char *getSavegameFilename(int num);
|
||||
Common::InSaveFile *openSaveForReading(const char *filename, uint32 &version, char *saveName);
|
||||
|
@ -281,12 +281,7 @@ public:
|
||||
void snd_voiceWaitForFinish(bool ingame = true);
|
||||
|
||||
protected:
|
||||
enum {
|
||||
kSaveGameVersion = 8
|
||||
};
|
||||
|
||||
uint32 saveGameID() const { return 'KYRA'; }
|
||||
uint32 curSaveVersion() const { return kSaveGameVersion; }
|
||||
|
||||
void saveGame(const char *fileName, const char *saveName);
|
||||
void loadGame(const char *fileName);
|
||||
|
@ -1169,12 +1169,7 @@ protected:
|
||||
int _dbgPass;
|
||||
|
||||
// save/load specific
|
||||
enum {
|
||||
kSaveGameVersion = 1
|
||||
};
|
||||
|
||||
uint32 saveGameID() const { return 'HOFS'; }
|
||||
uint32 curSaveVersion() const { return kSaveGameVersion; }
|
||||
|
||||
void saveGame(const char *fileName, const char *saveName);
|
||||
void loadGame(const char *fileName);
|
||||
|
@ -29,6 +29,8 @@
|
||||
|
||||
#include "kyra/kyra.h"
|
||||
|
||||
#define CURRENT_SAVE_VERSION 8
|
||||
|
||||
#define GF_FLOPPY (1 << 0)
|
||||
#define GF_TALKIE (1 << 1)
|
||||
#define GF_FMTOWNS (1 << 2)
|
||||
@ -56,7 +58,7 @@ Common::InSaveFile *KyraEngine::openSaveForReading(const char *filename, uint32
|
||||
}
|
||||
|
||||
version = in->readUint32BE();
|
||||
if (version > curSaveVersion()) {
|
||||
if (version > CURRENT_SAVE_VERSION) {
|
||||
warning("Savegame is not the right version (%u)", version);
|
||||
delete in;
|
||||
return 0;
|
||||
@ -108,7 +110,7 @@ Common::OutSaveFile *KyraEngine::openSaveForWriting(const char *filename, const
|
||||
|
||||
// Savegame version
|
||||
out->writeUint32BE(saveGameID());
|
||||
out->writeUint32BE(curSaveVersion());
|
||||
out->writeUint32BE(CURRENT_SAVE_VERSION);
|
||||
out->write(saveName, 31);
|
||||
if (_flags.isTalkie)
|
||||
out->writeUint32BE(GF_TALKIE);
|
||||
|
@ -198,9 +198,6 @@ void TimerManager::disable(uint8 id) {
|
||||
void TimerManager::loadDataFromFile(Common::InSaveFile *file, int version) {
|
||||
debugC(9, kDebugLevelTimer, "TimerManager::loadDataFromFile(%p, %d)", (const void*)file, version);
|
||||
|
||||
if (_vm->game() != GI_KYRA1)
|
||||
version += 7;
|
||||
|
||||
if (version <= 7) {
|
||||
_nextRun = 0;
|
||||
for (int i = 0; i < 32; ++i) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user