diff options
author | Andrei Prykhodko | 2018-06-29 12:56:20 +0300 |
---|---|---|
committer | Andrei Prykhodko | 2018-06-29 12:56:20 +0300 |
commit | 6eaa7df0bc7342703615737ded61f68079333484 (patch) | |
tree | cd4824f1a7be74023ecaca26c1aebb2765c79e68 /engines | |
parent | 66d8fca8b38cc8928e21ce30ffae1a05eb02c1b9 (diff) | |
download | scummvm-rg350-6eaa7df0bc7342703615737ded61f68079333484.tar.gz scummvm-rg350-6eaa7df0bc7342703615737ded61f68079333484.tar.bz2 scummvm-rg350-6eaa7df0bc7342703615737ded61f68079333484.zip |
PINK: added loading of thumbnail only when necessary
Diffstat (limited to 'engines')
-rw-r--r-- | engines/pink/detection.cpp | 2 | ||||
-rw-r--r-- | engines/pink/pink.h | 2 | ||||
-rw-r--r-- | engines/pink/saveload.cpp | 8 |
3 files changed, 5 insertions, 7 deletions
diff --git a/engines/pink/detection.cpp b/engines/pink/detection.cpp index 3e3e177841..c6715d17a9 100644 --- a/engines/pink/detection.cpp +++ b/engines/pink/detection.cpp @@ -108,7 +108,7 @@ SaveStateDescriptor PinkMetaEngine::querySaveMetaInfos(const char *target, int s if (f) { SaveStateDescriptor desc; - if (!Pink::readSaveHeader(*f.get(), desc)) + if (!Pink::readSaveHeader(*f.get(), desc, false)) return SaveStateDescriptor(); return desc; diff --git a/engines/pink/pink.h b/engines/pink/pink.h index 637a244be8..e5dc40713f 100644 --- a/engines/pink/pink.h +++ b/engines/pink/pink.h @@ -149,7 +149,7 @@ private: const ADGameDescription _desc; }; -bool readSaveHeader(Common::InSaveFile &in, SaveStateDescriptor &desc); +WARN_UNUSED_RESULT bool readSaveHeader(Common::InSaveFile &in, SaveStateDescriptor &desc, bool skipThumbnail = true); Common::String generateSaveName(int slot, const char *gameId); } // End of namespace Pink diff --git a/engines/pink/saveload.cpp b/engines/pink/saveload.cpp index c87ea3cb7f..27e8d953db 100644 --- a/engines/pink/saveload.cpp +++ b/engines/pink/saveload.cpp @@ -83,7 +83,7 @@ Common::String generateSaveName(int slot, const char *gameId) { return Common::String::format("%s.s%02d", gameId, slot); } -bool readSaveHeader(Common::InSaveFile &in, SaveStateDescriptor &desc) { +WARN_UNUSED_RESULT bool readSaveHeader(Common::InSaveFile &in, SaveStateDescriptor &desc, bool skipThumbnail) { if (in.readUint32BE() != MKTAG('p', 'i', 'n', 'k')) return false; @@ -91,11 +91,9 @@ bool readSaveHeader(Common::InSaveFile &in, SaveStateDescriptor &desc) { uint32 date = in.readUint32LE(); uint16 time = in.readUint16LE(); uint32 playTime = in.readUint32LE(); - if (!Graphics::checkThumbnailHeader(in)) - return false; - Graphics::Surface *thumbnail; - if (!Graphics::loadThumbnail(in, thumbnail)) + Graphics::Surface *thumbnail = nullptr; + if (!Graphics::loadThumbnail(in, thumbnail, skipThumbnail)) return false; int day = (date >> 24) & 0xFF; |