[Scummvm-git-logs] scummvm master -> 503b9c16d2f52f633988aea986fc8d350f894ead
dreammaster
dreammaster at scummvm.org
Sun Aug 6 00:34:57 CEST 2017
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
503b9c16d2 TITANIC: Don't show invalid meta info for original game saves
Commit: 503b9c16d2f52f633988aea986fc8d350f894ead
https://github.com/scummvm/scummvm/commit/503b9c16d2f52f633988aea986fc8d350f894ead
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-08-05T18:34:50-04:00
Commit Message:
TITANIC: Don't show invalid meta info for original game saves
Changed paths:
engines/titanic/core/project_item.cpp
engines/titanic/core/project_item.h
engines/titanic/detection.cpp
diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp
index b16d076..fa902e6 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 14ca3fd..71a84f7 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 098c20c..5fad72a 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;
}
More information about the Scummvm-git-logs
mailing list