diff options
author | Filippos Karapetis | 2009-07-06 15:50:44 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-07-06 15:50:44 +0000 |
commit | 30d1462da058b8e4f53e43885714556b1eaa0a55 (patch) | |
tree | 25183c468e5e589e6f46b81d6e54810cd113cf5d | |
parent | 8f284ad396445549602369c9c2158280b9784fc2 (diff) | |
download | scummvm-rg350-30d1462da058b8e4f53e43885714556b1eaa0a55.tar.gz scummvm-rg350-30d1462da058b8e4f53e43885714556b1eaa0a55.tar.bz2 scummvm-rg350-30d1462da058b8e4f53e43885714556b1eaa0a55.zip |
Swapped the music and audio resource check for SCI1.1 games. Digital sound effects are now preferred over the synthesized ones
svn-id: r42179
-rw-r--r-- | engines/sci/engine/ksound.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp index 1e35efffaf..f1584bf975 100644 --- a/engines/sci/engine/ksound.cpp +++ b/engines/sci/engine/ksound.cpp @@ -807,20 +807,24 @@ reg_t kDoSound_SCI1(EngineState *s, int funct_nr, int argc, reg_t *argv) { } if (!GET_SEL32V(obj, nodePtr) && obj.segment) { - if (!s->resmgr->testResource(ResourceId(kResourceTypeSound, number))) { - // Check if the resource exists as an audio resource - this can happen - // in SQ4CD and perhaps other games as well. If the resource exists, play - // it using map 65535 (sound effects map). - if (s->resmgr->testResource(ResourceId(kResourceTypeAudio, number))) { - // Found a relevant audio resource, play it - PUT_SEL32V(obj, signal, s->_sound.startAudio(65535, number)); - } else { + // In SCI1.1 games, sound effects are started from here. If we can find + // a relevant audio resource, play it, otherwise switch to synthesized + // effects. If the resource exists, play it using map 65535 (sound + // effects map) + if (s->resmgr->testResource(ResourceId(kResourceTypeAudio, number)) && + s->_version >= SCI_VERSION_1_1) { + // Found a relevant audio resource, play it + s->_sound.stopAudio(); + PUT_SEL32V(obj, signal, s->_sound.startAudio(65535, number)); + return s->r_acc; + } else { + if (!s->resmgr->testResource(ResourceId(kResourceTypeSound, number))) { warning("Could not open song number %d", number); // Send a "stop handle" event so that the engine won't wait forever here s->_sound.sfx_song_set_status(handle, SOUND_STATUS_STOPPED); PUT_SEL32V(obj, signal, -1); + return s->r_acc; } - return s->r_acc; } debugC(2, kDebugLevelSound, "Initializing song number %d\n", number); |