Opened 22 years ago

Closed 22 years ago

Last modified 6 years ago

#8046 closed patch

Save/load palManipulate data

Reported by: SF/jamieson630 Owned by: SF/ender
Priority: normal Component: Engine: SCUMM
Version: Keywords:
Cc: Game:

Description

The included patch addresses the problem of palManipulate data not being properly saved and loaded. The following problems currently occur as a result of this oversight:

1) When loading a game that was saved during a palette shift, the shift does not continue to completion.

2) When loading a game while the current game is in the middle of a palette shift, the palette for the newly loaded game may get corrupted.

This patch does the following:

1) It removes use of rtTemp resources to store palManipulate information, since such resources are never loaded or saved. Instead, all information is stored in new variables created in the Scumm class.

2) It adds stub serialization logic to include all necessary palManipulate information in savegames. (It uses a "smart" method whereby it does not save the largest chunks of information if there is no palette shift in progress.)

This patch does NOT currently implement save/load of palManipulate data, as this would render existing savegames incompatible with ScummVM. Rather, the appropriate additions have been added and commented out, with a note that they should be enabled whenever the savegame format is next changed.

Consequently, saving a game during a palManipulate operation will cause it to not resume when you load the game again.

On the other hand, the more common problem of interrupted palManipuate operations corrupting the palette of a newly loaded game have been addressed by reseting _palManipCounter on load, thus stopping any palette transition in progress.

This patch was made against the following snapshots:

scumm.h - v 1.15 resource_v2.cpp - v 1.3 resource_v2.cpp - v 1.2 saveload.cpp - v 1.8 gfx.cpp - v 1.17

These were the most recent snapshots at the time of this post.

Ticket imported from: #609334. Ticket imported from: patches/151.

Attachments (2)

savepalmanipulate.diff (10.1 KB ) - added by SF/jamieson630 22 years ago.
Intermediate palManipulate load/save solution
saveload.diff (2.0 KB ) - added by SF/jamieson630 22 years ago.
Correction to saveload.cpp portion of the patch

Download all attachments as: .zip

Change History (10)

by SF/jamieson630, 22 years ago

Attachment: savepalmanipulate.diff added

Intermediate palManipulate load/save solution

by SF/jamieson630, 22 years ago

Attachment: saveload.diff added

Correction to saveload.cpp portion of the patch

comment:1 by SF/jamieson630, 22 years ago

I just added saveload.diff, which corrects a problem with the patch that appears in that module. The problem is that _palManipCounter gets reset on SAVES as well as LOADS, so that if you save a game during a palette shift, the shift would stop.

comment:2 by fingolfin, 22 years ago

Owner: set to SF/ender

comment:3 by fingolfin, 22 years ago

Endy, didn't you check this in already?

comment:4 by SF/ender, 22 years ago

Applied, but patch left open until the new save/load system is implemented...

REMINDER: Enable save/load data when new system is in place

(Hm, I had clicked submit on this last night, before I went to bed.. Guess it timed out ;)

comment:5 by fingolfin, 22 years ago

My save load patch #650085 adds these field for the V10 save format.

comment:6 by fingolfin, 22 years ago

SInce the saveload patch is now in CVS, this can be closed.

comment:7 by fingolfin, 22 years ago

Status: newclosed

comment:8 by digitall, 6 years ago

Component: Engine: SCUMM
Note: See TracTickets for help on using tickets.