mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-16 06:39:17 +00:00
SCI2+: Set the correct segment for SCI32 strings/arrays when loading
This was an omission, observed after a discussion with clone2727
This commit is contained in:
parent
50129178ef
commit
8ef4594f9b
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user