diff options
Diffstat (limited to 'engines/sci/sound/soundcmd.cpp')
-rw-r--r-- | engines/sci/sound/soundcmd.cpp | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp index a91b103214..274c532779 100644 --- a/engines/sci/sound/soundcmd.cpp +++ b/engines/sci/sound/soundcmd.cpp @@ -37,7 +37,15 @@ SoundCommandParser::SoundCommandParser(ResourceManager *resMan, SegManager *segM _music = new SciMusic(_soundVersion); _music->init(); + // Check if the user wants synthesized or digital sound effects in SCI1.1 + // or later games _bMultiMidi = ConfMan.getBool("multi_midi"); + // In SCI2 and later games, this check should always be true - there was + // always only one version of each sound effect or digital music track + // (e.g. the menu music in GK1 - there is a sound effect with the same + // resource number, but it's totally unrelated to the menu music). + if (getSciVersion() >= SCI_VERSION_2) + _bMultiMidi = true; } SoundCommandParser::~SoundCommandParser() { @@ -75,13 +83,16 @@ void SoundCommandParser::initSoundResource(MusicEntry *newSound) { // effects. If the resource exists, play it using map 65535 (sound // effects map) bool checkAudioResource = getSciVersion() >= SCI_VERSION_1_1; - if (g_sci->getGameId() == GID_HOYLE4) - checkAudioResource = false; // hoyle 4 has garbled audio resources in place of the sound resources - // if we play those, we will only make the user deaf and break speakers. Sierra SCI doesn't play anything - // on soundblaster. FIXME: check, why this is + // Hoyle 4 has garbled audio resources in place of the sound resources. + // The demo of GK1 has no alternate sound effects. + if ((g_sci->getGameId() == GID_HOYLE4) || + (g_sci->getGameId() == GID_GK1 && g_sci->isDemo())) + checkAudioResource = false; if (checkAudioResource && _resMan->testResource(ResourceId(kResourceTypeAudio, newSound->resourceId))) { - // Found a relevant audio resource, create an audio stream + // Found a relevant audio resource, create an audio stream if there is + // no associated sound resource, or if both resources exist and the + // user wants the digital version. if (_bMultiMidi || !newSound->soundRes) { int sampleLen; newSound->pStreamAud = _audio->getAudioStream(newSound->resourceId, 65535, &sampleLen); @@ -123,8 +134,6 @@ void SoundCommandParser::processInitSound(reg_t obj) { writeSelectorValue(_segMan, obj, SELECTOR(state), kSoundInitialized); else writeSelector(_segMan, obj, SELECTOR(nodePtr), obj); - - writeSelector(_segMan, obj, SELECTOR(handle), obj); } } @@ -138,9 +147,9 @@ void SoundCommandParser::processPlaySound(reg_t obj) { MusicEntry *musicSlot = _music->getSlot(obj); if (!musicSlot) { warning("kDoSound(play): Slot not found (%04x:%04x), initializing it manually", PRINT_REG(obj)); - // The sound hasn't been initialized for some reason, so initialize it here. - // Happens in KQ6, room 460, when giving the creature to the bookwork (the - // bookworm's child). Fixes bug #3413301. + // The sound hasn't been initialized for some reason, so initialize it + // here. Happens in KQ6, room 460, when giving the creature (child) to + // the bookworm. Fixes bugs #3413301 and #3421098. processInitSound(obj); musicSlot = _music->getSlot(obj); if (!musicSlot) |