diff options
-rw-r--r-- | sword2/mouse.cpp | 11 | ||||
-rw-r--r-- | sword2/save_rest.cpp | 11 | ||||
-rw-r--r-- | sword2/sword2.cpp | 5 |
3 files changed, 18 insertions, 9 deletions
diff --git a/sword2/mouse.cpp b/sword2/mouse.cpp index 65f7b43b0e..883d24d3a1 100644 --- a/sword2/mouse.cpp +++ b/sword2/mouse.cpp @@ -246,20 +246,15 @@ void Sword2Engine::systemMenuMouse(void) { _sound->unpauseFx(); // If there was looping music before coming into the control panels - // then restart it! NB. This will also start music required when a game - // has been restored + // then restart it! NB. If a game has been restored the music will be + // restarted twice, but this shouldn't cause any harm. if (_loopingMusicId) { pars[0] = _loopingMusicId; pars[1] = FX_LOOP; _logic->fnPlayMusic(pars); - - // cross-fades into the required music: either a restored game - // tune, or music playing prior to entering control panels - } else { - // stop the control panel music + } else _logic->fnStopMusic(NULL); - } } void Sword2Engine::dragMouse(void) { 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); diff --git a/sword2/sword2.cpp b/sword2/sword2.cpp index cf8af3a606..f977cc7043 100644 --- a/sword2/sword2.cpp +++ b/sword2/sword2.cpp @@ -320,7 +320,10 @@ void Sword2Engine::go() { setMouse(NORMAL_MOUSE_ID); _logic->fnPlayMusic(pars); result = _gui->startControl(); - _logic->fnStopMusic(NULL); + + // If the game is started from the beginning, the cutscene + // player will kill the music for us. Otherwise, the restore + // will either have killed the music, or done a crossfade. if (_quit) return; |