[Scummvm-cvs-logs] CVS: scummvm/scumm/smush channel.h,1.13,1.14 smush_player.cpp,1.83,1.84

Max Horn fingolfin at users.sourceforge.net
Wed Dec 24 18:47:00 CET 2003


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

Modified Files:
	channel.h smush_player.cpp 
Log Message:
cleanup

Index: channel.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/smush/channel.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- channel.h	3 Oct 2003 18:33:56 -0000	1.13
+++ channel.h	25 Dec 2003 02:46:04 -0000	1.14
@@ -80,7 +80,7 @@
 	bool appendData(Chunk &b, int32 size);
 	int32 availableSoundData() const;
 	void getSoundData(int16 *sound_buffer, int32 size);
-	void getSoundData(int8 *sound_buffer, int32 size) { error("16bit request for SAUD channel should never happen"); };
+	void getSoundData(int8 *sound_buffer, int32 size) { error("8bit request for SAUD channel should never happen"); };
 	int32 getRate() { return _frequency; }
 	bool getParameters(int32 &rate, bool &stereo, bool &is_16bit) { 
 		rate = _frequency;

Index: smush_player.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/smush/smush_player.cpp,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -d -r1.83 -r1.84
--- smush_player.cpp	25 Dec 2003 00:18:41 -0000	1.83
+++ smush_player.cpp	25 Dec 2003 02:46:04 -0000	1.84
@@ -419,9 +419,7 @@
 		byte *d_src = src;
 		byte value;
 
-		do {
-			if (bsize == 0)
-				break;
+		while (bsize > 0) {
 			if (_IACTpos >= 2) {
 				int32 len = READ_BE_UINT16(_IACToutput) + 2;
 				len -= _IACTpos;
@@ -468,26 +466,16 @@
 					_IACTpos = 0;
 				}
 			} else {
-				if (bsize == 1) {
-					if (_IACTpos != 0) {
-						*(_IACToutput + 1) = *d_src++;
-						_IACTpos = 2;
-						bsize--;
-						continue;
-					}
-					bsize = 0;
-					*(_IACToutput + 0) = *d_src;
-					_IACTpos = 1;
-					continue;
-				} else if (_IACTpos == 0) {
+				if (bsize > 1 && _IACTpos == 0) {
 					*(_IACToutput + 0) = *d_src++;
+					_IACTpos = 1;
 					bsize--;
 				}
-				*(_IACToutput + 1) = *d_src++;
-				_IACTpos = 2;
+				*(_IACToutput + _IACTpos) = *d_src++;
+				_IACTpos++;
 				bsize--;
 			}	
-		} while (bsize != 0);
+		}
 	
 		free(src);
 	}





More information about the Scummvm-git-logs mailing list