[Scummvm-cvs-logs] CVS: scummvm/simon debug.cpp,1.22,1.23 simon.cpp,1.332,1.333 sound.cpp,1.49,1.50 vga.cpp,1.89,1.90

Pawel Kolodziejski aquadran at users.sourceforge.net
Sat Nov 8 12:56:03 CET 2003


Update of /cvsroot/scummvm/scummvm/simon
In directory sc8-pr-cvs1:/tmp/cvs-serv12612

Modified Files:
	debug.cpp simon.cpp sound.cpp vga.cpp 
Log Message:
cleanup whitespaces

Index: debug.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/debug.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- debug.cpp	3 Oct 2003 19:42:27 -0000	1.22
+++ debug.cpp	8 Nov 2003 20:54:29 -0000	1.23
@@ -372,18 +372,17 @@
 }
 
 void pal_load(byte *pal, const byte *vga1, int a, int b) {
-	uint num = a==0 ? 0x20 : 0x10;
+	uint num = (a == 0) ? 0x20 : 0x10;
 	byte *palptr;
 	const byte *src;
 	
-	palptr = (byte*)&pal[a<<4];
-
-	src = vga1 + 6 + b*96;
+	palptr = (byte *)&pal[a << 4];
+	src = vga1 + 6 + b * 96;
 	
 	do {
-		palptr[0] = src[0]<<2;
-		palptr[1] = src[1]<<2;
-		palptr[2] = src[2]<<2;
+		palptr[0] = src[0] << 2;
+		palptr[1] = src[1] << 2;
+		palptr[2] = src[2] << 2;
 		palptr[3] = 0;
 
 		palptr += 4;
@@ -398,7 +397,6 @@
 	int i;
 	uint32 offs;
 	byte *p2;
-
 	byte pal[768];
 
 	{
@@ -419,16 +417,16 @@
 	
 	i = 538;
 
-	for(i=1; ; i++) {
+	for(i = 1; ; i++) {
 		p2 = vga + i * 8;
-		offs = TO_BE_32(*(uint32*)p2);
+		offs = TO_BE_32(*(uint32 *)p2);
 
 		/* try to detect end of images.
 		 * assume the end when offset >= 200kb */
 		if (offs >= 200*1024)
 			return;
 		
-		width = TO_BE_16(*(uint16*)(p2+6));
+		width = TO_BE_16(*(uint16 *)(p2 + 6));
 		height = p2[5];
 		flags = p2[4];
 

Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.332
retrieving revision 1.333
diff -u -d -r1.332 -r1.333
--- simon.cpp	30 Oct 2003 01:09:41 -0000	1.332
+++ simon.cpp	8 Nov 2003 20:54:29 -0000	1.333
@@ -2931,7 +2931,7 @@
 		start_vga_code(4, 1, 0x1e, 0, 0, 0);
 		o_wait_for_vga(0x82);
 		o_kill_sprite_simon2(2, 1);
-	}       
+	}
 }
 
 void SimonEngine::timer_vga_sprites() {
@@ -3729,10 +3729,10 @@
 	for (y = 0; y < 24; y++) {
 		for (x = 0; x < 24; x++) {
 			byte pixel =
-				  (icon_pln[((   y)*3) + (x>>3)] & (1<<(7-(x&7))) ? 1 : 0)
-				| (icon_pln[((24+y)*3) + (x>>3)] & (1<<(7-(x&7))) ? 2 : 0)
-				| (icon_pln[((48+y)*3) + (x>>3)] & (1<<(7-(x&7))) ? 4 : 0)
-				| (icon_pln[((72+y)*3) + (x>>3)] & (1<<(7-(x&7))) ? 8 : 0);
+				  (icon_pln[((     y) * 3) + (x >> 3)] & (1 << (7 - (x & 7))) ? 1 : 0)
+				| (icon_pln[((24 + y) * 3) + (x >> 3)] & (1 << (7 - (x & 7))) ? 2 : 0)
+				| (icon_pln[((48 + y) * 3) + (x >> 3)] & (1 << (7 - (x & 7))) ? 4 : 0)
+				| (icon_pln[((72 + y) * 3) + (x >> 3)] & (1 << (7 - (x & 7))) ? 8 : 0);
 			if (pixel)
 				dst[x] = pixel | base;
 		}
@@ -4261,12 +4261,26 @@
 // Thanks to Stuart Caie for providing the original
 // C conversion upon which this decruncher is based.
 
-#define SD_GETBIT(var) do { \
-if(!bits--){s-=4;if(s<src)return false;bb=READ_BE_UINT32(s);bits=31;}(var)=bb&1;bb>>=1; \
+#define SD_GETBIT(var) do {     \
+	if (!bits--) {              \
+		s -= 4;                 \
+		if (s < src)            \
+			return false;       \
+		bb = READ_BE_UINT32(s); \
+		bits = 31;              \
+	}                           \
+	(var) = bb & 1;             \
+	bb >>= 1;                   \
 }while(0)
 
 #define SD_GETBITS(var, nbits) do { \
-bc=(nbits);(var)=0;while(bc--){(var)<<=1;SD_GETBIT(bit);(var)|=bit;} \
+	bc = (nbits);                   \
+	(var) = 0;                      \
+	while(bc--) {                   \
+		(var) <<= 1;                \
+		SD_GETBIT(bit);             \
+		(var) |= bit;               \
+	}                               \
 }while(0)
 
 #define SD_TYPE_LITERAL (0)
@@ -4292,7 +4306,7 @@
 	while (d > dst) {
 		SD_GETBIT(x);
 		if (x) {
-			SD_GETBITS(x,2);
+			SD_GETBITS(x, 2);
 			switch (x) {
 			case 0:
 				type = SD_TYPE_MATCH;
@@ -4309,7 +4323,7 @@
 			case 2:
 				type = SD_TYPE_MATCH;
 				x = 12;
-				SD_GETBITS(y,8);
+				SD_GETBITS(y, 8);
 				break;
 
 			default:
@@ -4331,18 +4345,18 @@
 		}
 
 		if (type == SD_TYPE_LITERAL) {
-			SD_GETBITS(x,x);
+			SD_GETBITS(x, x);
 			y += x;
 			if ((int)(y + 1) > (d - dst))
 				return false; // Overflow?
 			do {
-				SD_GETBITS(x,8);
+				SD_GETBITS(x, 8);
 				*--d = x;
 			} while (y-- > 0);
 		} else {
 			if ((int)(y + 1) > (d - dst))
 				return false; // Overflow?
-			SD_GETBITS(x,x);
+			SD_GETBITS(x, x);
 			if ((d + x) > (dst + destlen))
 				return false; // Offset overflow?
 			do {
@@ -4629,7 +4643,7 @@
 		int i;
 
 		done = true;
-	  	src = _palette;
+		src = _palette;
 		dst = _video_buf_1;
 
 		for (i = 0; i < _palette_color_count; i++) {

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/sound.cpp,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- sound.cpp	23 Oct 2003 04:49:04 -0000	1.49
+++ sound.cpp	8 Nov 2003 20:54:31 -0000	1.50
@@ -58,7 +58,6 @@
 	int playSound(uint sound, PlayingSoundHandle *handle, byte flags);
 };
 
-
 BaseSound::BaseSound(SoundMixer *mixer, File *file, uint32 base, bool bigendian) {
 	_mixer = mixer;
 	_file = file;
@@ -230,10 +229,6 @@
 	return _mixer->playMP3(handle, _file, size);
 }
 #endif
-
-
-/******************************************************************************/
-
 
 SimonSound::SimonSound(const byte game, const GameSpecificSettings *gss, const Common::String &gameDataPath, SoundMixer *mixer)
 	: _game(game), _gameDataPath(gameDataPath), _mixer(mixer) {

Index: vga.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/vga.cpp,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -d -r1.89 -r1.90
--- vga.cpp	26 Oct 2003 05:31:36 -0000	1.89
+++ vga.cpp	8 Nov 2003 20:54:31 -0000	1.90
@@ -1238,7 +1238,6 @@
 		vfs++;
 	}
 
-
 	vte = _vga_timer_list;
 	while (vte->delay) {
 		if (vte->sprite_id != 0x80) {





More information about the Scummvm-git-logs mailing list