diff options
Diffstat (limited to 'engines/sci/sound')
-rw-r--r-- | engines/sci/sound/soundcmd.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp index b23aed4745..26fbfb6c7c 100644 --- a/engines/sci/sound/soundcmd.cpp +++ b/engines/sci/sound/soundcmd.cpp @@ -209,30 +209,30 @@ void SoundCommandParser::processStopSound(reg_t obj, bool sampleFinishedPlaying) } reg_t SoundCommandParser::kDoSoundPause(int argc, reg_t *argv, reg_t acc) { + if (_soundVersion <= SCI_VERSION_0_LATE) { + uint16 value = argv[0].toUint16(); + MusicEntry *musicSlot = _music->getActiveSci0MusicSlot(); + switch (value) { + case 1: + if ((musicSlot) && (musicSlot->status == kSoundPlaying)) + _music->soundPause(musicSlot); + return make_reg(0, 0); + case 0: + if ((musicSlot) && (musicSlot->status == kSoundPaused)) { + _music->soundResume(musicSlot); + return make_reg(0, 1); + } + return make_reg(0, 0); + default: + error("kDoSoundPause: parameter 0 is invalid for sound-sci0"); + } + } + reg_t obj = argv[0]; uint16 value = argc > 1 ? argv[1].toUint16() : 0; - if (!obj.segment) { // pause the whole playlist // SCI0 games (up to including qfg1) give us 0/1 for either resuming or pausing the current music // this one doesn't count, so pausing 2 times and resuming once means here that we are supposed to resume - if (_soundVersion <= SCI_VERSION_0_LATE) { - // TODO: this code doesn't work right currently - return make_reg(0, 0); - MusicEntry *musicSlot = _music->getActiveSci0MusicSlot(); - switch (obj.offset) { - case 1: - if ((musicSlot) && (musicSlot->status == kSoundPlaying)) - _music->soundPause(musicSlot); - return make_reg(0, 0); - case 0: - if ((musicSlot) && (musicSlot->status == kSoundPaused)) - _music->soundResume(musicSlot); - return make_reg(0, 1); - return make_reg(0, 0); - default: - error("kDoSoundPause: parameter 0 is invalid for sound-sci0"); - } - } // Pausing/Resuming the whole playlist was introduced in the SCI1 late sound scheme. if (_soundVersion <= SCI_VERSION_1_EARLY) |