[Scummvm-cvs-logs] CVS: scummvm/scumm gfx.cpp,1.32,1.33 gfx.h,1.4,1.5 scumm.h,1.41,1.42

Max Horn fingolfin at users.sourceforge.net
Sat Oct 19 18:03:03 CEST 2002


Update of /cvsroot/scummvm/scummvm/scumm
In directory usw-pr-cvs1:/tmp/cvs-serv2807/scumm

Modified Files:
	gfx.cpp gfx.h scumm.h 
Log Message:
cleanup; fix for room 88 in The Dig (Ender, I was right, only the place was another :-)

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- gfx.cpp	19 Oct 2002 22:35:21 -0000	1.32
+++ gfx.cpp	20 Oct 2002 01:02:51 -0000	1.33
@@ -79,7 +79,7 @@
 }
 
 void Scumm::initVirtScreen(int slot, int number, int top, int width, int height, bool twobufs,
-													 bool fourextra)
+													 bool scrollable)
 {
 	VirtScreen *vs = &virtscr[slot];
 	int size;
@@ -100,7 +100,7 @@
 	vs->topline = top;
 	vs->height = height;
 	vs->alloctwobuffers = twobufs;
-	vs->scrollable = fourextra;
+	vs->scrollable = scrollable;
 	vs->xstart = 0;
 	size = vs->width * vs->height;
 	vs->size = size;
@@ -158,7 +158,7 @@
 	} else {
 		vs = &virtscr[0];
 
-		src = vs->screenPtr + _screenStartStrip * 8 + camera._cur.y - (_realHeight / 2);
+		src = vs->screenPtr + _screenStartStrip * 8 + _screenTop * _realWidth;
 		_system->copy_rect(src, _realWidth, 0, vs->topline, _realWidth, vs->height);
 
 		for (i = 0; i < NUM_STRIPS; i++) {
@@ -184,9 +184,6 @@
 
 void Gdi::updateDirtyScreen(VirtScreen *vs)
 {
-	int i;
-	int start, w, top, bottom;
-
 	if (vs->height == 0)
 		return;
 
@@ -194,29 +191,34 @@
 	if (vs->scrollable)
 		_readOffs = vs->xstart;
 
-	w = 8;
-	start = 0;
-
-	for (i = 0; i < NUM_STRIPS; i++) {
-		bottom = vs->bdirty[i];
+	if (_vm->_features & GF_AFTER_V7 && (_vm->camera._cur.y != _vm->camera._last.y))
+		drawStripToScreen(vs, 0, NUM_STRIPS << 3, 0, vs->height);
+	else {
+		int i;
+		int start, w, top, bottom;
+	
+		w = 8;
+		start = 0;
 
-		if (_vm->_features & GF_AFTER_V7 && (_vm->camera._cur.y != _vm->camera._last.y))
-			drawStripToScreen(vs, start, w, 0, vs->height);
-		else if (bottom) {
-			top = vs->tdirty[i];
-			vs->tdirty[i] = (byte)vs->height;
-			vs->bdirty[i] = 0;
-			if (i != (NUM_STRIPS-1) && vs->bdirty[i + 1] == (byte)bottom && vs->tdirty[i + 1] == (byte)top) {
-				w += 8;
-				continue;
+		for (i = 0; i < NUM_STRIPS; i++) {
+			bottom = vs->bdirty[i];
+	
+			if (bottom) {
+				top = vs->tdirty[i];
+				vs->tdirty[i] = (byte)vs->height;
+				vs->bdirty[i] = 0;
+				if (i != (NUM_STRIPS-1) && vs->bdirty[i + 1] == (byte)bottom && vs->tdirty[i + 1] == (byte)top) {
+					w += 8;
+					continue;
+				}
+				if (_vm->_features & GF_AFTER_V7)
+					drawStripToScreen(vs, start, w, 0, vs->height);
+				else
+					drawStripToScreen(vs, start, w, top, bottom);
+				w = 8;
 			}
-			if (_vm->_features & GF_AFTER_V7)
-				drawStripToScreen(vs, start, w, 0, vs->height);
-			else
-				drawStripToScreen(vs, start, w, top, bottom);
-			w = 8;
+			start = i + 1;
 		}
-		start = i + 1;
 	}
 }
 

Index: gfx.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- gfx.h	29 Sep 2002 15:20:02 -0000	1.4
+++ gfx.h	20 Oct 2002 01:02:51 -0000	1.5
@@ -58,7 +58,7 @@
 	uint16 width, height;
 	uint16 size;
 	byte alloctwobuffers;
-	byte scrollable;
+	bool scrollable;
 	uint16 xstart;
 	uint16 tdirty[40];
 	uint16 bdirty[40];

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- scumm.h	19 Oct 2002 22:35:22 -0000	1.41
+++ scumm.h	20 Oct 2002 01:02:52 -0000	1.42
@@ -774,7 +774,7 @@
 
 	void getGraphicsPerformance();
 	void initScreens(int a, int b, int w, int h);
-	void initVirtScreen(int slot, int number, int top, int width, int height, bool twobufs, bool fourextra);
+	void initVirtScreen(int slot, int number, int top, int width, int height, bool twobufs, bool scrollable);
 	void initBGBuffers(int height);
 	void initCycl(byte *ptr);	// Color cycle
 





More information about the Scummvm-git-logs mailing list