Permalink
Browse files

SCI: Load the correct sound effects in Hoyle 4

Fixes bug #10412
  • Loading branch information...
bluegr committed Aug 27, 2018
1 parent 26445f4 commit 7cbd3782f198ddc48eb00cf021abacf6a34f0afe
Showing with 6 additions and 7 deletions.
  1. +5 −1 engines/sci/resource.cpp
  2. +1 −6 engines/sci/sound/soundcmd.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);
@@ -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.

0 comments on commit 7cbd378

Please sign in to comment.