aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/myst.cpp
diff options
context:
space:
mode:
authorBastien Bouclet2017-07-21 12:56:20 +0200
committerBastien Bouclet2017-07-22 20:38:56 +0200
commit75040819c6642c304962d02ba646e04242cd4755 (patch)
tree26cc83e127cb0907259a24324e41517a2ff31b5f /engines/mohawk/myst.cpp
parenta2fc282e1c872a725f58b5d87d783191f1fe3987 (diff)
downloadscummvm-rg350-75040819c6642c304962d02ba646e04242cd4755.tar.gz
scummvm-rg350-75040819c6642c304962d02ba646e04242cd4755.tar.bz2
scummvm-rg350-75040819c6642c304962d02ba646e04242cd4755.zip
MOHAWK: Myst: Rewrite the sound code
It now more closely matches the original. Effect sounds are now stopped when resuming background sounds. Fixes #9574, Fixes #9920.
Diffstat (limited to 'engines/mohawk/myst.cpp')
-rw-r--r--engines/mohawk/myst.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp
index 8d96780617..9ce38b92b5 100644
--- a/engines/mohawk/myst.cpp
+++ b/engines/mohawk/myst.cpp
@@ -275,11 +275,11 @@ void MohawkEngine_Myst::waitUntilMovieEnds(const VideoEntryPtr &video) {
_interactive = true;
}
-void MohawkEngine_Myst::playSoundBlocking(uint16 id, byte volume) {
+void MohawkEngine_Myst::playSoundBlocking(uint16 id) {
_interactive = false;
- _sound->playSound(id, volume);
+ _sound->playEffect(id);
- while (_sound->isPlaying() && !shouldQuit()) {
+ while (_sound->isEffectPlaying() && !shouldQuit()) {
doFrame();
}
_interactive = true;
@@ -472,8 +472,8 @@ void MohawkEngine_Myst::changeToStack(uint16 stack, uint16 card, uint16 linkSrcS
else
_gfx->clearScreenPalette();
- _sound->stopSound();
- _sound->stopBackgroundMyst();
+ _sound->stopEffect();
+ _sound->stopBackground();
_video->stopVideos();
if (linkSrcSound)
playSoundBlocking(linkSrcSound);
@@ -1220,7 +1220,7 @@ void MohawkEngine_Myst::dropPage() {
bool redPage = page - 7 < 6;
// Play drop page sound
- _sound->replaceSoundMyst(800);
+ _sound->playEffect(800);
// Drop page
_gameState->_globals.heldPage = 0;
@@ -1317,13 +1317,13 @@ void MohawkEngine_Myst::applySoundBlock(const MystSoundBlock &block) {
debug(2, "Continuing with current sound");
else if (soundAction == kMystSoundActionChangeVolume) {
debug(2, "Continuing with current sound, changing volume");
- _sound->changeBackgroundVolumeMyst(soundActionVolume);
+ _sound->changeBackgroundVolume(soundActionVolume);
} else if (soundAction == kMystSoundActionStop) {
debug(2, "Stopping sound");
- _sound->stopBackgroundMyst();
+ _sound->stopBackground();
} else if (soundAction > 0) {
debug(2, "Playing new sound %d", soundAction);
- _sound->replaceBackgroundMyst(soundAction, soundActionVolume);
+ _sound->playBackground(soundAction, soundActionVolume);
} else {
error("Unknown sound action %d", soundAction);
}