aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/resource_audio.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2010-08-20 09:35:20 +0000
committerFilippos Karapetis2010-08-20 09:35:20 +0000
commit31c889d7ce26c0386b39ee8664d05e87c53b8381 (patch)
treea569d0bcb820118240cfa906fd9dab9e2bcb7717 /engines/sci/resource_audio.cpp
parent588472a8e69e2ecc98e3bf03c62bff029e715b81 (diff)
downloadscummvm-rg350-31c889d7ce26c0386b39ee8664d05e87c53b8381.tar.gz
scummvm-rg350-31c889d7ce26c0386b39ee8664d05e87c53b8381.tar.bz2
scummvm-rg350-31c889d7ce26c0386b39ee8664d05e87c53b8381.zip
SCI: Fixed the GM detection introduced in rev #52211 to check the first available track, instead of track 1 (which doesn't always exist, e.g. in Pharkas). Also, added a comment inside applyPatch()
svn-id: r52222
Diffstat (limited to 'engines/sci/resource_audio.cpp')
-rw-r--r--engines/sci/resource_audio.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/engines/sci/resource_audio.cpp b/engines/sci/resource_audio.cpp
index 5457c1eb38..590926dbbd 100644
--- a/engines/sci/resource_audio.cpp
+++ b/engines/sci/resource_audio.cpp
@@ -531,9 +531,15 @@ bool ResourceManager::isGMTrackIncluded() {
// For the leftover games, we can safely use SCI_VERSION_1_EARLY for the soundVersion
const SciVersion soundVersion = SCI_VERSION_1_EARLY;
- // Read song 1 and check if it has a GM track
+ // Read the first song and check if it has a GM track
bool result = false;
- SoundResource *song1 = new SoundResource(1, this, soundVersion);
+ Common::List<ResourceId> *resources = listResources(kResourceTypeSound, -1);
+ Common::sort(resources->begin(), resources->end());
+ Common::List<ResourceId>::iterator itr = resources->begin();
+ int firstSongId = itr->getNumber();
+ delete resources;
+
+ SoundResource *song1 = new SoundResource(firstSongId, this, soundVersion);
if (!song1) {
warning("ResourceManager::isGMTrackIncluded: track 1 not found");
return false;