diff options
-rw-r--r-- | engines/supernova/detection.cpp | 3 | ||||
-rw-r--r-- | engines/supernova/supernova.cpp | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/engines/supernova/detection.cpp b/engines/supernova/detection.cpp index b587dbb623..bf7d6bf177 100644 --- a/engines/supernova/detection.cpp +++ b/engines/supernova/detection.cpp @@ -101,6 +101,7 @@ bool SupernovaMetaEngine::hasFeature(MetaEngineFeature f) const { // fallthrough case kSavesSupportCreationDate: // fallthrough + case kSavesSupportPlayTime: return true; default: return false; @@ -187,6 +188,8 @@ SaveStateDescriptor SupernovaMetaEngine::querySaveMetaInfos(const char *target, int minutes = saveTime & 0xFF; desc.setSaveTime(hour, minutes); + uint32 playTime =savefile->readUint32LE(); + desc.setPlayTime(playTime * 1000); if (Graphics::checkThumbnailHeader(*savefile)) { Graphics::Surface *const thumbnail = Graphics::loadThumbnail(*savefile); diff --git a/engines/supernova/supernova.cpp b/engines/supernova/supernova.cpp index ad5d8af501..9526481fdf 100644 --- a/engines/supernova/supernova.cpp +++ b/engines/supernova/supernova.cpp @@ -148,6 +148,8 @@ Common::Error SupernovaEngine::run() { CursorMan.replaceCursorPalette(initVGAPalette, 0, 16); CursorMan.showMouse(true); + setTotalPlayTime(0); + int saveSlot = ConfMan.getInt("save_slot"); if (saveSlot >= 0) { if (loadGameState(saveSlot).getCode() != Common::kNoError) @@ -837,6 +839,7 @@ bool SupernovaEngine::loadGame(int slot) { int descriptionSize = savefile->readSint16LE(); savefile->skip(descriptionSize); savefile->skip(6); + setTotalPlayTime(savefile->readUint32LE() * 1000); Graphics::skipThumbnail(*savefile); _gm->deserialize(savefile); @@ -866,6 +869,7 @@ bool SupernovaEngine::saveGame(int slot, const Common::String &description) { savefile->write(description.c_str(), description.size() + 1); savefile->writeUint32LE(saveDate); savefile->writeUint16LE(saveTime); + savefile->writeUint32LE(getTotalPlayTime() / 1000); Graphics::saveThumbnail(*savefile); _gm->serialize(savefile); |