diff options
author | Filippos Karapetis | 2007-07-10 23:22:44 +0000 |
---|---|---|
committer | Filippos Karapetis | 2007-07-10 23:22:44 +0000 |
commit | 0ed332acba26adb741e3ee7d3146eac2a9e4af60 (patch) | |
tree | 9e9731383b9d8db2003d39e052c6ab8c376802fd /engines/saga/sndres.cpp | |
parent | 7a7212b9c17a195111d4e43c73bfda65437b4ec3 (diff) | |
download | scummvm-rg350-0ed332acba26adb741e3ee7d3146eac2a9e4af60.tar.gz scummvm-rg350-0ed332acba26adb741e3ee7d3146eac2a9e4af60.tar.bz2 scummvm-rg350-0ed332acba26adb741e3ee7d3146eac2a9e4af60.zip |
Fix for bug #1751344 - "ITE: p2_a.iaf not played correctly"
svn-id: r28018
Diffstat (limited to 'engines/saga/sndres.cpp')
-rw-r--r-- | engines/saga/sndres.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/engines/saga/sndres.cpp b/engines/saga/sndres.cpp index ceb1ebf630..c0c63eb06c 100644 --- a/engines/saga/sndres.cpp +++ b/engines/saga/sndres.cpp @@ -169,7 +169,6 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff MemoryReadStream readS(soundResource, soundResourceLength); resourceType = soundInfo->resourceType; - buffer.isBigEndian = soundInfo->isBigEndian; if (soundResourceLength >= 8) { if (!memcmp(soundResource, "Creative", 8)) { @@ -178,7 +177,9 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff resourceType = kSoundWAV; } - if (_vm->getFeatures() & GF_COMPRESSED_SOUNDS) { + // If the game has patch files, then it includes a patch file for sound resource 4, used in the intro. + // Don't treat this patch file as compressed sound. This file is always included if patch files are present + if ((_vm->getFeatures() & GF_COMPRESSED_SOUNDS) && !(_vm->getPatchesCount() > 0 && resourceId == 4)) { if (soundResource[0] == char(0)) { resourceType = kSoundMP3; } else if (soundResource[0] == char(1)) { @@ -190,6 +191,9 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff } + buffer.isBigEndian = soundInfo->isBigEndian; + buffer.soundType = resourceType; + buffer.originalSize = 0; switch (resourceType) { case kSoundPCM: @@ -319,7 +323,7 @@ int SndRes::getVoiceLength(uint32 resourceId) { return -1; } - if (!(_vm->getFeatures() & GF_COMPRESSED_SOUNDS)) + if (!(_vm->getFeatures() & GF_COMPRESSED_SOUNDS) || buffer.originalSize == 0) msDouble = (double)buffer.size; else msDouble = (double)buffer.originalSize; |