DREAMWEB: Fix ReelRoutine terminator saving/loading
This commit is contained in:
parent
5d1e1fbbbc
commit
4178ad6b68
1 changed files with 8 additions and 4 deletions
|
@ -432,9 +432,11 @@ void DreamGenContext::savePosition(unsigned int slot, const char *descbuf) {
|
||||||
|
|
||||||
// TODO: Convert more to serializer?
|
// TODO: Convert more to serializer?
|
||||||
Common::Serializer s(0, outSaveFile);
|
Common::Serializer s(0, outSaveFile);
|
||||||
for (unsigned int i = 0; 8 * i < kLenofreelrouts; ++i) {
|
for (unsigned int i = 0; 8*i < kLenofreelrouts - 1; ++i) {
|
||||||
syncReelRoutine(s, (ReelRoutine *)data.ptr(kReelroutines + 8*i, 8));
|
syncReelRoutine(s, (ReelRoutine *)data.ptr(kReelroutines + 8*i, 8));
|
||||||
}
|
}
|
||||||
|
// Terminator
|
||||||
|
s.syncAsByte(*data.ptr(kReelroutines + kLenofreelrouts - 1, 1));
|
||||||
|
|
||||||
// ScummVM data block
|
// ScummVM data block
|
||||||
outSaveFile->writeUint32BE(SCUMMVM_HEADER);
|
outSaveFile->writeUint32BE(SCUMMVM_HEADER);
|
||||||
|
@ -498,9 +500,11 @@ void DreamGenContext::loadPosition(unsigned int slot) {
|
||||||
|
|
||||||
// TODO: Use serializer for more
|
// TODO: Use serializer for more
|
||||||
Common::Serializer s(inSaveFile, 0);
|
Common::Serializer s(inSaveFile, 0);
|
||||||
for (unsigned int i = 0; 8 * i < kLenofreelrouts; ++i) {
|
for (unsigned int i = 0; 8*i < kLenofreelrouts - 1; ++i) {
|
||||||
syncReelRoutine(s, (ReelRoutine *)data.ptr(kReelroutines + 8*i, 8));
|
syncReelRoutine(s, (ReelRoutine *)data.ptr(kReelroutines + 8*i, 8));
|
||||||
}
|
}
|
||||||
|
// Terminator
|
||||||
|
s.syncAsByte(*data.ptr(kReelroutines + kLenofreelrouts - 1, 1));
|
||||||
|
|
||||||
// Check if there's a ScummVM data block
|
// Check if there's a ScummVM data block
|
||||||
if (header.len(6) == SCUMMVM_BLOCK_MAGIC_SIZE) {
|
if (header.len(6) == SCUMMVM_BLOCK_MAGIC_SIZE) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue