diff options
author | md5 | 2011-02-15 01:30:33 +0200 |
---|---|---|
committer | md5 | 2011-02-15 01:30:33 +0200 |
commit | 8ef4594f9b9016f6b93fc176dd8aea8bdd7d85cf (patch) | |
tree | 65c9b30c98e141b5c7dfc575ad1e8f5970513e36 /engines | |
parent | 50129178efcd2a6defae679f059bd9de796a3122 (diff) | |
download | scummvm-rg350-8ef4594f9b9016f6b93fc176dd8aea8bdd7d85cf.tar.gz scummvm-rg350-8ef4594f9b9016f6b93fc176dd8aea8bdd7d85cf.tar.bz2 scummvm-rg350-8ef4594f9b9016f6b93fc176dd8aea8bdd7d85cf.zip |
SCI2+: Set the correct segment for SCI32 strings/arrays when loading
This was an omission, observed after a discussion with clone2727
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/savegame.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index ea56a2faff..610698fbd9 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -144,17 +144,15 @@ void SegManager::saveLoadWithSerializer(Common::Serializer &s) { SegmentType type = (s.isSaving() && mobj) ? mobj->getType() : SEG_TYPE_INVALID; s.syncAsUint32LE(type); - // If we were saving and mobj == 0, or if we are loading and this is an - // entry marked as empty -> skip to next - if (type == SEG_TYPE_INVALID) + if (type == SEG_TYPE_HUNK) { + // Don't save or load HunkTable segments continue; - - // Don't save or load HunkTable segments - if (type == SEG_TYPE_HUNK) + } else if (type == SEG_TYPE_INVALID) { + // If we were saving and mobj == 0, or if we are loading and this is an + // entry marked as empty -> skip to next continue; - - // Don't save or load the obsolete system string segments - if (type == 5) { + } else if (type == 5) { + // Don't save or load the obsolete system string segments if (s.isSaving()) { continue; } else { @@ -169,6 +167,15 @@ void SegManager::saveLoadWithSerializer(Common::Serializer &s) { continue; } } +#ifdef ENABLE_SCI32 + else if (type == SEG_TYPE_ARRAY) { + // Set the correct segment for SCI32 arrays + _arraysSegId = i; + } else if (type == SEG_TYPE_STRING) { + // Set the correct segment for SCI32 strings + _stringSegId = i; + } +#endif if (s.isLoading()) mobj = SegmentObj::createSegmentObj(type); @@ -178,7 +185,6 @@ void SegManager::saveLoadWithSerializer(Common::Serializer &s) { // Let the object sync custom data mobj->saveLoadWithSerializer(s); - if (type == SEG_TYPE_SCRIPT) { Script *scr = (Script *)mobj; |