[Scummvm-cvs-logs] CVS: scummvm/scumm gfx.cpp,2.328,2.329 gfx.h,1.82,1.83

Travis Howell kirben at users.sourceforge.net
Sat Sep 25 04:48:32 CEST 2004


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28941/scumm

Modified Files:
	gfx.cpp gfx.h 
Log Message:

Cleanup to reduce code duplication


Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.328
retrieving revision 2.329
diff -u -d -r2.328 -r2.329
--- gfx.cpp	25 Sep 2004 11:33:50 -0000	2.328
+++ gfx.cpp	25 Sep 2004 11:40:40 -0000	2.329
@@ -2048,21 +2048,21 @@
 			// FIXME: Ugly workaround for bug #901462
 			if (_vm->_version == 8)
 				useOrDecompress = true;
-			drawStripBasicV(dst, dstPitch, src, numLinesToProcess);
+			drawStripBasicV(dst, dstPitch, src, numLinesToProcess, false);
 			break;
 	
 		case 2:
-			drawStripBasicH(dst, dstPitch, src, numLinesToProcess);
+			drawStripBasicH(dst, dstPitch, src, numLinesToProcess, false);
 			break;
 	
 		case 3:
 			useOrDecompress = true;
-			drawStripBasicV_trans(dst, dstPitch, src, numLinesToProcess);
+			drawStripBasicV(dst, dstPitch, src, numLinesToProcess, true);
 			break;
 	
 		case 4:
 			useOrDecompress = true;
-			drawStripBasicH_trans(dst, dstPitch, src, numLinesToProcess);
+			drawStripBasicH(dst, dstPitch, src, numLinesToProcess, true);
 			break;
 	
 		case 6:
@@ -2320,37 +2320,7 @@
 	} while (--height);
 }
 
-void Gdi::drawStripBasicH(byte *dst, int dstPitch, const byte *src, int height) const {
-	byte color = *src++;
-	uint bits = *src++;
-	byte cl = 8;
-	byte bit;
-	int8 inc = -1;
-
-	do {
-		int x = 8;
-		do {
-			FILL_BITS;
-			*dst++ = _roomPalette[color];
-			if (!READ_BIT) {
-			} else if (!READ_BIT) {
-				FILL_BITS;
-				color = bits & _decomp_mask;
-				bits >>= _decomp_shr;
-				cl -= _decomp_shr;
-				inc = -1;
-			} else if (!READ_BIT) {
-				color += inc;
-			} else {
-				inc = -inc;
-				color += inc;
-			}
-		} while (--x);
-		dst += dstPitch - 8;
-	} while (--height);
-}
-
-void Gdi::drawStripBasicH_trans(byte *dst, int dstPitch, const byte *src, int height) const {
+void Gdi::drawStripBasicH(byte *dst, int dstPitch, const byte *src, int height, const bool transpCheck) const {
 	byte color = *src++;
 	uint bits = *src++;
 	byte cl = 8;
@@ -2361,7 +2331,7 @@
 		int x = 8;
 		do {
 			FILL_BITS;
-			if (color != _transparentColor)
+			if (!transpCheck || color != _transparentColor)
 				*dst = _roomPalette[color];
 			dst++;
 			if (!READ_BIT) {
@@ -2382,39 +2352,7 @@
 	} while (--height);
 }
 
-void Gdi::drawStripBasicV(byte *dst, int dstPitch, const byte *src, int height) const {
-	byte color = *src++;
-	uint bits = *src++;
-	byte cl = 8;
-	byte bit;
-	int8 inc = -1;
-
-	int x = 8;
-	do {
-		int h = height;
-		do {
-			FILL_BITS;
-			*dst = _roomPalette[color];
-			dst += dstPitch;
-			if (!READ_BIT) {
-			} else if (!READ_BIT) {
-				FILL_BITS;
-				color = bits & _decomp_mask;
-				bits >>= _decomp_shr;
-				cl -= _decomp_shr;
-				inc = -1;
-			} else if (!READ_BIT) {
-				color += inc;
-			} else {
-				inc = -inc;
-				color += inc;
-			}
-		} while (--h);
-		dst -= _vertStripNextInc;
-	} while (--x);
-}
-
-void Gdi::drawStripBasicV_trans(byte *dst, int dstPitch, const byte *src, int height) const {
+void Gdi::drawStripBasicV(byte *dst, int dstPitch, const byte *src, int height, const bool transpCheck) const {
 	byte color = *src++;
 	uint bits = *src++;
 	byte cl = 8;
@@ -2426,7 +2364,7 @@
 		int h = height;
 		do {
 			FILL_BITS;
-			if (color != _transparentColor)
+			if (!transpCheck || color != _transparentColor)
 				*dst = _roomPalette[color];
 			dst += dstPitch;
 			if (!READ_BIT) {

Index: gfx.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.h,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- gfx.h	25 Sep 2004 11:33:50 -0000	1.82
+++ gfx.h	25 Sep 2004 11:40:40 -0000	1.83
@@ -238,10 +238,8 @@
 	void drawStripC64Background(byte *dst, int dstPitch, int stripnr, int height);
 
 	void drawStripComplex(byte *dst, int dstPitch, const byte *src, int height, const bool transpCheck) const;
-	void drawStripBasicH(byte *dst, int dstPitch, const byte *src, int height) const;
-	void drawStripBasicH_trans(byte *dst, int dstPitch, const byte *src, int height) const;
-	void drawStripBasicV(byte *dst, int dstPitch, const byte *src, int height) const;
-	void drawStripBasicV_trans(byte *dst, int dstPitch, const byte *src, int height) const;
+	void drawStripBasicH(byte *dst, int dstPitch, const byte *src, int height, const bool transpCheck) const;
+	void drawStripBasicV(byte *dst, int dstPitch, const byte *src, int height, const bool transpCheck) const;
 
 	void unkDecode7(byte *dst, int dstPitch, const byte *src, int height) const;
 	void unkDecode8(byte *dst, int dstPitch, const byte *src, int height) const;





More information about the Scummvm-git-logs mailing list