From cdc9f46bd921b5135f5f8a5881823377cebd6e55 Mon Sep 17 00:00:00 2001 From: Fabio Battaglia Date: Wed, 4 Mar 2009 12:44:55 +0000 Subject: sword1: removed custom checks for thumbnails, using graphics/thumbnail.h functions instead svn-id: r39130 --- engines/sword1/control.cpp | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'engines/sword1/control.cpp') 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; -- cgit v1.2.3