[Scummvm-cvs-logs] CVS: scummvm/scumm gfx.cpp,2.106,2.107 script.cpp,1.81,1.82

Max Horn fingolfin at users.sourceforge.net
Thu May 15 16:51:07 CEST 2003


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

Modified Files:
	gfx.cpp script.cpp 
Log Message:
moved drawBox to gfx.cpp (seems to be the more logical location)

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.106
retrieving revision 2.107
diff -u -d -r2.106 -r2.107
--- gfx.cpp	15 May 2003 22:48:05 -0000	2.106
+++ gfx.cpp	15 May 2003 23:50:16 -0000	2.107
@@ -522,6 +522,67 @@
 	} while (--h);
 }
 
+void Scumm::drawBox(int x, int y, int x2, int y2, int color) {
+	int width, height;
+	VirtScreen *vs;
+	byte *backbuff, *bgbuff;
+
+	if ((vs = findVirtScreen(y)) == NULL)
+		return;
+
+	if (x > x2)
+		SWAP(x, x2);
+
+	if (y > y2)
+		SWAP(y, y2);
+
+	x2++;
+	y2++;
+
+	// Adjust for the topline of the VirtScreen
+	y -= vs->topline;
+	y2 -= vs->topline;
+	
+	// Clip the coordinates
+	if (x < 0)
+		x = 0;
+	else if (x >= vs->width)
+		return;
+
+	if (x2 < 0)
+		return;
+	else if (x2 > vs->width)
+		x2 = vs->width;
+
+	if (y < 0)
+		y = 0;
+	else if (y > vs->height)
+		return;
+
+	if (y2 < 0)
+		return;
+	else if (y2 > vs->height)
+		y2 = vs->height;
+	
+	updateDirtyRect(vs->number, x, x2, y, y2, 0);
+
+	backbuff = vs->screenPtr + vs->xstart + y * _screenWidth + x;
+
+	width = x2 - x;
+	height = y2 - y;
+	if (color == -1) {
+		if (vs->number != 0)
+			error("can only copy bg to main window");
+		bgbuff = getResourceAddress(rtBuffer, vs->number + 5) + vs->xstart + y * _screenWidth + x;
+		blit(backbuff, bgbuff, width, height);
+	} else {
+		while (height--) {
+			memset(backbuff, color, width);
+			backbuff += _screenWidth;
+		}
+	}
+}
+
 #pragma mark -
 
 void Scumm::initBGBuffers(int height) {
@@ -853,6 +914,10 @@
 
 	return false;
 }
+
+#pragma mark -
+#pragma mark --- Image drawing ---
+#pragma mark -
 
 void Gdi::drawBitmap(byte *ptr, VirtScreen *vs, int x, int y, const int width, const int height,
                      int stripnr, int numstrip, byte flag) {

Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script.cpp,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -d -r1.81 -r1.82
--- script.cpp	15 May 2003 23:44:46 -0000	1.81
+++ script.cpp	15 May 2003 23:50:16 -0000	1.82
@@ -497,68 +497,6 @@
 	return _scummStack[--_scummStackPos];
 }
 
-void Scumm::drawBox(int x, int y, int x2, int y2, int color) {
-	int width, height;
-	VirtScreen *vs;
-	byte *backbuff, *bgbuff;
-
-	if ((vs = findVirtScreen(y)) == NULL)
-		return;
-
-	if (x > x2)
-		SWAP(x, x2);
-
-	if (y > y2)
-		SWAP(y, y2);
-
-	x2++;
-	y2++;
-
-	// Adjust for the topline of the VirtScreen
-	y -= vs->topline;
-	y2 -= vs->topline;
-	
-	// Clip the coordinates
-	if (x < 0)
-		x = 0;
-	else if (x >= vs->width)
-		return;
-
-	if (x2 < 0)
-		return;
-	else if (x2 > vs->width)
-		x2 = vs->width;
-
-	if (y < 0)
-		y = 0;
-	else if (y > vs->height)
-		return;
-
-	if (y2 < 0)
-		return;
-	else if (y2 > vs->height)
-		y2 = vs->height;
-	
-	updateDirtyRect(vs->number, x, x2, y, y2, 0);
-
-	backbuff = vs->screenPtr + vs->xstart + y * _screenWidth + x;
-
-	width = x2 - x;
-	height = y2 - y;
-	if (color == -1) {
-		if (vs->number != 0)
-			error("can only copy bg to main window");
-		bgbuff = getResourceAddress(rtBuffer, vs->number + 5) + vs->xstart + y * _screenWidth + x;
-		blit(backbuff, bgbuff, width, height);
-	} else {
-		while (height--) {
-			memset(backbuff, color, width);
-			backbuff += _screenWidth;
-		}
-	}
-}
-
-
 void Scumm::stopObjectCode() {
 	ScriptSlot *ss;
 





More information about the Scummvm-git-logs mailing list