[Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.3,1.4 akos.cpp,1.1.1.1,1.2 costume.cpp,1.5,1.6 debug.cpp,1.2,1.3 gfx.cpp,1.11,1.12 object.cpp,1.1.1.1,1.2 script.cpp,1.2,1.3 script_v1.cpp,1.6,1.7 script_v2.cpp,1.5,1.6 scummvm.cpp,1.11,1.12

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


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

Modified Files:
	actor.cpp akos.cpp costume.cpp debug.cpp gfx.cpp object.cpp 
	script.cpp script_v1.cpp script_v2.cpp scummvm.cpp 
Log Message:
fixes to resolutions

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- actor.cpp	29 Aug 2002 23:45:15 -0000	1.3
+++ actor.cpp	1 Sep 2002 15:01:39 -0000	1.4
@@ -366,8 +366,8 @@
 		if (resptr == NULL)
 			error("Scale table %d not defined", scale);
 		int theY = y;
-		if (theY >= 200)
-			theY = 199;
+		if (theY >= (_vm->_realWidth / 2))
+			theY = (_vm->_realWidth / 2) - 1;
 		else if (theY < 0)
 			theY = 0;
 		scale = resptr[theY];

Index: akos.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/akos.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- akos.cpp	21 Aug 2002 16:07:26 -0000	1.1.1.1
+++ akos.cpp	1 Sep 2002 15:01:39 -0000	1.2
@@ -355,7 +355,7 @@
 
 				if (ar->v1.scaletable[ar->v1.tmp_x] < ar->scale_x) {
 					ar->v1.x += ar->v1.scaleXstep;
-					if ((uint) ar->v1.x >= 320)
+					if ((uint) ar->v1.x >= g_scumm->_realWidth)
 						return;
 					maskbit = revBitMask[ar->v1.x & 7];
 					ar->v1.destptr += ar->v1.scaleXstep;
@@ -423,7 +423,7 @@
 
 				if (ar->v1.scaletable[ar->v1.tmp_x] < ar->scale_x) {
 					ar->v1.x += ar->v1.scaleXstep;
-					if ((uint) ar->v1.x >= 320)
+					if ((uint) ar->v1.x >= g_scumm->_realWidth)
 						return;
 					maskbit = revBitMask[ar->v1.x & 7];
 					ar->v1.destptr += ar->v1.scaleXstep;

Index: costume.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/costume.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- costume.cpp	31 Aug 2002 18:36:34 -0000	1.5
+++ costume.cpp	1 Sep 2002 15:01:39 -0000	1.6
@@ -284,8 +284,8 @@
 		CHECK_HEAP return 2;
 	}
 
-	_bgbak_ptr = _vm->getResourceAddress(rtBuffer, 5) + _vm->virtscr[0].xstart + _ypos * 320 + _xpos;
-	_backbuff_ptr = _vm->virtscr[0].screenPtr + _vm->virtscr[0].xstart + _ypos * 320 + _xpos;
+	_bgbak_ptr = _vm->getResourceAddress(rtBuffer, 5) + _vm->virtscr[0].xstart + _ypos * _vm->_realWidth + _xpos;
+	_backbuff_ptr = _vm->virtscr[0].screenPtr + _vm->virtscr[0].xstart + _ypos * _vm->_realWidth + _xpos;
 	charsetmask =
 		_vm->hasCharsetMask(_left, _top + _vm->virtscr[0].topline, _right,
 												_vm->virtscr[0].topline + _bottom);
@@ -395,7 +395,7 @@
 				*dst = pcolor;
 			}
 
-			dst += 320;
+			dst += _vm->_realWidth;
 			y++;
 			if (!--height) {
 				if (!--width)
@@ -443,7 +443,7 @@
 					pcolor = _shadow_table[*dst];
 				*dst = pcolor;
 			}
-			dst += 320;
+			dst += _vm->_realWidth;
 			y++;
 			mask += 40;
 			if (!--height) {
@@ -506,7 +506,7 @@
 					pcolor = _shadow_table[*dst];
 				*dst = pcolor;
 			}
-			dst += 320;
+			dst += _vm->_realWidth;
 			y++;
 			mask += 40;
 			if (!--height) {
@@ -570,7 +570,7 @@
 						pcolor = _shadow_table[*dst];
 					*dst = pcolor;
 				}
-				dst += 320;
+				dst += _vm->_realWidth;
 				mask += 40;
 				y++;
 			}
@@ -584,7 +584,7 @@
 				_scaleIndexX = t + _scaleIndexXStep;
 				if (cost_scaleTable[t] < _scaleX) {
 					_xpos += _scaleIndexXStep;
-					if (_xpos >= 320)
+					if (_xpos >= _vm->_realWidth)
 						return;
 					maskbit = revBitMask[_xpos & 7];
 					_backbuff_ptr += _scaleIndexXStep;
@@ -632,7 +632,7 @@
 						pcolor = _shadow_table[*dst];
 					*dst = pcolor;
 				}
-				dst += 320;
+				dst += _vm->_realWidth;
 				mask += 40;
 				y++;
 			}
