diff options
author | Filippos Karapetis | 2014-12-08 01:25:27 +0200 |
---|---|---|
committer | Filippos Karapetis | 2014-12-08 01:25:27 +0200 |
commit | ecb1979245fb6695a68286a59f5eaf2c3677b579 (patch) | |
tree | 54f05e27fdc3492eb4b5820164186435a78145ae /engines/zvision | |
parent | a2eaf78255d6a92f8d93e2a3e8907f60c2e6e699 (diff) | |
download | scummvm-rg350-ecb1979245fb6695a68286a59f5eaf2c3677b579.tar.gz scummvm-rg350-ecb1979245fb6695a68286a59f5eaf2c3677b579.tar.bz2 scummvm-rg350-ecb1979245fb6695a68286a59f5eaf2c3677b579.zip |
ZVISION: Implement more advanced engine features
Save game thumbnails and save game creation date have now been
implemented
Diffstat (limited to 'engines/zvision')
-rw-r--r-- | engines/zvision/detection.cpp | 36 | ||||
-rw-r--r-- | engines/zvision/scripting/controls/save_control.cpp | 2 |
2 files changed, 20 insertions, 18 deletions
diff --git a/engines/zvision/detection.cpp b/engines/zvision/detection.cpp index a60ef6040d..ebf5bdcfdd 100644 --- a/engines/zvision/detection.cpp +++ b/engines/zvision/detection.cpp @@ -183,10 +183,10 @@ bool ZVisionMetaEngine::hasFeature(MetaEngineFeature f) const { return (f == kSupportsListSaves) || (f == kSupportsLoadingDuringStartup) || - (f == kSupportsDeleteSave); - //(f == kSavesSupportMetaInfo) || - //(f == kSavesSupportThumbnail) || - //(f == kSavesSupportCreationDate) || + (f == kSupportsDeleteSave) || + (f == kSavesSupportMetaInfo) || + (f == kSavesSupportThumbnail) || + (f == kSavesSupportCreationDate); //(f == kSavesSupportPlayTime); } @@ -293,41 +293,41 @@ void ZVisionMetaEngine::removeSaveState(const char *target, int slot) const { } SaveStateDescriptor ZVisionMetaEngine::querySaveMetaInfos(const char *target, int slot) const { - /* - Common::String filename = ZVision::ZVision::getSavegameFilename(target, slot); + Common::String filename = Common::String::format("%s.%03u", target, slot); Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(filename.c_str()); if (in) { - ZVision::ZVision::SaveHeader header; - ZVision::ZVision::kReadSaveHeaderError error; + ZVision::SaveGameHeader header; - error = ZVision::ZVision::readSaveHeader(in, true, header); + // We only use readSaveGameHeader() here, which doesn't need an engine callback + ZVision::SaveManager *zvisionSaveMan = new ZVision::SaveManager(NULL); + bool successfulRead = zvisionSaveMan->readSaveGameHeader(in, header); + delete zvisionSaveMan; delete in; - if (error == ZVision::ZVision::kRSHENoError) { - SaveStateDescriptor desc(slot, header.description); + if (successfulRead) { + SaveStateDescriptor desc(slot, header.saveName); desc.setThumbnail(header.thumbnail); if (header.version > 0) { - int day = (header.saveDate >> 24) & 0xFF; - int month = (header.saveDate >> 16) & 0xFF; - int year = header.saveDate & 0xFFFF; + int day = header.saveDay; + int month = header.saveMonth; + int year = header.saveYear; desc.setSaveDate(year, month, day); - int hour = (header.saveTime >> 16) & 0xFF; - int minutes = (header.saveTime >> 8) & 0xFF; + int hour = header.saveHour; + int minutes = header.saveMinutes; desc.setSaveTime(hour, minutes); - desc.setPlayTime(header.playTime * 1000); + //desc.setPlayTime(header.playTime * 1000); } return desc; } } - */ return SaveStateDescriptor(); } diff --git a/engines/zvision/scripting/controls/save_control.cpp b/engines/zvision/scripting/controls/save_control.cpp index ad01257e6b..d773b5fc6f 100644 --- a/engines/zvision/scripting/controls/save_control.cpp +++ b/engines/zvision/scripting/controls/save_control.cpp @@ -101,6 +101,8 @@ bool SaveControl::process(uint32 deltaTimeInMillis) { toSave = false; if (toSave) { + // FIXME: At this point, the screen shows the save control, so the save game thumbnails will always + // show the save control _engine->getSaveManager()->saveGameBuffered(iter->saveId, inp->getText()); _engine->delayedMessage(_engine->getStringManager()->getTextLine(StringManager::ZVISION_STR_SAVED), 2000); _engine->getScriptManager()->changeLocation(_engine->getScriptManager()->getLastMenuLocation()); |