From 75587c3c669d371601a9c508aad27191e9a9aacd Mon Sep 17 00:00:00 2001 From: David Fioramonti Date: Thu, 12 Jul 2018 15:43:05 -0700 Subject: LAB: Fix thumbnail issues Fixes Trac#10619. The thumbnail loading for the saved games was defaulting to disabled so no thumbnail was being loaded and this caused trying to show the thumbnail to crash scummvm. So I have set the thumbnail pointer to be null if the thumbnail doesn't get loaded and I've set the thumnail to not be skipped so that thumbnails get shown when using the gui. --- engines/lab/lab.h | 2 +- engines/lab/savegame.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'engines/lab') diff --git a/engines/lab/lab.h b/engines/lab/lab.h index aedf0181ec..3eba78b42e 100644 --- a/engines/lab/lab.h +++ b/engines/lab/lab.h @@ -502,7 +502,7 @@ private: void handleTrialWarning(); }; -WARN_UNUSED_RESULT bool readSaveGameHeader(Common::InSaveFile *in, SaveGameHeader &header, bool skipThumbnail = true); +WARN_UNUSED_RESULT bool readSaveGameHeader(Common::InSaveFile *in, SaveGameHeader &header, bool skipThumbnail = false); } // End of namespace Lab diff --git a/engines/lab/savegame.cpp b/engines/lab/savegame.cpp index 46ef1486f0..11986dc8c9 100644 --- a/engines/lab/savegame.cpp +++ b/engines/lab/savegame.cpp @@ -98,10 +98,11 @@ WARN_UNUSED_RESULT bool readSaveGameHeader(Common::InSaveFile *in, SaveGameHeade header._descr.setDescription(saveName); // Get the thumbnail - Graphics::Surface *thumbnail; + Graphics::Surface *thumbnail = nullptr; if (!Graphics::loadThumbnail(*in, thumbnail, skipThumbnail)) { return false; } + header._descr.setThumbnail(thumbnail); uint32 saveDate = in->readUint32BE(); -- cgit v1.2.3