From a48591ae0d83c1603e518a076449b99877904177 Mon Sep 17 00:00:00 2001 From: athrxx Date: Sun, 22 Dec 2019 18:52:57 +0100 Subject: KYRA: (HOF) - fix bug #10877 (Sound issues in the Legend of Kyrandia 2) --- engines/kyra/script/script_hof.cpp | 4 ++-- engines/kyra/sound/sound.h | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/kyra/script/script_hof.cpp b/engines/kyra/script/script_hof.cpp index 94d3a82cc4..ebc10c277a 100644 --- a/engines/kyra/script/script_hof.cpp +++ b/engines/kyra/script/script_hof.cpp @@ -817,8 +817,8 @@ int KyraEngine_HoF::o2_showLetter(EMCState *script) { int KyraEngine_HoF::o2_playFireflyScore(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_playFireflyScore(%p) ()", (const void *)script); - if (_sound->getSfxType() == Sound::kAdLib || _sound->getSfxType() == Sound::kPCSpkr || - _sound->getSfxType() == Sound::kMidiMT32 || _sound->getSfxType() == Sound::kMidiGM) { + if ((_sound->getSfxType() == Sound::kAdLib || _sound->getSfxType() == Sound::kPCSpkr || _sound->getSfxType() == Sound::kMidiMT32 || + _sound->getSfxType() == Sound::kMidiGM) && !_sound->useDigitalSfx()) { snd_playWanderScoreViaMap(86, 1); return 1; } else { diff --git a/engines/kyra/sound/sound.h b/engines/kyra/sound/sound.h index 6c45d8b59b..531496b39e 100644 --- a/engines/kyra/sound/sound.h +++ b/engines/kyra/sound/sound.h @@ -107,6 +107,11 @@ public: virtual kType getMusicType() const = 0; virtual kType getSfxType() const; + // This is obviously not a real implementation. The original allows disabling digital sfx (or simply not having a suitable sound card), + // thus falling back to the music driver's sfx. We never supported this, since we don't even have a setting for it in the launcher. + // Currently, the only purpose of this function is fixing KyraEngine_HoF::o2_playFireflyScore() (bug #10877: "Sound issues in the Legend of Kyrandia 2"). + virtual bool useDigitalSfx() const { return true; } + /** * Initializes the output device. * -- cgit v1.2.3