aboutsummaryrefslogtreecommitdiff
path: root/engines/saga/sndres.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2007-07-10 23:22:44 +0000
committerFilippos Karapetis2007-07-10 23:22:44 +0000
commit0ed332acba26adb741e3ee7d3146eac2a9e4af60 (patch)
tree9e9731383b9d8db2003d39e052c6ab8c376802fd /engines/saga/sndres.cpp
parent7a7212b9c17a195111d4e43c73bfda65437b4ec3 (diff)
downloadscummvm-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.cpp10
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;