aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk
diff options
context:
space:
mode:
authorBastien Bouclet2017-07-09 06:49:49 +0200
committerBastien Bouclet2017-07-09 06:55:42 +0200
commitc4207ad3a313887df8d4d94d642e5ecdbf2eb992 (patch)
tree445f448d98dbe057d24258df7537c1b5b0c0b266 /engines/mohawk
parentefcbe6575717764207f017e16c58d2c493a78939 (diff)
downloadscummvm-rg350-c4207ad3a313887df8d4d94d642e5ecdbf2eb992.tar.gz
scummvm-rg350-c4207ad3a313887df8d4d94d642e5ecdbf2eb992.tar.bz2
scummvm-rg350-c4207ad3a313887df8d4d94d642e5ecdbf2eb992.zip
MOHAWK: Myst: Fix the piano sound effect restarting when moving the mouse
Fixes #9916.
Diffstat (limited to 'engines/mohawk')
-rw-r--r--engines/mohawk/myst_stacks/myst.cpp12
-rw-r--r--engines/mohawk/myst_stacks/myst.h3
2 files changed, 11 insertions, 4 deletions
diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp
index d9a117818e..84a91e2a5b 100644
--- a/engines/mohawk/myst_stacks/myst.cpp
+++ b/engines/mohawk/myst_stacks/myst.cpp
@@ -60,6 +60,7 @@ Myst::Myst(MohawkEngine_Myst *vm) :
_observatoryCurrentSlider = nullptr;
_butterfliesMoviePlayed = false;
_state.treeLastMoveTime = _vm->_system->getMillis();
+ _rocketPianoSound = 0;
}
Myst::~Myst() {
@@ -2318,9 +2319,11 @@ void Myst::o_rocketPianoStart(uint16 op, uint16 var, uint16 argc, uint16 *argv)
_vm->_system->updateScreen();
// Play note
+ _rocketPianoSound = 0;
if (_state.generatorVoltage == 59 && !_state.generatorBreakers) {
- uint16 soundId = key->getList1(0);
- _vm->_sound->replaceSoundMyst(soundId, Audio::Mixer::kMaxChannelVolume, true);
+ _vm->_sound->pauseBackgroundMyst();
+ _rocketPianoSound = key->getList1(0);
+ _vm->_sound->replaceSoundMyst(_rocketPianoSound, Audio::Mixer::kMaxChannelVolume, true);
}
}
@@ -2358,7 +2361,10 @@ void Myst::o_rocketPianoMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
// Play note
if (_state.generatorVoltage == 59 && !_state.generatorBreakers) {
uint16 soundId = key->getList1(0);
- _vm->_sound->replaceSoundMyst(soundId, Audio::Mixer::kMaxChannelVolume, true);
+ if (soundId != _rocketPianoSound) {
+ _rocketPianoSound = soundId;
+ _vm->_sound->replaceSoundMyst(soundId, Audio::Mixer::kMaxChannelVolume, true);
+ }
}
} else {
// Not pressing a key anymore
diff --git a/engines/mohawk/myst_stacks/myst.h b/engines/mohawk/myst_stacks/myst.h
index 6e2f7cc1c8..a44f914c37 100644
--- a/engines/mohawk/myst_stacks/myst.h
+++ b/engines/mohawk/myst_stacks/myst.h
@@ -191,6 +191,7 @@ protected:
bool _generatorControlRoomRunning;
uint16 _generatorVoltage; // 58
+ uint16 _rocketPianoSound; // 292
MystAreaSlider *_rocketSlider1; // 248
MystAreaSlider *_rocketSlider2; // 252
MystAreaSlider *_rocketSlider3; // 256
@@ -198,7 +199,7 @@ protected:
MystAreaSlider *_rocketSlider5; // 264
uint16 _rocketSliderSound; // 294
uint16 _rocketLeverPosition; // 296
- VideoHandle _rocketLinkBook;
+ VideoHandle _rocketLinkBook; // 268
bool _libraryCombinationBookPagesTurning;
int16 _libraryBookPage; // 86