[Scummvm-cvs-logs] CVS: scummvm/scumm akos.cpp,1.98,1.99 charset.cpp,2.82,2.83 debugger.cpp,1.110,1.111 gfx.cpp,2.258,2.259 object.cpp,1.157,1.158 scumm.h,1.349,1.350 verbs.cpp,1.90,1.91

Max Horn fingolfin at users.sourceforge.net
Wed Jan 7 19:25:01 CET 2004


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

Modified Files:
	akos.cpp charset.cpp debugger.cpp gfx.cpp object.cpp scumm.h 
	verbs.cpp 
Log Message:
more cleanup

Index: akos.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/akos.cpp,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -d -r1.98 -r1.99
--- akos.cpp	8 Jan 2004 03:10:16 -0000	1.98
+++ akos.cpp	8 Jan 2004 03:24:41 -0000	1.99
@@ -674,7 +674,7 @@
 		if (_actorHitX < rect.left || _actorHitX >= rect.right || _actorHitY < rect.top || _actorHitY >= rect.bottom)
 			return 0;
 	} else
-		_vm->markRectAsDirty(kMainVirtScreen, rect.left, rect.right, rect.top, rect.bottom, _actorID);
+		_vm->markRectAsDirty(kMainVirtScreen, rect, _actorID);
 
 	if (rect.top >= (int)_outheight || rect.bottom <= 0)
 		return 0;
@@ -767,21 +767,7 @@
 
 	_vm->markRectAsDirty(kMainVirtScreen, clip.left, clip.right + 1, clip.top, clip.bottom + 1, _actorID);
 
-	if (clip.top < 0) {
-		clip.top = 0;
-	}
-
-	if (clip.bottom > maxh) {
-		clip.bottom = maxh;
-	}
-
-	if (clip.left < 0) {
-		clip.left = 0;
-	}
-
-	if (clip.right > maxw) {
-		clip.right = maxw;
-	}
+	clip.clip(maxw, maxh);
 
 	if ((clip.left >= clip.right) || (clip.top >= clip.bottom))
 		return 0;

Index: charset.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/charset.cpp,v
retrieving revision 2.82
retrieving revision 2.83
diff -u -d -r2.82 -r2.83
--- charset.cpp	8 Jan 2004 03:10:16 -0000	2.82
+++ charset.cpp	8 Jan 2004 03:24:41 -0000	2.83
@@ -977,7 +977,7 @@
 	mask_ptr = _vm->getMaskBuffer(_left, drawTop, 0);
 	useMask = (vs->number == kMainVirtScreen && !_ignoreCharsetMask);
 
-	_vm->markRectAsDirty(vs->number, _left, _left + w, drawTop, drawTop + h, 0);
+	_vm->markRectAsDirty(vs->number, _left, _left + w, drawTop, drawTop + h);
 	
 	if (vs->number == kMainVirtScreen)
 		_hasMask = true;
@@ -1083,7 +1083,7 @@
 
 	int drawTop = _top - vs->topline;
 
-	_vm->markRectAsDirty(vs->number, _left, _left + width, drawTop, drawTop + height + offsY, 0);
+	_vm->markRectAsDirty(vs->number, _left, _left + width, drawTop, drawTop + height + offsY);
 
 	if (!vs->hasTwoBuffers)
 		_blitAlso = false;
@@ -1296,7 +1296,7 @@
 
 	_hasMask = true;
 	_current->drawShadowChar(chr, _left, _top - _vm->_screenTop, _color, !_ignoreCharsetMask);
-	_vm->markRectAsDirty(kMainVirtScreen, shadow.left, shadow.right, shadow.top, shadow.bottom, 0);
+	_vm->markRectAsDirty(kMainVirtScreen, shadow);
 
 	if (_str.left > _left)
 		_str.left = _left;

Index: debugger.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/debugger.cpp,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -d -r1.110 -r1.111
--- debugger.cpp	6 Jan 2004 12:45:30 -0000	1.110
+++ debugger.cpp	8 Jan 2004 03:24:41 -0000	1.111
@@ -709,7 +709,7 @@
 
 	VirtScreen *vs = _vm->findVirtScreen(coords.ul.y);
 	if (vs != NULL)
-		_vm->markRectAsDirty(vs->number, 0, vs->width, 0, vs->height, 0);
+		_vm->markRectAsDirty(vs->number, 0, vs->width, 0, vs->height);
 	_vm->drawDirtyScreenParts();
 	_vm->_system->update_screen();
 }

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.258
retrieving revision 2.259
diff -u -d -r2.258 -r2.259
--- gfx.cpp	8 Jan 2004 03:10:16 -0000	2.258
+++ gfx.cpp	8 Jan 2004 03:24:41 -0000	2.259
@@ -570,25 +570,19 @@
 	if ((vs = findVirtScreen(rect.top)) == NULL)
 		return;
 
