aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe/stateloader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/fullpipe/stateloader.cpp')
-rw-r--r--engines/fullpipe/stateloader.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp
index 9d4d5ab09a..250c527f40 100644
--- a/engines/fullpipe/stateloader.cpp
+++ b/engines/fullpipe/stateloader.cpp
@@ -193,7 +193,7 @@ void fillDummyHeader(Fullpipe::FullpipeSavegameHeader &header) {
header.playtime = 0;
}
-bool readSavegameHeader(Common::InSaveFile *in, FullpipeSavegameHeader &header) {
+WARN_UNUSED_RESULT bool readSavegameHeader(Common::InSaveFile *in, FullpipeSavegameHeader &header, bool skipThumbnail) {
uint oldPos = in->pos();
in->seek(-4, SEEK_END);
@@ -237,13 +237,13 @@ bool readSavegameHeader(Common::InSaveFile *in, FullpipeSavegameHeader &header)
header.description = header.saveName;
// Get the thumbnail
- header.thumbnail = Common::SharedPtr<Graphics::Surface>(Graphics::loadThumbnail(*in), Graphics::SurfaceDeleter());
+ if (!Graphics::loadThumbnail(*in, header.thumbnail, skipThumbnail)) {
+ in->seek(oldPos, SEEK_SET); // Rewind the file
+ return false;
+ }
in->seek(oldPos, SEEK_SET); // Rewind the file
- if (!header.thumbnail)
- return false;
-
return true;
}