aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
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);