aboutsummaryrefslogtreecommitdiff
path: root/sound.cpp
diff options
context:
space:
mode:
authorPaweł Kołodziejski2002-05-19 15:20:18 +0000
committerPaweł Kołodziejski2002-05-19 15:20:18 +0000
commitc9a53bcf7616ded009df401cc84dbc90e1b4092f (patch)
treedbe061e4f67d5a8e36f1d225487a23d895a6cd62 /sound.cpp
parentdb9cdefa408bfb4c5d97ef6e8aa0a0b39e40515f (diff)
downloadscummvm-rg350-c9a53bcf7616ded009df401cc84dbc90e1b4092f.tar.gz
scummvm-rg350-c9a53bcf7616ded009df401cc84dbc90e1b4092f.tar.bz2
scummvm-rg350-c9a53bcf7616ded009df401cc84dbc90e1b4092f.zip
The Dig: 16 bit samples and mixer
svn-id: r4358
Diffstat (limited to 'sound.cpp')
-rw-r--r--sound.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/sound.cpp b/sound.cpp
index fe56ceb386..197e0aa4a4 100644
--- a/sound.cpp
+++ b/sound.cpp
@@ -125,23 +125,23 @@ void Scumm::processSoundQues()
}
if (bits == 12) {
uint32 s_size = (size * 2) / 3;
- byte * buffer = (byte*)malloc (s_size);
+ byte * buffer = (byte*)malloc (s_size + 4);
uint32 l = 0, r = 0, tmp;
for (; l < size; l += 3)
{
tmp = (ptr[l + 1] & 0x0f) << 8;
tmp = (tmp | ptr[l + 0]) << 4;
tmp -= 0x8000;
-// buffer[r++] = (uint8)(tmp & 0xff);
buffer[r++] = (uint8)((tmp >> 8) & 0xff);
+ buffer[r++] = (uint8)(tmp & 0xff);
tmp = (ptr[l + 1] & 0xf0) << 4;
tmp = (tmp | ptr[l + 2]) << 4;
tmp -= 0x8000;
-// buffer[r++] = (uint8)(tmp & 0xff);
buffer[r++] = (uint8)((tmp >> 8) & 0xff);
+ buffer[r++] = (uint8)(tmp & 0xff);
}
- _mixer->play_raw(NULL, buffer, s_size, rate, SoundMixer::FLAG_AUTOFREE);
+ _mixer->play_raw(NULL, buffer, s_size, rate, SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_16BITS);
}
} else {
warning("DIG: ignoring stereo sample");