diff options
author | Johannes Schickel | 2006-07-22 16:19:00 +0000 |
---|---|---|
committer | Johannes Schickel | 2006-07-22 16:19:00 +0000 |
commit | d272f6c4835457ac785ebd5495ccbb4abace02bf (patch) | |
tree | e53543a2d248ae5840f86b5136143bd95ddd9f38 /engines/scumm/saveload.cpp | |
parent | 16de659f597ae8985ecbca6a01cba18b0132d069 (diff) | |
download | scummvm-rg350-d272f6c4835457ac785ebd5495ccbb4abace02bf.tar.gz scummvm-rg350-d272f6c4835457ac785ebd5495ccbb4abace02bf.tar.bz2 scummvm-rg350-d272f6c4835457ac785ebd5495ccbb4abace02bf.zip |
Hardcoding header size of the Thumbnail and of the Info section of scumm games.
(because packed struct handling changed and gcc seems not to be happy with it)
This should unbreak new save games made after this commit.
svn-id: r23565
Diffstat (limited to 'engines/scumm/saveload.cpp')
-rw-r--r-- | engines/scumm/saveload.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index 9f0a65edda..7b5cb2c145 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -69,6 +69,8 @@ struct SaveInfoSection { uint16 time; }; +#define SaveInfoSectionSize (4+4+4 + 4+4 + 4+2) + #if defined(END_PACK_STRUCTS) #pragma END_PACK_STRUCTS #endif @@ -519,7 +521,7 @@ bool ScummEngine::loadInfos(Common::InSaveFile *file, InfoStuff *stuff) { section.size = file->readUint32BE(); // if we extend this we should add a table for the special sizes at the versions to check it - if (section.version == INFOSECTION_VERSION && section.size != sizeof(SaveInfoSection)) { + if (section.version == INFOSECTION_VERSION && section.size != SaveInfoSectionSize) { warning("Info section is corrupt"); file->skip(section.size); return false; @@ -549,8 +551,8 @@ bool ScummEngine::loadInfos(Common::InSaveFile *file, InfoStuff *stuff) { // skip all newer features, this could make problems if some older version uses more space for // saving informations, but this should NOT happen - if (section.size > sizeof(SaveInfoSection)) { - file->skip(section.size - sizeof(SaveInfoSection)); + if (section.size > SaveInfoSectionSize) { + file->skip(section.size - SaveInfoSectionSize); } return true; @@ -560,7 +562,7 @@ void ScummEngine::saveInfos(Common::OutSaveFile* file) { SaveInfoSection section; section.type = MKID_BE('INFO'); section.version = INFOSECTION_VERSION; - section.size = sizeof(SaveInfoSection); + section.size = SaveInfoSectionSize; // still save old format for older versions section.timeTValue = time(0); |