diff options
author | Filippos Karapetis | 2013-01-04 13:24:43 +0200 |
---|---|---|
committer | Filippos Karapetis | 2013-01-04 13:24:43 +0200 |
commit | 92dc12a3b207833ee7f5a24516d198ca2c997b7c (patch) | |
tree | be26c926e2c68dd3ec9e9df02afce9f8fdf7ba09 /engines | |
parent | fe9228d4bba6f7e38068fe60e1dbacf61bfb8016 (diff) | |
download | scummvm-rg350-92dc12a3b207833ee7f5a24516d198ca2c997b7c.tar.gz scummvm-rg350-92dc12a3b207833ee7f5a24516d198ca2c997b7c.tar.bz2 scummvm-rg350-92dc12a3b207833ee7f5a24516d198ca2c997b7c.zip |
DRASCULA: Properly set the game play time when loading a saved game
Diffstat (limited to 'engines')
-rw-r--r-- | engines/drascula/detection.cpp | 6 | ||||
-rw-r--r-- | engines/drascula/saveload.cpp | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/engines/drascula/detection.cpp b/engines/drascula/detection.cpp index 573cad09e0..e1f69e2158 100644 --- a/engines/drascula/detection.cpp +++ b/engines/drascula/detection.cpp @@ -273,7 +273,7 @@ static const ExtraGuiOption drasculaExtraGuiOption = { false }; -SaveStateDescriptor loadMetaData(Common::ReadStream *s, int slot); +SaveStateDescriptor loadMetaData(Common::ReadStream *s, int slot, bool setPlayTime); class DrasculaMetaEngine : public AdvancedMetaEngine { public: @@ -334,7 +334,7 @@ SaveStateList DrasculaMetaEngine::listSaves(const char *target) const { if (slotNum >= 0 && slotNum <= getMaximumSaveSlot()) { Common::InSaveFile *in = saveFileMan->openForLoading(*file); if (in) { - SaveStateDescriptor desc = loadMetaData(in, slotNum); + SaveStateDescriptor desc = loadMetaData(in, slotNum, false); if (desc.getSaveSlot() != slotNum) { // invalid delete in; @@ -362,7 +362,7 @@ SaveStateDescriptor DrasculaMetaEngine::querySaveMetaInfos(const char *target, i desc.setWriteProtectedFlag(slot == 0); if (in) { - desc = Drascula::loadMetaData(in, slot); + desc = Drascula::loadMetaData(in, slot, false); if (desc.getSaveSlot() != slot) { delete in; return SaveStateDescriptor(); diff --git a/engines/drascula/saveload.cpp b/engines/drascula/saveload.cpp index 46eee1f0b2..ba4148fb76 100644 --- a/engines/drascula/saveload.cpp +++ b/engines/drascula/saveload.cpp @@ -103,7 +103,7 @@ void DrasculaEngine::checkForOldSaveGames() { _saveFileMan->removeSavefile(indexFileName); } -SaveStateDescriptor loadMetaData(Common::ReadStream *s, int slot) { +SaveStateDescriptor loadMetaData(Common::ReadStream *s, int slot, bool setPlayTime) { uint32 sig = s->readUint32BE(); byte version = s->readByte(); @@ -134,6 +134,8 @@ SaveStateDescriptor loadMetaData(Common::ReadStream *s, int slot) { uint32 playTime = s->readUint32LE(); desc.setPlayTime(playTime * 1000); + if (setPlayTime) + g_engine->setTotalPlayTime(playTime * 1000); return desc; } @@ -198,7 +200,7 @@ void DrasculaEngine::loadSaveNames() { for (int n = 0; n < NUM_SAVES; n++) { saveFileName = Common::String::format("%s.%03d", _targetName.c_str(), n + 1); if ((in = _saveFileMan->openForLoading(saveFileName))) { - SaveStateDescriptor desc = loadMetaData(in, n + 1); + SaveStateDescriptor desc = loadMetaData(in, n + 1, false); _saveNames[n] = desc.getDescription(); delete in; } @@ -256,10 +258,8 @@ bool DrasculaEngine::loadGame(int slot) { error("missing savegame file %s", saveFileName.c_str()); } - loadMetaData(in, slot); - int t = in->pos(); + loadMetaData(in, slot, true); Graphics::skipThumbnail(*in); - t = in->pos(); savedChapter = in->readSint32LE(); if (savedChapter != currentChapter) { |