aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2018-08-27 23:45:04 +0300
committerFilippos Karapetis2018-08-27 23:45:34 +0300
commit7cbd3782f198ddc48eb00cf021abacf6a34f0afe (patch)
tree4a640dc7e07202faccbe8023a14aa7a90c40a892 /engines
parent26445f4c26b1260a1020c759a6f517f1445c3498 (diff)
downloadscummvm-rg350-7cbd3782f198ddc48eb00cf021abacf6a34f0afe.tar.gz
scummvm-rg350-7cbd3782f198ddc48eb00cf021abacf6a34f0afe.tar.bz2
scummvm-rg350-7cbd3782f198ddc48eb00cf021abacf6a34f0afe.zip
SCI: Load the correct sound effects in Hoyle 4
Fixes bug #10412
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/resource.cpp6
-rw-r--r--engines/sci/sound/soundcmd.cpp7
2 files changed, 6 insertions, 7 deletions
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.