aboutsummaryrefslogtreecommitdiff
path: root/engines/sword1/control.cpp
diff options
context:
space:
mode:
authorFabio Battaglia2009-03-04 12:44:55 +0000
committerFabio Battaglia2009-03-04 12:44:55 +0000
commitcdc9f46bd921b5135f5f8a5881823377cebd6e55 (patch)
tree195df7fcb62ae17929cc7a8ba99381bb439215d3 /engines/sword1/control.cpp
parent7270c879194837627968af9717ff7100e46741cf (diff)
downloadscummvm-rg350-cdc9f46bd921b5135f5f8a5881823377cebd6e55.tar.gz
scummvm-rg350-cdc9f46bd921b5135f5f8a5881823377cebd6e55.tar.bz2
scummvm-rg350-cdc9f46bd921b5135f5f8a5881823377cebd6e55.zip
sword1: removed custom checks for thumbnails, using graphics/thumbnail.h functions instead
svn-id: r39130
Diffstat (limited to 'engines/sword1/control.cpp')
-rw-r--r--engines/sword1/control.cpp20
1 files changed, 5 insertions, 15 deletions
diff --git a/engines/sword1/control.cpp b/engines/sword1/control.cpp
index 575f031cc7..3e90f713bb 100644
--- a/engines/sword1/control.cpp
+++ b/engines/sword1/control.cpp
@@ -1104,12 +1104,8 @@ void Control::saveGameToFile(uint8 slot) {
outf->write(_saveNames[slot].c_str(), 40);
outf->writeByte(SAVEGAME_VERSION);
- if (!isPanelShown()) {
- outf->writeByte(HAS_THUMBNAIL);
- // Thumbnail
+ if (!isPanelShown()) // Generate a thumbnail only if we are outside of game menu
Graphics::saveThumbnail(*outf);
- } else // at this point we can't save a thumbnail of the game screen, as the save menu is shown
- outf->writeByte(NO_THUMBNAIL);
// Date / time
tm curTime;
@@ -1175,16 +1171,11 @@ bool Control::restoreGameFromFile(uint8 slot) {
return false;
}
- bool hasThumbnail = inf->readByte();
+ if (saveVersion < 2) // These older version of the savegames used a flag to signal presence of thumbnail
+ inf->skip(1);
- if (hasThumbnail) {
- // We don't need the thumbnail here, so just read it and discard it
- Graphics::Surface *thumbnail = new Graphics::Surface();
- assert(thumbnail);
- Graphics::loadThumbnail(*inf, *thumbnail);
- delete thumbnail;
- thumbnail = 0;
- }
+ if (Graphics::checkThumbnailHeader(*inf))
+ Graphics::skipThumbnailHeader(*inf);
inf->readUint32BE(); // save date
inf->readUint16BE(); // save time
@@ -1281,7 +1272,6 @@ bool Control::convertSaveGame(uint8 slot, char* desc) {
newSave->writeUint32LE(SAVEGAME_HEADER);
newSave->write(desc, 40);
newSave->writeByte(SAVEGAME_VERSION);
- newSave->writeByte(NO_THUMBNAIL);
// Date / time
tm curTime;