[Scummvm-cvs-logs] CVS: scummvm/scumm object.cpp,1.199,1.200

Max Horn fingolfin at users.sourceforge.net
Thu Oct 7 09:37:01 CEST 2004


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

Modified Files:
	object.cpp 
Log Message:
Fix blast object drawing glitches introduced by the smooth scrolling changes (were visible with the inventory in The Dig)

Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/object.cpp,v
retrieving revision 1.199
retrieving revision 1.200
diff -u -d -r1.199 -r1.200
--- object.cpp	7 Oct 2004 16:10:51 -0000	1.199
+++ object.cpp	7 Oct 2004 16:34:54 -0000	1.200
@@ -1420,7 +1420,6 @@
 void ScummEngine::enqueueObject(int objectNumber, int objectX, int objectY, int objectWidth,
 								int objectHeight, int scaleX, int scaleY, int image, int mode) {
 	BlastObject *eo;
-	ObjectData *od;
 
 	if (_blastObjectQueuePos >= (int)ARRAYSIZE(_blastObjectQueue)) {
 		warning("enqueueObject: overflow");
@@ -1432,17 +1431,15 @@
 
 	eo = &_blastObjectQueue[_blastObjectQueuePos++];
 	eo->number = objectNumber;
-	eo->rect.left = objectX + (camera._cur.x & 7);
+	eo->rect.left = objectX;
 	eo->rect.top = objectY + _screenTop;
 	if (objectWidth == 0) {
-		od = &_objs[idx];
-		eo->rect.right = eo->rect.left + od->width;
+		eo->rect.right = eo->rect.left + _objs[idx].width;
 	} else {
 		eo->rect.right = eo->rect.left + objectWidth;
 	}
 	if (objectHeight == 0) {
-		od = &_objs[idx];
-		eo->rect.bottom = eo->rect.top + od->height;
+		eo->rect.bottom = eo->rect.top + _objs[idx].height;
 	} else {
 		eo->rect.bottom = eo->rect.top + objectHeight;
 	}
@@ -1548,21 +1545,14 @@
 	int i;
 
 	r = eo->rect;
-
-	if (r.bottom < 0 || r.right < 0 || r.top > vs->h || r.left > vs->w)
+	
+	r.clip(Common::Rect(vs->w, vs->h));
+	
+	if (r.width() <= 0 || r.height() <= 0)
 		return;
 
-	if (r.top < 0)
-		r.top = 0;
-	if (r.bottom > vs->h)
-		r.bottom = vs->h;
-	if (r.left < 0)
-		r.left = 0;
-	if (r.right > vs->w)
-		r.right = vs->w;
-
 	left_strip = r.left / 8;
-	right_strip = (r.right - 1) / 8;
+	right_strip = (r.right + (vs->xstart % 8)) / 8;
 
 	if (left_strip < 0)
 		left_strip = 0;





More information about the Scummvm-git-logs mailing list