[Scummvm-cvs-logs] CVS: scummvm/scumm/smush codec47.cpp,1.52,1.53 saud_channel.cpp,1.15,1.16

Pawel Kolodziejski aquadran at users.sourceforge.net
Sat Jul 19 07:27:14 CEST 2003


Update of /cvsroot/scummvm/scummvm/scumm/smush
In directory sc8-pr-cvs1:/tmp/cvs-serv4794/scumm/smush

Modified Files:
	codec47.cpp saud_channel.cpp 
Log Message:
added vc7 files and fixed warnings. vc6 is no longer supported by me

Index: codec47.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/smush/codec47.cpp,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- codec47.cpp	7 Jun 2003 00:45:32 -0000	1.52
+++ codec47.cpp	19 Jul 2003 14:26:25 -0000	1.53
@@ -437,7 +437,7 @@
 	int16 *tmp_ptr = _table;
 	int16 *ptr_table = codec47_table;
 	do {
-		*tmp_ptr++ = ptr_table[1] * width + ptr_table[0];
+		*tmp_ptr++ = (int16)(ptr_table[1] * width + ptr_table[0]);
 		ptr_table += 2;
 	} while (tmp_ptr < &_table[255]);
 	a = 0;
@@ -445,25 +445,25 @@
 	do {
 		for (d = 0; d < _tableSmall[96 + c]; d++) {
 			tmp = _tableSmall[64 + c + d];
-			tmp = (byte)(tmp >> 2) * width + (tmp & 3);
+			tmp = (int16)((byte)(tmp >> 2) * width + (tmp & 3));
 			_tableSmall[c + d * 2] = (byte)tmp;
 			_tableSmall[c + d * 2 + 1] = tmp >> 8;
 		}
 		for (d = 0; d < _tableSmall[97 + c]; d++) {
 			tmp = _tableSmall[80 + c + d];
-			tmp = (byte)(tmp >> 2) * width + (tmp & 3);
+			tmp = (int16)((byte)(tmp >> 2) * width + (tmp & 3));
 			_tableSmall[32 + c + d * 2] = (byte)tmp;
 			_tableSmall[32 + c + d * 2 + 1] = tmp >> 8;
 		}
 		for (d = 0; d < _tableBig[384 + a]; d++) {
 			tmp = _tableBig[256 + a + d];
-			tmp = (byte)(tmp >> 3) * width + (tmp & 7);
+			tmp = (int16)((byte)(tmp >> 3) * width + (tmp & 7));
 			_tableBig[a + d * 2] = (byte)tmp;
 			_tableBig[a + d * 2 + 1] = tmp >> 8;
 		}
 		for (d = 0; d < _tableBig[385 + a]; d++) {
 			tmp = _tableBig[320 + a + d];
-			tmp = (byte)(tmp >> 3) * width + (tmp & 7);
+			tmp = (int16)((byte)(tmp >> 3) * width + (tmp & 7));
 			_tableBig[128 + a + d * 2] = (byte)tmp;
 			_tableBig[128 + a + d * 2 + 1] = tmp >> 8;
 		}

Index: saud_channel.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/smush/saud_channel.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- saud_channel.cpp	14 Jun 2003 18:52:29 -0000	1.15
+++ saud_channel.cpp	19 Jul 2003 14:26:25 -0000	1.16
@@ -178,14 +178,14 @@
 }
 
 void SaudChannel::recalcVolumeTable() {
-	const int32 MAX_BALANCE = 100;
-	int32 volume_left, volume_right;
+	const int MAX_BALANCE = 100;
+	int volume_left, volume_right;
 	if (_balance < -MAX_BALANCE || _balance > MAX_BALANCE) {
 		warning("balance is out of range ! : %d", _balance);
 		return;
 	}
-	int32 left_multiplier = MAX_BALANCE - _balance;
-	int32 right_multiplier = MAX_BALANCE + _balance;
+	int left_multiplier = MAX_BALANCE - _balance;
+	int right_multiplier = MAX_BALANCE + _balance;
 	volume_left = _volume * left_multiplier / (MAX_BALANCE * 2);
 	volume_right = _volume * right_multiplier / (MAX_BALANCE * 2);
 	if (volume_left < 0)
@@ -196,10 +196,10 @@
 		volume_right = 0;
 	if (volume_right > 128)
 		volume_right = 128;
-	for (int32 i = 0; i < 256; i++) {
-		int16 value = volume_left * (int8)i;
+	for (int i = 0; i < 256; i++) {
+		int16 value = volume_left * i;
 		_voltable[0][i] = TO_BE_16(value);
-		value = volume_right * (int8)i;
+		value = volume_right * i;
 		_voltable[1][i] = TO_BE_16(value);
 	}
 }





More information about the Scummvm-git-logs mailing list