[Scummvm-cvs-logs] CVS: scummvm/scumm gfx.cpp,2.145,2.146

Max Horn fingolfin at users.sourceforge.net
Thu Jun 5 16:57:01 CEST 2003


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

Modified Files:
	gfx.cpp 
Log Message:
unified some code

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.145
retrieving revision 2.146
diff -u -d -r2.145 -r2.146
--- gfx.cpp	5 Jun 2003 19:26:43 -0000	2.145
+++ gfx.cpp	5 Jun 2003 23:55:57 -0000	2.146
@@ -1056,7 +1056,7 @@
 				}
 			}
 			if (left <= theX && theX < right) {
-				dst -= height * _vm->_screenWidth - 1;
+				dst -= _vertStripNextInc;
 			}
 		}
 
@@ -1073,45 +1073,30 @@
 			theX = 0;
 		}
 		while (theX < right) {
-			if (run & 0x80) {
+			const byte runFlag = run & 0x80;
+			if (runFlag) {
 				run &= 0x7f;
 				data = *src++;
-				do {
-					if (left <= theX) {
-						*mask_ptr = data;
-						mask_ptr += _numStrips;
-					}
-					theY++;
-					if (theY >= height) {
-						if (left <= theX) {
-							mask_ptr -= height * _numStrips - 1;
-						}
-						theY = 0;
-						theX += 8;
-						if (theX >= right)
-							break;
-					}
-				} while (--run);
-			} else {
-				do {
+			}
+			do {
+				if (!runFlag)
 					data = *src++;
-					
+				
+				if (left <= theX) {
+					*mask_ptr = data;
+					mask_ptr += _numStrips;
+				}
+				theY++;
+				if (theY >= height) {
 					if (left <= theX) {
-						*mask_ptr = data;
-						mask_ptr += _numStrips;
-					}
-					theY++;
-					if (theY >= height) {
-						if (left <= theX) {
-							mask_ptr -= _numStrips * height - 1;
-						}
-						theY = 0;
-						theX += 8;
-						if (theX >= right)
-							break;
+						mask_ptr -= _numStrips * height - 1;
 					}
-				} while (--run);
-			}
+					theY = 0;
+					theX += 8;
+					if (theX >= right)
+						break;
+				}
+			} while (--run);
 			run = *src++;
 		}
 	}
@@ -1318,38 +1303,26 @@
 	
 	for (;;) {
 		length = *src++;
-		if (length & 0x80) {
+		const byte runFlag = length & 0x80;
+		if (runFlag) {
 			length &= 0x7f;
 			data = *src++;
-			do {
-				if (y == height) {
-					assert(x < 120);
-					table->zoffsets[x] = src - bitmapStart - 1;
-					table->zrun[x] = length | 0x80;
-				}
-				if (--y == 0) {
-					if (--width == 0)
-						return table;
-					x++;
-					y = height;
-				}
-			} while (--length);
-		} else {
-			do {
-				data = *src++;
-				if (y == height) {
-					assert(x < 120);
-					table->zoffsets[x] = src - bitmapStart - 1;
-					table->zrun[x] = length;
-				}
-				if (--y == 0) {
-					if (--width == 0)
-						return table;
-					x++;
-					y = height;
-				}
-			} while (--length);
 		}
+		do {
+			if (!runFlag)
+				data = *src++;
+			if (y == height) {
+				assert(x < 120);
+				table->zoffsets[x] = src - bitmapStart - 1;
+				table->zrun[x] = length | runFlag;
+			}
+			if (--y == 0) {
+				if (--width == 0)
+					return table;
+				x++;
+				y = height;
+			}
+		} while (--length);
 	}
 
 	return table;





More information about the Scummvm-git-logs mailing list