diff options
author | Johannes Schickel | 2010-10-13 03:57:44 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-10-13 03:57:44 +0000 |
commit | 75e8452b6e6a2bf4fb2f588aa00b428a60d873b5 (patch) | |
tree | f29541d55309487a94bd1d38e8b53bb3dde9aec6 /engines/scumm/saveload.cpp | |
parent | 48ee83b88957dab86bc763e9ef21a70179fa8679 (diff) | |
parent | e9f50882ea5b6beeefa994040be9d3bab6a1f107 (diff) | |
download | scummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.tar.gz scummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.tar.bz2 scummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.zip |
OPENGL: Merged from trunk, from rev 52105 to 53396.
This includes an rather hacky attempt to merge all the recent gp2x backend
changes into the branch. I suppose the gp2x backend and probably all new
backends, i.e. gph, dingux etc., might not compile anymore.
Since I have no way of testing those it would be nice if porters could look
into getting those up to speed in this branch.
svn-id: r53399
Diffstat (limited to 'engines/scumm/saveload.cpp')
-rw-r--r-- | engines/scumm/saveload.cpp | 51 |
1 files changed, 50 insertions, 1 deletions
diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index 81762d87a8..b100e15604 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -32,6 +32,7 @@ #include "scumm/charset.h" #include "scumm/imuse_digi/dimuse.h" #include "scumm/imuse/imuse.h" +#include "player_towns.h" #include "scumm/he/intern_he.h" #include "scumm/object.h" #include "scumm/resource.h" @@ -446,6 +447,9 @@ bool ScummEngine::loadState(int slot, bool compat) { // Update volume settings syncSoundSettings(); + if (_townsPlayer && (hdr.ver >= VER(81))) + _townsPlayer->restoreAfterLoad(); + // Init NES costume data if (_game.platform == Common::kPlatformNES) { if (hdr.ver < VER(47)) @@ -1289,9 +1293,38 @@ void ScummEngine::saveOrLoad(Serializer *s) { // // Save/load palette data // - if (_16BitPalette) { + if (_16BitPalette && !(_game.platform == Common::kPlatformFMTowns && s->isLoading() && s->getVersion() < VER(82))) { s->saveLoadArrayOf(_16BitPalette, 512, sizeof(_16BitPalette[0]), sleUint16); } + +#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE + // FM-Towns specific (extra palette data, color cycle data, etc.) + if (s->getVersion() >= VER(82)) { + const SaveLoadEntry townsFields[] = { + MKLINE(Common::Rect, left, sleInt16, VER(82)), + MKLINE(Common::Rect, top, sleInt16, VER(82)), + MKLINE(Common::Rect, right, sleInt16, VER(82)), + MKLINE(Common::Rect, bottom, sleInt16, VER(82)), + MKEND() + }; + + const SaveLoadEntry townsExtraEntries[] = { + MKLINE(ScummEngine, _townsOverrideShadowColor, sleUint8, VER(82)), + MKLINE(ScummEngine, _numCyclRects, sleUint8, VER(82)), + MKLINE(ScummEngine, _townsPaletteFlags, sleUint8, VER(82)), + MKLINE(ScummEngine, _townsClearLayerFlag, sleUint8, VER(82)), + MKLINE(ScummEngine, _townsActiveLayerFlags, sleUint8, VER(82)), + MKEND() + }; + + s->saveLoadArrayOf(_textPalette, 48, sizeof(_textPalette[0]), sleUint8); + s->saveLoadArrayOf(_cyclRects, 10, sizeof(_cyclRects[0]), townsFields); + s->saveLoadArrayOf(&_curStringRect, 1, sizeof(_curStringRect), townsFields); + s->saveLoadArrayOf(_townsCharsetColorMap, 16, sizeof(_townsCharsetColorMap[0]), sleUint8); + s->saveLoadEntries(this, townsExtraEntries); + } +#endif + if (_shadowPaletteSize) { s->saveLoadArrayOf(_shadowPalette, _shadowPaletteSize, 1, sleByte); // _roomPalette didn't show up until V21 save games @@ -1393,6 +1426,11 @@ void ScummEngine::saveOrLoad(Serializer *s) { _imuse->save_or_load(s, this); } + + // Save/load FM-Towns audio status + if (_townsPlayer) + _townsPlayer->saveLoadWithSerializer(s); + // // Save/load the charset renderer state // @@ -1449,6 +1487,17 @@ void ScummEngine_v5::saveOrLoad(Serializer *s) { // This is probably only needed for Loom. s->saveLoadEntries(this, cursorEntries); + + // Reset cursors for old FM-Towns savegames saved with 256 color setting. + // Otherwise the cursor will be messed up when displayed in the new hi color setting. + if (_game.platform == Common::kPlatformFMTowns && _bytesPerPixelOutput == 2 && s->isLoading() && s->getVersion() < VER(82)) { + if (_game.id == GID_LOOM) { + redefineBuiltinCursorFromChar(1, 1); + redefineBuiltinCursorHotspot(1, 0, 0); + } else { + resetCursors(); + } + } } #ifdef ENABLE_SCUMM_7_8 |