@@ -925,7 +925,7 @@
 			len = *src++;
 		do {
 			if (cost_scaleTable[_scaleIndexY] < _scaleY) {
-				if (color && _xpos >= 0 && _xpos < 320 && !((*mask | mask[_imgbufoffs]) & maskbit)) {
+				if (color && _xpos >= 0 && _xpos < _vm->_realWidth && !((*mask | mask[_imgbufoffs]) & maskbit)) {
 					pcolor = _palette[color];
 /*					  if (pcolor == 13)
 						pcolor = _shadow_table[*dst];*/

Index: debug.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/debug.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- debug.cpp	24 Aug 2002 21:56:58 -0000	1.2
+++ debug.cpp	1 Sep 2002 15:01:39 -0000	1.3
@@ -355,8 +355,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;
 }
 
 static void hline(Scumm *scumm, int x1, int x2, int y, byte color)
@@ -479,7 +479,7 @@
 
 	VirtScreen *vs = _s->findVirtScreen(box.ul.y);
 	if (vs != NULL)
-		_s->setVirtscreenDirty(vs, 0, 0, 320, 200);
+		_s->setVirtscreenDirty(vs, 0, 0, _s->_realWidth, _s->_realHeight);
 	_s->drawDirtyScreenParts();
 	_s->_system->update_screen();
 }

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- gfx.cpp	31 Aug 2002 21:23:28 -0000	1.11
+++ gfx.cpp	1 Sep 2002 15:01:39 -0000	1.12
@@ -147,7 +147,7 @@
 	} else {
 		vs = &virtscr[0];
 
-		src = vs->screenPtr + _screenStartStrip * 8 + camera._cur.y - 100;
+		src = vs->screenPtr + _screenStartStrip * 8 + camera._cur.y - (_realHeight / 2);
 		_system->copy_rect(src, _realWidth, 0, vs->topline, _realWidth, vs->height);
 
 		for (i = 0; i < NUM_STRIPS; i++) {
@@ -1174,7 +1174,7 @@
 			((uint32 *)dst)[0] = 0;
 			((uint32 *)dst)[1] = 0;
 		}
-		dst += 320;
+		dst += _vm->_realWidth;
 		mask += NUM_STRIPS;
 	} while (--height);
 }
