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/sci/engine/savegame.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/sci/engine/savegame.cpp')
-rw-r--r-- | engines/sci/engine/savegame.cpp | 58 |
1 files changed, 31 insertions, 27 deletions
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index dfc41cc56a..87e328592f 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -45,8 +45,6 @@ #include "sci/sound/audio.h" #include "sci/sound/music.h" -#include "gui/message.h" - namespace Sci { @@ -568,26 +566,32 @@ void GfxPalette::palVarySaveLoadPalette(Common::Serializer &s, Palette *palette) } void GfxPalette::saveLoadWithSerializer(Common::Serializer &s) { - if (s.getVersion() < 24) - return; - - if (s.isLoading() && _palVaryResourceId != -1) - palVaryRemoveTimer(); - - s.syncAsSint32LE(_palVaryResourceId); - if (_palVaryResourceId != -1) { - palVarySaveLoadPalette(s, &_palVaryOriginPalette); - palVarySaveLoadPalette(s, &_palVaryTargetPalette); - s.syncAsSint16LE(_palVaryStep); - s.syncAsSint16LE(_palVaryStepStop); - s.syncAsSint16LE(_palVaryDirection); - s.syncAsUint16LE(_palVaryTicks); - s.syncAsSint32LE(_palVaryPaused); + if (s.getVersion() >= 25) { + // We need to save intensity of the _sysPalette at least for kq6 when entering the dark cave (room 390) + // from room 340. scripts will set intensity to 60 for this room and restore them when leaving. + // Sierra SCI is also doing this (although obviously not for SCI0->SCI01 games, still it doesn't hurt + // to save it everywhere). ffs. bug #3072868 + s.syncBytes(_sysPalette.intensity, 256); } + if (s.getVersion() >= 24) { + if (s.isLoading() && _palVaryResourceId != -1) + palVaryRemoveTimer(); + + s.syncAsSint32LE(_palVaryResourceId); + if (_palVaryResourceId != -1) { + palVarySaveLoadPalette(s, &_palVaryOriginPalette); + palVarySaveLoadPalette(s, &_palVaryTargetPalette); + s.syncAsSint16LE(_palVaryStep); + s.syncAsSint16LE(_palVaryStepStop); + s.syncAsSint16LE(_palVaryDirection); + s.syncAsUint16LE(_palVaryTicks); + s.syncAsSint32LE(_palVaryPaused); + } - if (s.isLoading() && _palVaryResourceId != -1) { - _palVarySignal = 0; - palVaryInstallTimer(); + if (s.isLoading() && _palVaryResourceId != -1) { + _palVarySignal = 0; + palVaryInstallTimer(); + } } } @@ -701,6 +705,8 @@ bool gamestate_save(EngineState *s, Common::WriteStream *fh, const char* savenam return true; } +extern void showScummVMDialog(const Common::String &message); + void gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) { SavegameMetadata meta; @@ -708,7 +714,7 @@ void gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) { sync_SavegameMetadata(ser, meta); if (fh->eos()) { - s->r_acc = make_reg(0, 1); // signal failure + s->r_acc = TRUE_REG; // signal failure return; } @@ -721,10 +727,9 @@ void gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) { warning("Savegame version is %d, maximum supported is %0d", meta.savegame_version, CURRENT_SAVEGAME_VERSION); */ - GUI::MessageDialog dialog("The format of this saved game is obsolete, unable to load it", "OK"); - dialog.runModal(); + showScummVMDialog("The format of this saved game is obsolete, unable to load it"); - s->r_acc = make_reg(0, 1); // signal failure + s->r_acc = TRUE_REG; // signal failure return; } @@ -733,10 +738,9 @@ void gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) { if (script0->size != meta.script0_size || g_sci->getGameObject().offset != meta.game_object_offset) { //warning("This saved game was created with a different version of the game, unable to load it"); - GUI::MessageDialog dialog("This saved game was created with a different version of the game, unable to load it", "OK"); - dialog.runModal(); + showScummVMDialog("This saved game was created with a different version of the game, unable to load it"); - s->r_acc = make_reg(0, 1); // signal failure + s->r_acc = TRUE_REG; // signal failure return; } } |