[Scummvm-git-logs] scummvm master -> 7cbd3782f198ddc48eb00cf021abacf6a34f0afe

bluegr bluegr at gmail.com
Mon Aug 27 22:45:58 CEST 2018


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
7cbd3782f1 SCI: Load the correct sound effects in Hoyle 4


Commit: 7cbd3782f198ddc48eb00cf021abacf6a34f0afe
    https://github.com/scummvm/scummvm/commit/7cbd3782f198ddc48eb00cf021abacf6a34f0afe
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2018-08-27T23:45:34+03:00

Commit Message:
SCI: Load the correct sound effects in Hoyle 4

Fixes bug #10412

Changed paths:
    engines/sci/resource.cpp
    engines/sci/sound/soundcmd.cpp


diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 78b641c..2f7297c 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 7012746..d592dee 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.





More information about the Scummvm-git-logs mailing list