@@ -1442,7 +1442,7 @@
 		do {
 			FILL_BITS if (color != _transparency)
 				 *dst = color + _palette_mod;
-			dst += 320;
+			dst += _vm->_realWidth;
 			if (!READ_BIT) {
 			} else if (!READ_BIT) {
 				FILL_BITS color = bits & _decomp_mask;
@@ -1680,7 +1680,7 @@
 		_tempNumLines = _numLinesToProcess;
 		do {
 			*dst = color;
-			dst += 320;
+			dst += _vm->_realWidth;
 			for (i = 0; i < 3; i++) {
 				READ_256BIT if (!bits)
 					  break;
@@ -1790,7 +1790,7 @@
 		if (height) {
 			do {
 				memset(backbuff, _bkColor, width);
-				backbuff += 320;
+				backbuff += _realWidth;
 			} while (--height);
 		}
 	}
@@ -2312,9 +2312,9 @@
 {
 	if (_features & GF_AFTER_V7) {
 
-		assert(camera._cur.x >= 160 && camera._cur.y >= 100);
+		assert(camera._cur.x >= (_realWidth / 2) && camera._cur.y >= (_realHeight / 2));
 
-		_screenStartStrip = (camera._cur.x - 160) >> 3;
+		_screenStartStrip = (camera._cur.x - (_realWidth / 2)) >> 3;
 		_screenEndStrip = _screenStartStrip + NUM_STRIPS - 1;
 		virtscr[0].xstart = _screenStartStrip << 3;
 
@@ -2788,7 +2788,7 @@
 		return;
 	}
 
-	grabCursor(vs->screenPtr + (y - vs->topline) * 320 + x, w, h);
+	grabCursor(vs->screenPtr + (y - vs->topline) * _realWidth + x, w, h);
 
 }
 

Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/object.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- object.cpp	21 Aug 2002 16:07:31 -0000	1.1.1.1
+++ object.cpp	1 Sep 2002 15:01:39 -0000	1.2
@@ -1166,7 +1166,7 @@
 	eo->areaWidth = _enqueue_d;
 	eo->areaHeight = _enqueue_e;
 	eo->posX = objectX + (camera._cur.x & 7);
-	eo->posY = objectY + (camera._cur.y - 100);
+	eo->posY = objectY + (camera._cur.y - (_realHeight / 2));
 	if (objectWidth == 0) {
 		od = &_objs[getObjectIndex(objectNumber)];
 		eo->width = od->width;

Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- script.cpp	25 Aug 2002 11:35:13 -0000	1.2
+++ script.cpp	1 Sep 2002 15:01:39 -0000	1.3
@@ -479,25 +479,25 @@
 		y = 0;
 	if (x2 < 0)
 		return;
-	if (x2 > 320)
-		x2 = 320;
+	if (x2 > _realWidth)
+		x2 = _realWidth;
 	if (y2 > bottom)
 		y2 = bottom;
 
 	updateDirtyRect(vs->number, x, x2, y - top, y2 - top, 0);
 
-	backbuff = vs->screenPtr + vs->xstart + (y - top) * 320 + x;
+	backbuff = vs->screenPtr + vs->xstart + (y - top) * _realWidth + x;
 
 	if (color == -1) {
 		if (vs->number != 0)
 			error("can only copy bg to main window");
-		bgbuff = getResourceAddress(rtBuffer, vs->number + 5) + vs->xstart + (y - top) * 320 + x;
+		bgbuff = getResourceAddress(rtBuffer, vs->number + 5) + vs->xstart + (y - top) * _realWidth + x;
 		blit(backbuff, bgbuff, x2 - x, y2 - y);
 	} else {
 		count = y2 - y;
 		while (count) {
 			memset(backbuff, color, x2 - x);
-			backbuff += 320;
+			backbuff += _realWidth;
 			count--;
 		}
 	}
@@ -640,8 +640,8 @@
 		vm.slot[slot].offs = _ENCD_offs;
 		vm.slot[slot].unk1 = 0;
 		vm.slot[slot].unk2 = 0;
-		vm.slot[slot].freezeCount = 0;
-		vm.slot[slot].delayFrameCount = 0;
+		vm.slot[slot].freezeCount = 0;
+		vm.slot[slot].delayFrameCount = 0;
 		runScriptNested(slot);
 	}
 	if (_vars[VAR_ENTRY_SCRIPT2])

Index: script_v1.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v1.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- script_v1.cpp	31 Aug 2002 13:50:23 -0000	1.6
+++ script_v1.cpp	1 Sep 2002 15:01:39 -0000	1.7
@@ -1881,14 +1881,14 @@
 			a = getVarOrDirectWord(0x80);
 			b = getVarOrDirectWord(0x40);
 		}
-		if (a < 160)
-			a = 160;
-		if (b < 160)
-			b = 160;
-		if (a > _scrWidth - 160)
-			a = _scrWidth - 160;
-		if (b > _scrWidth - 160)
-			b = _scrWidth - 160;
+		if (a < (_realWidth / 2))
+			a = (_realWidth / 2);
+		if (b < (_realWidth / 2))
+			b = (_realWidth / 2);
+		if (a > _scrWidth - (_realWidth / 2))
+			a = _scrWidth - (_realWidth / 2);
+		if (b > _scrWidth - (_realWidth / 2))
+			b = _scrWidth - (_realWidth / 2);
 		_vars[VAR_CAMERA_MIN_X] = a;
 		_vars[VAR_CAMERA_MAX_X] = b;
 		break;
@@ -1911,7 +1911,7 @@
 			a = getVarOrDirectWord(0x80);
 			b = getVarOrDirectWord(0x40);
 		}
-		initScreens(0, a, 320, b);
+		initScreens(0, a, _realWidth, b);
 		break;
 	case 4:											/* set palette color */
 		if (_features & GF_SMALL_HEADER) {

Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v2.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- script_v2.cpp	29 Aug 2002 23:45:15 -0000	1.5
+++ script_v2.cpp	1 Sep 2002 15:01:40 -0000	1.6
@@ -1410,7 +1410,7 @@
 	if (whereIsObject(obj) != WIO_NOT_FOUND) {
 		getObjectXYPos(obj, x, y);
 	} else {
-		x = 160;
+		x = (_realWidth / 2);
 		y = 120;
 	}
 	if (room == 0xFF)
@@ -1790,14 +1790,14 @@
 	case 172:										/* room scroll */
 		b = pop();
 		a = pop();
-		if (a < 160)
-			a = 160;
-		if (b < 160)
-			b = 160;
-		if (a > _scrWidth - 160)
-			a = _scrWidth - 160;
-		if (b > _scrWidth - 160)
-			b = _scrWidth - 160;
+		if (a < (_realWidth / 2))
+			a = (_realWidth / 2);
+		if (b < (_realWidth / 2))
+			b = (_realWidth / 2);
+		if (a > _scrWidth - (_realWidth / 2))
+			a = _scrWidth - (_realWidth / 2);
+		if (b > _scrWidth - (_realWidth / 2))
+			b = _scrWidth - (_realWidth / 2);
 		_vars[VAR_CAMERA_MIN_X] = a;
 		_vars[VAR_CAMERA_MAX_X] = b;
 		break;
@@ -1805,7 +1805,7 @@
 	case 174:										/* set screen */
 		b = pop();
 		a = pop();
-		initScreens(0, a, 320, b);
+		initScreens(0, a, _realWidth, b);
 		break;
 
 	case 175:										/* set palette color */

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- scummvm.cpp	31 Aug 2002 19:26:04 -0000	1.11
+++ scummvm.cpp	1 Sep 2002 15:01:40 -0000	1.12
@@ -931,7 +931,7 @@
 
 
 	if(_features & GF_AFTER_V7)
-		_virtual_mouse_y = mouse.y + camera._cur.y-100;
+		_virtual_mouse_y = mouse.y + camera._cur.y - (_realHeight / 2);
 	else
 		_virtual_mouse_y = mouse.y;
 





More information about the Scummvm-git-logs mailing list