diff options
author | Colin Snover | 2017-06-18 00:36:46 -0500 |
---|---|---|
committer | Colin Snover | 2017-06-18 21:42:58 -0500 |
commit | 87895b97f76488d531c50c05a25aaabc4d73aaf3 (patch) | |
tree | a0fab5e26c8871d25c67b71152acf06dfc3a582f | |
parent | d556dcc57bf50a03d81ab7a1ef59a9e5758465bf (diff) | |
download | scummvm-rg350-87895b97f76488d531c50c05a25aaabc4d73aaf3.tar.gz scummvm-rg350-87895b97f76488d531c50c05a25aaabc4d73aaf3.tar.bz2 scummvm-rg350-87895b97f76488d531c50c05a25aaabc4d73aaf3.zip |
SCI: Fix looping of sounds that are not initialized yet
This fixes at least the character selection screen in QFG4CD,
where the sound for the torches is supposed to loop, but wasn't
because kDoSoundSetLoop would bail out before setting the loop
property on the soundObj.
-rw-r--r-- | engines/sci/sound/soundcmd.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp index f7cb6cda5c..280015f222 100644 --- a/engines/sci/sound/soundcmd.cpp +++ b/engines/sci/sound/soundcmd.cpp @@ -767,6 +767,9 @@ reg_t SoundCommandParser::kDoSoundSetLoop(EngineState *s, int argc, reg_t *argv) debugC(kDebugLevelSound, "kDoSound(setLoop): %04x:%04x, %d", PRINT_REG(obj), value); + const uint16 loopCount = value == -1 ? 0xFFFF : 1; + writeSelectorValue(_segMan, obj, SELECTOR(loop), loopCount); + MusicEntry *musicSlot = _music->getSlot(obj); if (!musicSlot) { // Apparently, it's perfectly normal for a game to call cmdSetSoundLoop @@ -782,9 +785,6 @@ reg_t SoundCommandParser::kDoSoundSetLoop(EngineState *s, int argc, reg_t *argv) return s->r_acc; } - const uint16 loopCount = value == -1 ? 0xFFFF : 1; - writeSelectorValue(_segMan, obj, SELECTOR(loop), loopCount); - #ifdef ENABLE_SCI32 if (_soundVersion >= SCI_VERSION_2_1_MIDDLE && musicSlot->isSample) { g_sci->_audio32->setLoop(ResourceId(kResourceTypeAudio, musicSlot->resourceId), musicSlot->soundObj, value == -1); |