aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/myst_scripts.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_scripts.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_scripts.cpp')
-rw-r--r--engines/mohawk/myst_scripts.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/engines/mohawk/myst_scripts.cpp b/engines/mohawk/myst_scripts.cpp
index 9141f9f988..30d2c155df 100644
--- a/engines/mohawk/myst_scripts.cpp
+++ b/engines/mohawk/myst_scripts.cpp
@@ -630,12 +630,12 @@ void MystScriptParser::o_playSound(uint16 op, uint16 var, uint16 argc, uint16 *a
debugC(kDebugScript, "Opcode %d: playSound", op);
debugC(kDebugScript, "\tsoundId: %d", soundId);
- _vm->_sound->replaceSoundMyst(soundId);
+ _vm->_sound->playEffect(soundId);
}
void MystScriptParser::o_stopSoundBackground(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
debugC(kDebugScript, "Opcode %d: stopSoundBackground", op);
- _vm->_sound->stopBackgroundMyst();
+ _vm->_sound->stopBackground();
}
void MystScriptParser::o_playSoundBlocking(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
@@ -644,7 +644,7 @@ void MystScriptParser::o_playSoundBlocking(uint16 op, uint16 var, uint16 argc, u
debugC(kDebugScript, "Opcode %d: playSoundBlocking", op);
debugC(kDebugScript, "\tsoundId: %d", soundId);
- _vm->_sound->stopSound();
+ _vm->_sound->stopEffect();
_vm->playSoundBlocking(soundId);
}
@@ -729,13 +729,13 @@ void MystScriptParser::o_soundPlaySwitch(uint16 op, uint16 var, uint16 argc, uin
debugC(kDebugScript, "\tsoundId: %d", soundId);
if (soundId)
- _vm->_sound->replaceSoundMyst(soundId);
+ _vm->_sound->playEffect(soundId);
}
}
void MystScriptParser::o_soundResumeBackground(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
debugC(kDebugScript, "Opcode %d: soundResumeBackground", op);
- _vm->_sound->resumeBackgroundMyst();
+ _vm->_sound->resumeBackground();
}
void MystScriptParser::o_copyImageToScreen(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
@@ -838,7 +838,7 @@ void MystScriptParser::o_changeStack(uint16 op, uint16 var, uint16 argc, uint16
debugC(kDebugScript, "\tSource Stack Link Sound: %d", soundIdLinkSrc);
debugC(kDebugScript, "\tDestination Stack Link Sound: %d", soundIdLinkDst);
- _vm->_sound->stopSound();
+ _vm->_sound->stopEffect();
if (_vm->getFeatures() & GF_DEMO) {
// No need to have a table for just this data...
@@ -865,7 +865,7 @@ void MystScriptParser::o_changeCardPlaySoundDirectional(uint16 op, uint16 var, u
debugC(kDebugScript, "\tanimated update data size: %d", dataSize);
if (soundId)
- _vm->_sound->replaceSoundMyst(soundId);
+ _vm->_sound->playEffect(soundId);
_vm->changeToCard(cardId, kNoTransition);
@@ -884,7 +884,7 @@ void MystScriptParser::o_directionalUpdatePlaySound(uint16 op, uint16 var, uint1
debugC(kDebugScript, "\tanimated update data size: %d", dataSize);
if (soundId)
- _vm->_sound->replaceSoundMyst(soundId);
+ _vm->_sound->playEffect(soundId);
animatedUpdate(dataSize, &argv[3], delayBetweenSteps);
}
@@ -907,7 +907,7 @@ void MystScriptParser::o_soundWaitStop(uint16 op, uint16 var, uint16 argc, uint1
// Used when Button is pushed...
debugC(kDebugScript, "Opcode %d: Wait for foreground sound to finish", op);
- while (_vm->_sound->isPlaying())
+ while (_vm->_sound->isEffectPlaying())
_vm->doFrame();
}