[Scummvm-cvs-logs] CVS: scummvm/scumm imuse.cpp,1.26,1.27

Pawe? Ko?odziejski aquadran at users.sourceforge.net
Wed Oct 2 11:54:15 CEST 2002


Update of /cvsroot/scummvm/scummvm/scumm
In directory usw-pr-cvs1:/tmp/cvs-serv30793

Modified Files:
	imuse.cpp 
Log Message:
fix for imuse

Index: imuse.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- imuse.cpp	2 Oct 2002 17:31:53 -0000	1.26
+++ imuse.cpp	2 Oct 2002 18:51:58 -0000	1.27
@@ -4902,11 +4902,8 @@
 				}
 			} else if (_channel[l]._bits == 8) {
 				for(i = 0; i < (mixer_size / 2); i++) {
-					byte sample1 = buf[i * 2 + 0];
-					byte sample2 = buf[i * 2 + 1];
-					uint16 sample_a = (uint16)(((int16)((sample1 << 8) | sample2) * _channel[l]._volumeLeft) >> 8);
-					buf[i * 2 + 0] = (byte)(sample_a >> 8);
-					buf[i * 2 + 1] = (byte)(sample_a & 0xff);
+					buf[i * 2 + 0] = (byte)(((int16)(buf[i * 2 + 0] * _channel[l]._volumeLeft)) >> 8);
+					buf[i * 2 + 1] = (byte)(((int16)(buf[i * 2 + 1] * _channel[l]._volumeRight)) >> 8);
 				}
 			}
 
@@ -5045,7 +5042,7 @@
 			if (_channel[l]._bits == 12) {
 				_channel[l]._mixerSize *= 2;
 				_channel[l]._mixerFlags |= SoundMixer::FLAG_16BITS;
-				_channel[l]._size = _scumm->_sound->decode12BitsSample(ptr, &_channel[l]._data, size, (_channel[l]._channels == 1) ? false : true);
+				_channel[l]._size = _scumm->_sound->decode12BitsSample(ptr, &_channel[l]._data, size, (_channel[l]._channels == 2) ? false : true);
 			}
 			if (_channel[l]._bits == 8) {
 				_channel[l]._mixerFlags |= SoundMixer::FLAG_UNSIGNED;





More information about the Scummvm-git-logs mailing list