[Scummvm-cvs-logs] CVS: scummvm/sound mixer.cpp,1.74,1.75

Max Horn fingolfin at users.sourceforge.net
Fri Jul 25 18:45:17 CEST 2003


Update of /cvsroot/scummvm/scummvm/sound
In directory sc8-pr-cvs1:/tmp/cvs-serv27763

Modified Files:
	mixer.cpp 
Log Message:
oops accidentally broke the 'old' 8bit resampling code :-(

Index: mixer.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mixer.cpp,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -d -r1.74 -r1.75
--- mixer.cpp	25 Jul 2003 01:19:14 -0000	1.74
+++ mixer.cpp	26 Jul 2003 01:44:37 -0000	1.75
@@ -432,7 +432,7 @@
 	int a, b, c, d;
 
 public:
-	CubicInterpolator(int a0, int b0, int c0) : x0(2 * a0 - b0), x1(a0), x2(b0), x3(c0) {
+	CubicInterpolator(int8 a0, int8 b0, int8 c0) : x0(2 * a0 - b0), x1(a0), x2(b0), x3(c0) {
 		// We use a simple linear interpolation for x0
 		updateCoefficients();
 	}
@@ -445,7 +445,7 @@
 		updateCoefficients();
 	}
 
-	inline void feedData(int xNew) {
+	inline void feedData(int8 xNew) {
 		x0 = x1;
 		x1 = x2;
 		x2 = x3;
@@ -492,7 +492,7 @@
 
 	do {
 		do {
-			result = interp.interpolate(fp_pos) * volume / 256;
+			result = interp.interpolate(fp_pos) * volume;
 
 			clamped_add_16(*data++, result);
 			clamped_add_16(*data++, result);
@@ -519,7 +519,7 @@
 
 	do {
 		do {
-			result = interp.interpolate(fp_pos) * volume / 256;
+			result = interp.interpolate(fp_pos) * volume;
 
 			clamped_add_16(*data++, result);
 			clamped_add_16(*data++, result);
@@ -552,11 +552,11 @@
 	do {
 		do {
 			if (!reverse_stereo) {
-				clamped_add_16(*data++, left.interpolate(fp_pos) * volume / 256);
-				clamped_add_16(*data++, right.interpolate(fp_pos) * volume / 256);
+				clamped_add_16(*data++, left.interpolate(fp_pos) * volume);
+				clamped_add_16(*data++, right.interpolate(fp_pos) * volume);
 			} else {
-				clamped_add_16(*data++, right.interpolate(fp_pos) * volume / 256);
-				clamped_add_16(*data++, left.interpolate(fp_pos) * volume / 256);
+				clamped_add_16(*data++, right.interpolate(fp_pos) * volume);
+				clamped_add_16(*data++, left.interpolate(fp_pos) * volume);
 			}
 
 			fp_pos += fp_speed;





More information about the Scummvm-git-logs mailing list