[Scummvm-cvs-logs] CVS: scummvm/scumm object.cpp,1.258,1.259 gfx.cpp,2.476,2.477

Joost Peters joostp at users.sourceforge.net
Thu Nov 17 16:02:02 CET 2005


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

Modified Files:
	object.cpp gfx.cpp 
Log Message:
Don't do full-screen updates when smooth-scrolling, but only update the changed part(s) (Patch from Cody56, enhanced by Fingolfin).
This should help speed it up on lower-spec devices.


Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/object.cpp,v
retrieving revision 1.258
retrieving revision 1.259
diff -u -d -r1.258 -r1.259
--- object.cpp	29 Oct 2005 04:52:26 -0000	1.258
+++ object.cpp	18 Nov 2005 00:01:46 -0000	1.259
@@ -472,11 +472,11 @@
 
 	for (a = numstrip = 0; a < width; a++) {
 		tmp = xpos + a;
-		if (arg == 1 && _screenStartStrip != tmp)
+		if (tmp < _screenStartStrip || _screenEndStrip < tmp)
 			continue;
-		if (arg == 2 && _screenEndStrip != tmp)
+		if (arg > 0 && _screenStartStrip + arg <= tmp)
 			continue;
-		if (tmp < _screenStartStrip || tmp > _screenEndStrip)
+		if (arg < 0 && tmp <= _screenEndStrip + arg)
 			continue;
 		setGfxUsageBit(tmp, USAGE_BIT_DIRTY);
 		if (tmp < x)

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.476
retrieving revision 2.477
diff -u -d -r2.476 -r2.477
--- gfx.cpp	10 Nov 2005 23:07:54 -0000	2.476
+++ gfx.cpp	18 Nov 2005 00:01:46 -0000	2.477
@@ -802,24 +802,26 @@
 
 	if (_features & GF_NEW_CAMERA) {
 		diff = camera._cur.x / 8 - camera._last.x / 8;
-		if (!_fullRedraw && diff == 1) {
-			val = 2;
-			redrawBGStrip(gdi._numStrips - 1, 1);
-		} else if (!_fullRedraw && diff == -1) {
-			val = 1;
-			redrawBGStrip(0, 1);
-		} else if (_fullRedraw || diff != 0) {
+		if (_fullRedraw) {
 			_bgNeedsRedraw = false;
 			redrawBGStrip(0, gdi._numStrips);
+		} else if (diff > 0) {
+			assert(gdi._numStrips > diff);
+			val = -diff;
+			redrawBGStrip(gdi._numStrips - diff, diff);
+		} else if (diff < 0) {
+			val = -diff;
+			redrawBGStrip(0, -diff);
 		}
 	} else {
-		if (!_fullRedraw && camera._cur.x - camera._last.x == 8) {
-			val = 2;
+		diff = camera._cur.x - camera._last.x;
+		if (!_fullRedraw && diff == 8) {
+			val = -1;
 			redrawBGStrip(gdi._numStrips - 1, 1);
-		} else if (!_fullRedraw && camera._cur.x - camera._last.x == -8) {
-			val = 1;
+		} else if (!_fullRedraw && diff == -8) {
+			val = +1;
 			redrawBGStrip(0, 1);
-		} else if (_fullRedraw || camera._cur.x != camera._last.x) {
+		} else if (_fullRedraw || diff != 0) {
 			_bgNeedsRedraw = false;
 			_flashlight.isDrawn = false;
 			redrawBGStrip(0, gdi._numStrips);





More information about the Scummvm-git-logs mailing list