aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorPaweł Kołodziejski2002-05-22 05:55:10 +0000
committerPaweł Kołodziejski2002-05-22 05:55:10 +0000
commitc9f67e27b37395d5287852522e1be364d72dcace (patch)
tree48103f0aa7ccab20fd78166d791b17910f7ecc22 /sound
parent162cd3a9c87279acfffdc736fa011c747e6d44a8 (diff)
downloadscummvm-rg350-c9f67e27b37395d5287852522e1be364d72dcace.tar.gz
scummvm-rg350-c9f67e27b37395d5287852522e1be364d72dcace.tar.bz2
scummvm-rg350-c9f67e27b37395d5287852522e1be364d72dcace.zip
Fix for mixer 16 bits samples. Samples are clear now.
bbrox: This patch works fine for me, previous not. (MSVC6 + SP5) svn-id: r4368
Diffstat (limited to 'sound')
-rw-r--r--sound/mixer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/mixer.cpp b/sound/mixer.cpp
index de5681b3dd..a804d60f39 100644
--- a/sound/mixer.cpp
+++ b/sound/mixer.cpp
@@ -267,7 +267,7 @@ static void mix_signed_mono_16(int16 *data, uint len, byte **s_ptr, uint32 *fp_p
unsigned char volume = ((int) vol_tab[1]) * 32 / 255;
byte *s = *s_ptr;
do {
- int16 sample = (int16) (((int32) ((*s << 8) | *(s + 1))) * volume / 32);
+ int16 sample = (((int16)(*s << 8) | *(s + 1)) * volume) / 32;
fp_pos += fp_speed;
*data++ += sample;
*data++ += sample;
@@ -287,8 +287,8 @@ static void mix_signed_stereo_16(int16 *data, uint len, byte **s_ptr, uint32 *fp
byte *s = *s_ptr;
do {
fp_pos += fp_speed;
- *data++ += (int16) ((((int32) ((*(s ) << 8) | *(s + 1))) * volume) / 32);
- *data++ += (int16) ((((int32) ((*(s + 2) << 8) | *(s + 3))) * volume) / 32);
+ *data++ += (((int16)(*(s ) << 8) | *(s + 1)) * volume) / 32;
+ *data++ += (((int16)(*(s + 2) << 8) | *(s + 3)) * volume) / 32;
s += (fp_pos >> 16) << 2;
fp_pos &= 0x0000FFFF;
} while (--len);