aboutsummaryrefslogtreecommitdiff
path: root/sword2/save_rest.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2004-03-27 12:07:07 +0000
committerTorbjörn Andersson2004-03-27 12:07:07 +0000
commit9b9ebb3a91af2056bf30875caeca5d784e26e618 (patch)
treecc903971179989f2cc2568084168cdd353f501d8 /sword2/save_rest.cpp
parent56ae88d5c778001768093ac14eb84065cab6511a (diff)
downloadscummvm-rg350-9b9ebb3a91af2056bf30875caeca5d784e26e618.tar.gz
scummvm-rg350-9b9ebb3a91af2056bf30875caeca5d784e26e618.tar.bz2
scummvm-rg350-9b9ebb3a91af2056bf30875caeca5d784e26e618.zip
Make sure looping music is restarted after loading a savegame, regardless
of how the savegame is loaded. (ScummVM adds two alternative methods: the -x command-line parameter, and the restart/restore dialog at the beginning of the game, which is only shown when there are savegames available.) svn-id: r13386
Diffstat (limited to 'sword2/save_rest.cpp')
-rw-r--r--sword2/save_rest.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/sword2/save_rest.cpp b/sword2/save_rest.cpp
index 264416abe2..d14e1da50b 100644
--- a/sword2/save_rest.cpp
+++ b/sword2/save_rest.cpp
@@ -404,6 +404,17 @@ uint32 Sword2Engine::restoreFromBuffer(Memory *buffer, uint32 size) {
_loopingMusicId = _saveGameHeader.music_id;
+ // Restart any looping music. Originally this was - and still is - done
+ // in systemMenuMouse(), but with ScummVM we have other ways of
+ // restoring savegames so it's easier to put it here as well.
+
+ if (_loopingMusicId) {
+ pars[0] = _loopingMusicId;
+ pars[1] = FX_LOOP;
+ _logic->fnPlayMusic(pars);
+ } else
+ _logic->fnStopMusic(NULL);
+
// Write to walkthrough file (zebug0.txt)
debug(5, "RESTORED GAME \"%s\"", _saveGameHeader.description);