aboutsummaryrefslogtreecommitdiff
path: root/engines/prince/saveload.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/prince/saveload.cpp')
-rw-r--r--engines/prince/saveload.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/engines/prince/saveload.cpp b/engines/prince/saveload.cpp
index 14f6078910..8832a6d1d2 100644
--- a/engines/prince/saveload.cpp
+++ b/engines/prince/saveload.cpp
@@ -44,9 +44,7 @@ namespace Prince {
class InterpreterFlags;
class Interpreter;
-bool PrinceEngine::readSavegameHeader(Common::InSaveFile *in, SavegameHeader &header) {
- header.thumbnail = nullptr;
-
+WARN_UNUSED_RESULT bool PrinceEngine::readSavegameHeader(Common::InSaveFile *in, SavegameHeader &header, bool skipThumbnail) {
// Get the savegame version
header.version = in->readByte();
if (header.version > kSavegameVersion)
@@ -59,9 +57,9 @@ bool PrinceEngine::readSavegameHeader(Common::InSaveFile *in, SavegameHeader &he
header.saveName += ch;
// Get the thumbnail
- header.thumbnail = Graphics::loadThumbnail(*in);
- if (!header.thumbnail)
+ if (!Graphics::loadThumbnail(*in, header.thumbnail, skipThumbnail)) {
return false;
+ }
// Read in save date/time
header.saveYear = in->readSint16LE();
@@ -416,10 +414,6 @@ bool PrinceEngine::loadGame(int slotNumber) {
delete readStream;
return false;
}
-
- // Delete the thumbnail
- saveHeader.thumbnail->free();
- delete saveHeader.thumbnail;
}
// Get in the savegame