aboutsummaryrefslogtreecommitdiff
path: root/engines/voyeur
diff options
context:
space:
mode:
Diffstat (limited to 'engines/voyeur')
-rw-r--r--engines/voyeur/detection.cpp3
-rw-r--r--engines/voyeur/voyeur.cpp11
-rw-r--r--engines/voyeur/voyeur.h2
3 files changed, 5 insertions, 11 deletions
diff --git a/engines/voyeur/detection.cpp b/engines/voyeur/detection.cpp
index eefe174e94..6452e5741f 100644
--- a/engines/voyeur/detection.cpp
+++ b/engines/voyeur/detection.cpp
@@ -132,7 +132,6 @@ SaveStateList VoyeurMetaEngine::listSaves(const char *target) const {
if (in) {
if (header.read(in)) {
saveList.push_back(SaveStateDescriptor(slot, header._saveName));
- header._thumbnail->free();
}
delete in;
}
@@ -159,7 +158,7 @@ SaveStateDescriptor VoyeurMetaEngine::querySaveMetaInfos(const char *target, int
if (f) {
Voyeur::VoyeurSavegameHeader header;
- header.read(f);
+ header.read(f, false);
delete f;
// Create the return descriptor
diff --git a/engines/voyeur/voyeur.cpp b/engines/voyeur/voyeur.cpp
index 7f2f0e312e..b7769c1fd4 100644
--- a/engines/voyeur/voyeur.cpp
+++ b/engines/voyeur/voyeur.cpp
@@ -789,9 +789,6 @@ void VoyeurEngine::loadGame(int slot) {
VoyeurSavegameHeader header;
if (!header.read(saveFile))
return;
- if (header._thumbnail)
- header._thumbnail->free();
- delete header._thumbnail;
serializer.setVersion(header._version);
synchronize(serializer);
@@ -856,9 +853,7 @@ void VoyeurEngine::synchronize(Common::Serializer &s) {
/*------------------------------------------------------------------------*/
-bool VoyeurSavegameHeader::read(Common::InSaveFile *f) {
- _thumbnail = NULL;
-
+bool VoyeurSavegameHeader::read(Common::InSaveFile *f, bool skipThumbnail) {
uint32 signature = f->readUint32BE();
if (signature != MKTAG('V', 'O', 'Y', 'R')) {
warning("Invalid savegame");
@@ -875,9 +870,9 @@ bool VoyeurSavegameHeader::read(Common::InSaveFile *f) {
_saveName += c;
// Get the thumbnail
- _thumbnail = Graphics::loadThumbnail(*f);
- if (!_thumbnail)
+ if (!Graphics::loadThumbnail(*f, _thumbnail, skipThumbnail)) {
return false;
+ }
// Read in the save datet/ime
_saveYear = f->readSint16LE();
diff --git a/engines/voyeur/voyeur.h b/engines/voyeur/voyeur.h
index dcd82b24a9..a098ba9e62 100644
--- a/engines/voyeur/voyeur.h
+++ b/engines/voyeur/voyeur.h
@@ -312,7 +312,7 @@ struct VoyeurSavegameHeader {
/**
* Read in the header from the specified file
*/
- bool read(Common::InSaveFile *f);
+ bool read(Common::InSaveFile *f, bool skipThumbnail = true);
/**
* Write out header information to the specified file