From 7cbd3782f198ddc48eb00cf021abacf6a34f0afe Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 27 Aug 2018 23:45:04 +0300 Subject: SCI: Load the correct sound effects in Hoyle 4 Fixes bug #10412 --- engines/sci/resource.cpp | 6 +++++- engines/sci/sound/soundcmd.cpp | 7 +------ 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'engines') diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index 78b641c9de..2f7297ca8e 100644 --- a/engines/sci/resource.cpp +++ b/engines/sci/resource.cpp @@ -2065,7 +2065,11 @@ bool ResourceManager::validateResource(const ResourceId &resourceId, const Commo Resource *ResourceManager::addResource(ResourceId resId, ResourceSource *src, uint32 offset, uint32 size, const Common::String &sourceMapLocation) { // Adding new resource only if it does not exist - if (_resMap.contains(resId) == false) { + // Hoyle 4 contains each audio resource twice. The first file is in an unknown + // format and only static sounds are heard when it's played. The second file + // is a typical SOL audio file. We therefore skip the first audio file and add + // second one for this game. + if (_resMap.contains(resId) == false || (resId.getType() == kResourceTypeAudio && g_sci && g_sci->getGameId() == GID_HOYLE4)) { return updateResource(resId, src, offset, size, sourceMapLocation); } else { return _resMap.getVal(resId); diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp index 7012746c80..d592dee3ad 100644 --- a/engines/sci/sound/soundcmd.cpp +++ b/engines/sci/sound/soundcmd.cpp @@ -100,12 +100,7 @@ void SoundCommandParser::initSoundResource(MusicEntry *newSound) { // a relevant audio resource, play it, otherwise switch to synthesized // effects. If the resource exists, play it using map 65535 (sound // effects map) - bool checkAudioResource = getSciVersion() >= SCI_VERSION_1_1; - // Hoyle 4 has garbled audio resources in place of the sound resources. - if (g_sci->getGameId() == GID_HOYLE4) - checkAudioResource = false; - - if (checkAudioResource && _resMan->testResource(ResourceId(kResourceTypeAudio, newSound->resourceId))) { + if (getSciVersion() >= SCI_VERSION_1_1 && _resMan->testResource(ResourceId(kResourceTypeAudio, newSound->resourceId))) { // 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. -- cgit v1.2.3