diff options
author | Bastien Bouclet | 2017-07-21 12:56:20 +0200 |
---|---|---|
committer | Bastien Bouclet | 2017-07-22 20:38:56 +0200 |
commit | 75040819c6642c304962d02ba646e04242cd4755 (patch) | |
tree | 26cc83e127cb0907259a24324e41517a2ff31b5f /engines/mohawk/myst_stacks/mechanical.cpp | |
parent | a2fc282e1c872a725f58b5d87d783191f1fe3987 (diff) | |
download | scummvm-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_stacks/mechanical.cpp')
-rw-r--r-- | engines/mohawk/myst_stacks/mechanical.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/engines/mohawk/myst_stacks/mechanical.cpp b/engines/mohawk/myst_stacks/mechanical.cpp index 09a876e107..5a1b5e04ae 100644 --- a/engines/mohawk/myst_stacks/mechanical.cpp +++ b/engines/mohawk/myst_stacks/mechanical.cpp @@ -283,7 +283,7 @@ void Mechanical::o_birdCrankStart(uint16 op, uint16 var, uint16 argc, uint16 *ar MystAreaDrag *crank = getInvokingResource<MystAreaDrag>(); uint16 crankSoundId = crank->getList2(0); - _vm->_sound->replaceSoundMyst(crankSoundId, Audio::Mixer::kMaxChannelVolume, true); + _vm->_sound->playEffect(crankSoundId, true); _birdSingEndTime = 0; _birdCrankStartTime = _vm->_system->getMillis(); @@ -301,7 +301,7 @@ void Mechanical::o_birdCrankStop(uint16 op, uint16 var, uint16 argc, uint16 *arg crankMovie->pauseMovie(true); uint16 crankSoundId = crank->getList2(1); - _vm->_sound->replaceSoundMyst(crankSoundId); + _vm->_sound->playEffect(crankSoundId); _birdSingEndTime = 2 * _vm->_system->getMillis() - _birdCrankStartTime; _birdSinging = true; @@ -343,7 +343,7 @@ void Mechanical::o_elevatorRotationStart(uint16 op, uint16 var, uint16 argc, uin _elevatorRotationLeverMoving = true; _elevatorRotationSpeed = 0; - _vm->_sound->stopBackgroundMyst(); + _vm->_sound->stopBackground(); _vm->_cursor->setCursor(700); } @@ -407,7 +407,7 @@ void Mechanical::o_elevatorRotationStop(uint16 op, uint16 var, uint16 argc, uint // Increment position _state.elevatorRotation = (_state.elevatorRotation + 1) % 10; - _vm->_sound->replaceSoundMyst(_elevatorRotationSoundId); + _vm->_sound->playEffect(_elevatorRotationSoundId); _vm->redrawArea(11); } @@ -626,17 +626,17 @@ void Mechanical::elevatorGoMiddle_run() { _vm->_cursor->hideCursor(); _vm->playSoundBlocking(11120); _vm->_gfx->copyImageToBackBuffer(6118, Common::Rect(544, 333)); - _vm->_sound->replaceSoundMyst(12120); + _vm->_sound->playEffect(12120); _vm->_gfx->runTransition(kTransitionSlideToLeft, Common::Rect(177, 0, 370, 333), 25, 0); _vm->playSoundBlocking(13120); - _vm->_sound->replaceSoundMyst(8120); + _vm->_sound->playEffect(8120); _vm->_gfx->copyImageToBackBuffer(6327, Common::Rect(544, 333)); _vm->wait(500); - _vm->_sound->replaceSoundMyst(9120); + _vm->_sound->playEffect(9120); static uint16 moviePos[2] = { 3540, 5380 }; o_elevatorWindowMovie(121, 0, 2, moviePos); _vm->_gfx->copyBackBufferToScreen(Common::Rect(544, 333)); - _vm->_sound->replaceSoundMyst(10120); + _vm->_sound->playEffect(10120); _vm->_cursor->showCursor(); _elevatorPosition = 1; @@ -754,7 +754,7 @@ void Mechanical::birdSing_run() { uint32 time = _vm->_system->getMillis(); if (_birdSingEndTime < time) { _bird->pauseMovie(true); - _vm->_sound->stopSound(); + _vm->_sound->stopEffect(); _birdSinging = false; } } @@ -784,7 +784,7 @@ void Mechanical::elevatorRotation_run() { _state.elevatorRotation = (_state.elevatorRotation + 1) % 10; - _vm->_sound->replaceSoundMyst(_elevatorRotationSoundId); + _vm->_sound->playEffect(_elevatorRotationSoundId); _vm->redrawArea(11); _vm->wait(100); } @@ -910,15 +910,15 @@ void Mechanical::o_fortressRotation_init(uint16 op, uint16 var, uint16 argc, uin void Mechanical::fortressSimulation_run() { if (_fortressSimulationInit) { // Init sequence - _vm->_sound->replaceBackgroundMyst(_fortressSimulationStartSound1, 65535); + _vm->_sound->playBackground(_fortressSimulationStartSound1, 65535); _vm->wait(5000, true); VideoEntryPtr startup = _fortressSimulationStartup->playMovie(); _vm->playSoundBlocking(_fortressSimulationStartSound2); - _vm->_sound->replaceBackgroundMyst(_fortressSimulationStartSound1, 65535); + _vm->_sound->playBackground(_fortressSimulationStartSound1, 65535); _vm->waitUntilMovieEnds(startup); - _vm->_sound->stopBackgroundMyst(); - _vm->_sound->replaceSoundMyst(_fortressSimulationStartSound2); + _vm->_sound->stopBackground(); + _vm->_sound->playEffect(_fortressSimulationStartSound2); Common::Rect src = Common::Rect(0, 0, 176, 176); |