Save/load palManipulate data
|Reported by:||SF/jamieson630||Owned by:||SF/ender|
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.