+	if (rect.left > vs->width)
+		return;
+
 	topline = vs->topline;
 
 	rect.top -= topline;
 	rect.bottom -= topline;
 
-	if (rect.left < 0)
-		rect.left = 0;
-	if (rect.right < 0)
-		rect.right = 0;
-	if (rect.left > vs->width)
-		return;
-	if (rect.right > vs->width)
-		rect.right = vs->width;
-	if (rect.bottom >= vs->height)
-		rect.bottom = vs->height;
+	rect.clip(vs->width, vs->height);
 
-	markRectAsDirty(vs->number, rect.left, rect.right, rect.top, rect.bottom, USAGE_BIT_RESTORED);
+	markRectAsDirty(vs->number, rect, USAGE_BIT_RESTORED);
 
-	int offset = (rect.top) * vs->width + vs->xstart + rect.left;
+	int offset = rect.top * vs->width + vs->xstart + rect.left;
 	backbuff = vs->screenPtr + offset;
 
 	height = rect.height();
@@ -716,7 +710,7 @@
 	else if (y2 > vs->height)
 		y2 = vs->height;
 	
-	markRectAsDirty(vs->number, x, x2, y, y2, 0);
+	markRectAsDirty(vs->number, x, x2, y, y2);
 
 	backbuff = vs->screenPtr + vs->xstart + y * vs->width + x;
 

Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/object.cpp,v
retrieving revision 1.157
retrieving revision 1.158
diff -u -d -r1.157 -r1.158
--- object.cpp	8 Jan 2004 03:10:16 -0000	1.157
+++ object.cpp	8 Jan 2004 03:24:41 -0000	1.158
@@ -1515,7 +1515,7 @@
 		drawBomp(bdd, false);
 	}
 
-	markRectAsDirty(vs->number, bdd.x, bdd.x + bdd.srcwidth, bdd.y, bdd.y + bdd.srcheight, 0);
+	markRectAsDirty(vs->number, bdd.x, bdd.x + bdd.srcwidth, bdd.y, bdd.y + bdd.srcheight);
 }
 
 void ScummEngine::removeBlastObjects() {
@@ -1566,7 +1566,7 @@
 	for (i = left_strip; i <= right_strip; i++)
 		gdi.resetBackground(r.top, r.bottom, i);
 
-	markRectAsDirty(kMainVirtScreen, r.left, r.right, r.top, r.bottom, USAGE_BIT_RESTORED);
+	markRectAsDirty(kMainVirtScreen, r, USAGE_BIT_RESTORED);
 }
 
 int ScummEngine::findLocalObjectSlot() {

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.349
retrieving revision 1.350
diff -u -d -r1.349 -r1.350
--- scumm.h	6 Jan 2004 12:45:30 -0000	1.349
+++ scumm.h	8 Jan 2004 03:24:41 -0000	1.350
@@ -853,7 +853,10 @@
 
 
 public:
-	void markRectAsDirty(VirtScreenNumber virt, int left, int right, int top, int bottom, int dirtybit);
+	void markRectAsDirty(VirtScreenNumber virt, int left, int right, int top, int bottom, int dirtybit = 0);
+	void markRectAsDirty(VirtScreenNumber virt, Common::Rect rect, int dirtybit = 0) {
+		markRectAsDirty(virt, rect.left, rect.right, rect.top, rect.bottom, dirtybit);
+	}
 protected:
 	void drawDirtyScreenParts();
 	void updateDirtyScreen(VirtScreenNumber slot);

Index: verbs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/verbs.cpp,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -d -r1.90 -r1.91
--- verbs.cpp	6 Jan 2004 19:17:01 -0000	1.90
+++ verbs.cpp	8 Jan 2004 03:24:41 -0000	1.91
@@ -137,7 +137,7 @@
 				dst += vs->width;
 			}
 
-			markRectAsDirty(kVerbVirtScreen, rect.left, rect.right, rect.top, rect.bottom, 0);
+			markRectAsDirty(kVerbVirtScreen, rect);
 		}
 
 		if (new_box != -1) {
@@ -154,7 +154,7 @@
 				dst += vs->width;
 			}
 
-			markRectAsDirty(kVerbVirtScreen, rect.left, rect.right, rect.top, rect.bottom, 0);
+			markRectAsDirty(kVerbVirtScreen, rect);
 		}
 
 		v2_mouseover_box = new_box;





More information about the Scummvm-git-logs mailing list