[Scummvm-cvs-logs] CVS: scummvm/gui dialog.cpp,1.6,1.7 gui.cpp,1.4,1.5 newgui.cpp,1.3,1.4

Pawe? Ko?odziejski aquadran at users.sourceforge.net
Sun Sep 1 09:38:02 CEST 2002


Update of /cvsroot/scummvm/scummvm/gui
In directory usw-pr-cvs1:/tmp/cvs-serv13006

Modified Files:
	dialog.cpp gui.cpp newgui.cpp 
Log Message:
more resolution fixes

Index: dialog.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/dialog.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- dialog.cpp	31 Aug 2002 14:53:26 -0000	1.6
+++ dialog.cpp	1 Sep 2002 16:37:08 -0000	1.7
@@ -54,7 +54,7 @@
 {
 	// Create _screenBuf if it doesn't already exist
 	if (!_screenBuf)
-		_screenBuf = new byte[320*200];
+		_screenBuf = new byte[g_scumm->_realWidth * g_scumm->_realHeight];
 	
 	// Draw the fixed parts of the dialog: background and border.
 	_gui->blendRect(_x, _y, _w, _h, _gui->_bgcolor);

Index: gui.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/gui.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- gui.cpp	31 Aug 2002 14:53:26 -0000	1.4
+++ gui.cpp	1 Sep 2002 16:37:08 -0000	1.5
@@ -361,7 +361,7 @@
 			if (color)
 				ptr[x] = _color;
 		}
-		ptr += 320;
+		ptr += _s->_realWidth;
 	}
 	_color = tempc;
 
@@ -491,7 +491,7 @@
 							ptr[x2] = color;
 						mask >>= 4;
 					}
-					ptr += 320;
+					ptr += _s->_realWidth;
 				}
 			}
 		}
@@ -515,7 +515,7 @@
 
 	if (wid->_flags & GWF_BORDER) {
 		// Inset by 1 pixel in all directions
-		ptr += 320 + 1;
+		ptr += _s->_realWidth + 1;
 		w -= 2;
 		h -= 2;
 	}
@@ -523,7 +523,7 @@
 	while (h--) {
 		for (i = 0; i < w; i++)
 			ptr[i] = _bgcolor;
-		ptr += 320;
+		ptr += _s->_realWidth;
 	}
 }
 
@@ -554,8 +554,8 @@
 	if (_vs == NULL)
 		return NULL;
 
-	return _vs->screenPtr + x + (y - _vs->topline) * 320 +
-		_s->_screenStartStrip * 8 + (_s->camera._cur.y - 100) * 320;
+	return _vs->screenPtr + x + (y - _vs->topline) * _s->_realWidth +
+		_s->_screenStartStrip * 8 + (_s->camera._cur.y - (_s->_realHeight / 2)) * _s->_realWidth;
 }
 
 void Gui::line(int x, int y, int x2, int y2, byte color)
@@ -577,7 +577,7 @@
 		/* vertical line */
 		while (y++ <= y2) {
 			*ptr = color;
-			ptr += 320;
+			ptr += _s->_realWidth;
 		}
 	} else if (y == y2) {
 		/* horizontal line */

Index: newgui.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/newgui.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- newgui.cpp	29 Aug 2002 23:45:15 -0000	1.3
+++ newgui.cpp	1 Sep 2002 16:37:08 -0000	1.4
@@ -307,8 +307,8 @@
 	if (vs == NULL)
 		return NULL;
 
-	return vs->screenPtr + x + (y - vs->topline) * 320 +
-		_s->_screenStartStrip * 8 + (_s->camera._cur.y - 100) * 320;
+	return vs->screenPtr + x + (y - vs->topline) * _s->_realWidth +
+		_s->_screenStartStrip * 8 + (_s->camera._cur.y - (_s->_realHeight / 2)) * _s->_realWidth;
 }
 
 void NewGui::box(int x, int y, int width, int height)
@@ -343,7 +343,7 @@
 		/* vertical line */
 		while (y++ <= y2) {
 			*ptr = color;
-			ptr += 320;
+			ptr += _s->_realWidth;
 		}
 	} else if (y == y2) {
 		/* horizontal line */
@@ -363,7 +363,7 @@
 		for (int i = 0; i < w; i++) {
 			ptr[i] = Blend(ptr[i], color, _s->_currentPalette);
 		}
-		ptr += 320;
+		ptr += _s->_realWidth;
 	}
 }
 
@@ -377,7 +377,7 @@
 		for (int i = 0; i < w; i++) {
 			ptr[i] = color;
 		}
-		ptr += 320;
+		ptr += _s->_realWidth;
 	}
 }
 
@@ -392,7 +392,7 @@
 			if ((h ^ i) & 1)
 				ptr[i] = color;
 		}
-		ptr += 320;
+		ptr += _s->_realWidth;
 	}
 }
 
@@ -407,12 +407,12 @@
 	for (i = 0; i < w; i++, ptr++)
 		*ptr = color;
 	ptr--;
-	for (i = 0; i < h; i++, ptr += 320)
+	for (i = 0; i < h; i++, ptr += _s->_realWidth)
 		*ptr = color;
 	ptr = basePtr;
-	for (i = 0; i < h; i++, ptr += 320)
+	for (i = 0; i < h; i++, ptr += _s->_realWidth)
 		*ptr = color;
-	ptr -= 320;
+	ptr -= _s->_realWidth;
 	for (i = 0; i < w; i++, ptr++)
 		*ptr = color;
 }
@@ -450,7 +450,7 @@
 			if (color)
 				ptr[x] = _color;
 		}
-		ptr += 320;
+		ptr += _s->_realWidth;
 	}
 	_color = tempc;
 
@@ -502,13 +502,13 @@
 				ptr[x2] = color;
 			mask >>= 4;
 		}
-		ptr += 320;
+		ptr += _s->_realWidth;
 	}
 }
 
 void NewGui::blitTo(byte buffer[320*200], int x, int y, int w, int h)
 {
-	byte *dstPtr = buffer + x + y*320;
+	byte *dstPtr = buffer + x + y * _s->_realWidth;
 	byte *srcPtr = getBasePtr(x, y);
 	if (srcPtr == NULL)
 		return;
@@ -517,14 +517,14 @@
 		for (int i = 0; i < w; i++) {
 			*dstPtr++ = *srcPtr++;
 		}
-		dstPtr += 320 - w;
-		srcPtr += 320 - w;
+		dstPtr += _s->_realWidth - w;
+		srcPtr += _s->_realWidth - w;
 	}
 }
 
 void NewGui::blitFrom(byte buffer[320*200], int x, int y, int w, int h)
 {
-	byte *srcPtr = buffer + x + y*320;
+	byte *srcPtr = buffer + x + y * _s->_realWidth;
 	byte *dstPtr = getBasePtr(x, y);
 	if (dstPtr == NULL)
 		return;
@@ -533,8 +533,8 @@
 		for (int i = 0; i < w; i++) {
 			*dstPtr++ = *srcPtr++;
 		}
-		dstPtr += 320 - w;
-		srcPtr += 320 - w;
+		dstPtr += _s->_realWidth - w;
+		srcPtr += _s->_realWidth - w;
 	}
 }
 





More information about the Scummvm-git-logs mailing list