diff options
author | Filippos Karapetis | 2008-11-10 18:51:51 +0000 |
---|---|---|
committer | Filippos Karapetis | 2008-11-10 18:51:51 +0000 |
commit | a859e2c1c925252b6c7693efb052bc2ff28915db (patch) | |
tree | ea4a94a84d055b2294d92d95792c460472a0fb4c /engines/saga | |
parent | dbb0fa5f6244095e0cfe306fabbdbd997478e19f (diff) | |
download | scummvm-rg350-a859e2c1c925252b6c7693efb052bc2ff28915db.tar.gz scummvm-rg350-a859e2c1c925252b6c7693efb052bc2ff28915db.tar.bz2 scummvm-rg350-a859e2c1c925252b6c7693efb052bc2ff28915db.zip |
Cleanup
svn-id: r34988
Diffstat (limited to 'engines/saga')
-rw-r--r-- | engines/saga/detection.cpp | 12 | ||||
-rw-r--r-- | engines/saga/saga.cpp | 9 | ||||
-rw-r--r-- | engines/saga/saga.h | 1 | ||||
-rw-r--r-- | engines/saga/saveload.cpp | 12 |
4 files changed, 16 insertions, 18 deletions
diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp index 5ca5d842c3..21e74ad5de 100644 --- a/engines/saga/detection.cpp +++ b/engines/saga/detection.cpp @@ -229,7 +229,6 @@ SaveStateDescriptor SagaMetaEngine::querySaveMetaInfos(const char *target, int s static char fileName[MAX_FILE_NAME]; sprintf(fileName, "%s.s%02d", target, slot); char title[TITLESIZE]; - Graphics::Surface *thumbnail; Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(fileName); @@ -268,7 +267,7 @@ SaveStateDescriptor SagaMetaEngine::querySaveMetaInfos(const char *target, int s desc.setWriteProtectedFlag(false); if (version >= 6) { - thumbnail = new Graphics::Surface(); + Graphics::Surface *thumbnail = new Graphics::Surface(); assert(thumbnail); if (!Graphics::loadThumbnail(*in, *thumbnail)) { delete thumbnail; @@ -356,4 +355,13 @@ Common::Error SagaEngine::saveGameState(int slot, const char *desc) { return Common::kNoError; // TODO: return success/failure } +bool SagaEngine::canLoadGameStateCurrently() { + return !_scene->isInIntro(); +} + +bool SagaEngine::canSaveGameStateCurrently() { + return !_scene->isInIntro() && + (_interface->getMode() == kPanelMain || _interface->getMode() == kPanelChapterSelection); +} + } // End of namespace Saga diff --git a/engines/saga/saga.cpp b/engines/saga/saga.cpp index 125a1670cc..17fee5deb6 100644 --- a/engines/saga/saga.cpp +++ b/engines/saga/saga.cpp @@ -532,13 +532,4 @@ void SagaEngine::syncSoundSettings() { _sound->setVolume(); } -bool SagaEngine::canLoadGameStateCurrently() { - return !_scene->isInIntro(); -} - -bool SagaEngine::canSaveGameStateCurrently() { - return !_scene->isInIntro() && - (_interface->getMode() == kPanelMain || _interface->getMode() == kPanelChapterSelection); -} - } // End of namespace Saga diff --git a/engines/saga/saga.h b/engines/saga/saga.h index cf1c4302da..93e58b7fc7 100644 --- a/engines/saga/saga.h +++ b/engines/saga/saga.h @@ -470,7 +470,6 @@ struct SaveGameHeader { uint32 size; uint32 version; char name[SAVE_TITLE_SIZE]; - Graphics::Surface *thumbnail; }; inline int objectTypeId(uint16 objectId) { diff --git a/engines/saga/saveload.cpp b/engines/saga/saveload.cpp index d5ccb32921..7e85338a8d 100644 --- a/engines/saga/saveload.cpp +++ b/engines/saga/saveload.cpp @@ -274,12 +274,12 @@ void SagaEngine::load(const char *fileName) { } if (_saveHeader.version >= 6) { - _saveHeader.thumbnail = new Graphics::Surface(); - assert(_saveHeader.thumbnail); - if (!Graphics::loadThumbnail(*in, *_saveHeader.thumbnail)) { - delete _saveHeader.thumbnail; - _saveHeader.thumbnail = 0; - } + // We don't need the thumbnail here, so just read it and discard it + Graphics::Surface *thumbnail = new Graphics::Surface(); + assert(thumbnail); + Graphics::loadThumbnail(*in, *thumbnail); + delete thumbnail; + thumbnail = 0; in->readUint32BE(); // save date in->readUint16BE(); // save time |