aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorPaweł Kołodziejski2005-01-28 11:51:57 +0000
committerPaweł Kołodziejski2005-01-28 11:51:57 +0000
commitac06b418946773d49341d9b7ac3404e3ec0998b4 (patch)
tree2ede28b2756ee298518ebb2103d03b074d26052f /scumm
parentad7cc6cef492aced6d695b945a93f639a3815756 (diff)
downloadscummvm-rg350-ac06b418946773d49341d9b7ac3404e3ec0998b4.tar.gz
scummvm-rg350-ac06b418946773d49341d9b7ac3404e3ec0998b4.tar.bz2
scummvm-rg350-ac06b418946773d49341d9b7ac3404e3ec0998b4.zip
fixed restoration of sounds params after cross non/compressed bundles
svn-id: r16660
Diffstat (limited to 'scumm')
-rw-r--r--scumm/imuse_digi/dimuse.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/scumm/imuse_digi/dimuse.cpp b/scumm/imuse_digi/dimuse.cpp
index f8e5228d16..764d618358 100644
--- a/scumm/imuse_digi/dimuse.cpp
+++ b/scumm/imuse_digi/dimuse.cpp
@@ -149,15 +149,32 @@ void IMuseDigital::saveOrLoad(Serializer *ser) {
assert(track->soundHandle);
if (track->compressed) {
track->regionOffset = 0;
- track->dataOffset = _sound->getRegionOffset(track->soundHandle, track->curRegion);
}
track->compressed = _sound->isCompressed(track->soundHandle);
if (track->compressed) {
track->regionOffset = 0;
- track->dataOffset = _sound->getRegionOffset(track->soundHandle, track->curRegion);
}
+ track->dataOffset = _sound->getRegionOffset(track->soundHandle, track->curRegion);
+ int bits = _sound->getBits(track->soundHandle);
+ int channels = _sound->getChannels(track->soundHandle);
+ int freq = _sound->getFreq(track->soundHandle);
+ track->iteration = freq * channels;
+ track->mixerFlags = 0;
+ if (channels == 2)
+ track->mixerFlags = SoundMixer::FLAG_STEREO | SoundMixer::FLAG_REVERSE_STEREO;
+
+ if ((bits == 12) || (bits == 16)) {
+ track->mixerFlags |= SoundMixer::FLAG_16BITS;
+ track->iteration *= 2;
+ } else if (bits == 8) {
+ track->mixerFlags |= SoundMixer::FLAG_UNSIGNED;
+ } else
+ error("IMuseDigital::saveOrLoad(): Can't handle %d bit samples", bits);
+
+ if (track->compressed)
+ track->mixerFlags |= SoundMixer::FLAG_LITTLE_ENDIAN;
+
int32 streamBufferSize = track->iteration;
- int freq = _sound->getFreq(track->soundHandle);
track->stream2 = NULL;
track->stream = makeAppendableAudioStream(freq, track->mixerFlags, streamBufferSize);