aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2017-08-05 18:34:50 -0400
committerPaul Gilbert2017-08-05 18:34:50 -0400
commit503b9c16d2f52f633988aea986fc8d350f894ead (patch)
tree46792121ef46a2316365c6cb6c92ec4e3907ab25 /engines
parent9d2ca34ae4e7ae710e51edb4259006caf211de5b (diff)
downloadscummvm-rg350-503b9c16d2f52f633988aea986fc8d350f894ead.tar.gz
scummvm-rg350-503b9c16d2f52f633988aea986fc8d350f894ead.tar.bz2
scummvm-rg350-503b9c16d2f52f633988aea986fc8d350f894ead.zip
TITANIC: Don't show invalid meta info for original game saves
Diffstat (limited to 'engines')
-rw-r--r--engines/titanic/core/project_item.cpp13
-rw-r--r--engines/titanic/core/project_item.h7
-rw-r--r--engines/titanic/detection.cpp11
3 files changed, 27 insertions, 4 deletions
diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp
index b16d076f14..fa902e6ab7 100644
--- a/engines/titanic/core/project_item.cpp
+++ b/engines/titanic/core/project_item.cpp
@@ -42,6 +42,19 @@ static const char *const SAVEGAME_STR = "TNIC";
EMPTY_MESSAGE_MAP(CProjectItem, CFileItem);
+/*------------------------------------------------------------------------*/
+
+void TitanicSavegameHeader::clear() {
+ _version = 0;
+ _saveName = "";
+ _thumbnail = nullptr;
+ _year = _month = _day = 0;
+ _hour = _minute = 0;
+ _totalFrames = 0;
+}
+
+/*------------------------------------------------------------------------*/
+
void CFileListItem::save(SimpleFile *file, int indent) {
file->writeNumberLine(0, indent);
file->writeQuotedLine(_name, indent);
diff --git a/engines/titanic/core/project_item.h b/engines/titanic/core/project_item.h
index 14ca3fd229..71a84f7e00 100644
--- a/engines/titanic/core/project_item.h
+++ b/engines/titanic/core/project_item.h
@@ -42,6 +42,13 @@ struct TitanicSavegameHeader {
int _year, _month, _day;
int _hour, _minute;
int _totalFrames;
+
+ TitanicSavegameHeader() { clear(); }
+
+ /**
+ * Clear the header
+ */
+ void clear();
};
diff --git a/engines/titanic/detection.cpp b/engines/titanic/detection.cpp
index 098c20ca1d..5fad72a9df 100644
--- a/engines/titanic/detection.cpp
+++ b/engines/titanic/detection.cpp
@@ -167,10 +167,13 @@ SaveStateDescriptor TitanicMetaEngine::querySaveMetaInfos(const char *target, in
// Create the return descriptor
SaveStateDescriptor desc(slot, header._saveName);
- desc.setThumbnail(header._thumbnail);
- desc.setSaveDate(header._year, header._month, header._day);
- desc.setSaveTime(header._hour, header._minute);
- desc.setPlayTime(header._totalFrames * GAME_FRAME_TIME);
+
+ if (header._version) {
+ desc.setThumbnail(header._thumbnail);
+ desc.setSaveDate(header._year, header._month, header._day);
+ desc.setSaveTime(header._hour, header._minute);
+ desc.setPlayTime(header._totalFrames * GAME_FRAME_TIME);
+ }
return desc;
}