[Scummvm-cvs-logs] CVS: scummvm/scumm gfx.cpp,2.426,2.427 script_v2.cpp,2.269,2.270 verbs.cpp,1.124,1.125

Eugene Sandulenko sev at users.sourceforge.net
Thu Mar 31 17:41:55 CEST 2005


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

Modified Files:
	gfx.cpp script_v2.cpp verbs.cpp 
Log Message:
Normalize verb/invenotry areas in MM NES. Patch from Quietust


Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.426
retrieving revision 2.427
diff -u -d -r2.426 -r2.427
--- gfx.cpp	31 Mar 2005 21:38:30 -0000	2.426
+++ gfx.cpp	1 Apr 2005 01:41:18 -0000	2.427
@@ -552,10 +552,10 @@
 		int x1 = x;
 
 		// HACK: This is dirty hack which renders narrow NES rooms centered
-		// NES can address negative number sprites and that poses problem for
+		// NES can address negative number strips and that poses problem for
 		// our code. So instead adding zillions of fixes and potentially break
 		// other games we shift it right on rendering stage
-		if (_features & GF_NES && ((_NESStartStrip > 0) || (vs->number != kMainVirtScreen))) {
+		if ((_features & GF_NES) && ((_NESStartStrip > 0) && (vs->number == kMainVirtScreen)) || (vs->number == kTextVirtScreen)) {
 			x += 16;
 		}
 

Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v2.cpp,v
retrieving revision 2.269
retrieving revision 2.270
diff -u -d -r2.269 -r2.270
--- script_v2.cpp	31 Mar 2005 21:38:51 -0000	2.269
+++ script_v2.cpp	1 Apr 2005 01:41:19 -0000	2.270
@@ -819,7 +819,7 @@
 		int prep = fetchScriptByte(); // Only used in V1?
 		// V1 Maniac verbs are relative to the 'verb area' - under the sentence
 		if (_features & GF_NES)
-			x -= 8;
+			x += 8;
 		else if ((_gameId == GID_MANIAC) && (_version == 1))
 			y += 8;
 
@@ -1033,9 +1033,10 @@
 	_string[2].charset = 1;
 	_string[2].ypos = virtscr[2].topline;
 	_string[2].xpos = 0;
-	if (_features & GF_NES)
+	if (_features & GF_NES) {
+		_string[2].xpos = 16;
 		_string[2].color = 0;
-	else if (_version == 1)
+	} else if (_version == 1)
 		_string[2].color = 16;
 	else 
 		_string[2].color = 13;
@@ -1056,8 +1057,13 @@
 
 	sentenceline.top = virtscr[2].topline;
 	sentenceline.bottom = virtscr[2].topline + 8;
-	sentenceline.left = 0;
-	sentenceline.right = 319;
+	if (_features & GF_NES) {
+		sentenceline.left = 16;
+		sentenceline.right = 255;
+	} else {
+		sentenceline.left = 0;
+		sentenceline.right = 319;
+	}
 	restoreBG(sentenceline);
 
 	drawString(2, (byte*)sentence);
@@ -1525,8 +1531,13 @@
 	Common::Rect rect;
 	rect.top = virtscr[2].topline;
 	rect.bottom = virtscr[2].topline + 8 * 88;
-	rect.left = 0;
-	rect.right = 319;
+	if (_features & GF_NES) {
+		rect.left = 16;
+		rect.right = 255;
+	} else {
+		rect.left = 0;
+		rect.right = 319;
+	}
 	restoreBG(rect);
 
 	// Draw all verbs and inventory

Index: verbs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/verbs.cpp,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -d -r1.124 -r1.125
--- verbs.cpp	31 Mar 2005 21:39:11 -0000	1.124
+++ verbs.cpp	1 Apr 2005 01:41:20 -0000	1.125
@@ -118,16 +118,16 @@
 	// Inventory items
 
 	for (i = 0; i < 2; i++) {
-		v2_mouseover_boxes[2 * i].rect.left = 0;
-		v2_mouseover_boxes[2 * i].rect.right = 104;
+		v2_mouseover_boxes[2 * i].rect.left = 16;
+		v2_mouseover_boxes[2 * i].rect.right = 120;
 		v2_mouseover_boxes[2 * i].rect.top = 48 + 8 * i;
 		v2_mouseover_boxes[2 * i].rect.bottom = v2_mouseover_boxes[2 * i].rect.top + 8;
 
 		v2_mouseover_boxes[2 * i].color = color;
 		v2_mouseover_boxes[2 * i].hicolor = hi_color;
 
-		v2_mouseover_boxes[2 * i + 1].rect.left = 120;
-		v2_mouseover_boxes[2 * i + 1].rect.right = 224;
+		v2_mouseover_boxes[2 * i + 1].rect.left = 152;
+		v2_mouseover_boxes[2 * i + 1].rect.right = 256;
 		v2_mouseover_boxes[2 * i + 1].rect.top = v2_mouseover_boxes[2 * i].rect.top;
 		v2_mouseover_boxes[2 * i + 1].rect.bottom = v2_mouseover_boxes[2 * i].rect.bottom;
 
@@ -137,16 +137,16 @@
 
 	// Inventory arrows
 
-	v2_mouseover_boxes[kInventoryUpArrow].rect.left = 104;
-	v2_mouseover_boxes[kInventoryUpArrow].rect.right = 112;
+	v2_mouseover_boxes[kInventoryUpArrow].rect.left = 128;
+	v2_mouseover_boxes[kInventoryUpArrow].rect.right = 136;
 	v2_mouseover_boxes[kInventoryUpArrow].rect.top = 48;
 	v2_mouseover_boxes[kInventoryUpArrow].rect.bottom = 56;
 
 	v2_mouseover_boxes[kInventoryUpArrow].color = arrow_color;
 	v2_mouseover_boxes[kInventoryUpArrow].hicolor = hi_color;
 
-	v2_mouseover_boxes[kInventoryDownArrow].rect.left = 112;
-	v2_mouseover_boxes[kInventoryDownArrow].rect.right = 120;
+	v2_mouseover_boxes[kInventoryDownArrow].rect.left = 136;
+	v2_mouseover_boxes[kInventoryDownArrow].rect.right = 144;
 	v2_mouseover_boxes[kInventoryDownArrow].rect.top = 48;
 	v2_mouseover_boxes[kInventoryDownArrow].rect.bottom = 56;
 
@@ -155,8 +155,8 @@
 
 	// Sentence line
 
-	v2_mouseover_boxes[kSentenceLine].rect.left = 0;
-	v2_mouseover_boxes[kSentenceLine].rect.right = 224;
+	v2_mouseover_boxes[kSentenceLine].rect.left = 16;
+	v2_mouseover_boxes[kSentenceLine].rect.right = 256;
 	v2_mouseover_boxes[kSentenceLine].rect.top = 0;
 	v2_mouseover_boxes[kSentenceLine].rect.bottom = 8;
 
@@ -233,10 +233,6 @@
 	if ((y < inventoryArea) || !(_mouseButStat & MBS_LEFT_CLICK)) 
 		return;
 
-	// Inventory is shifted right
-	if (_features & GF_NES)
-		x -= 16;
-
 	if (v2_mouseover_boxes[kInventoryUpArrow].rect.contains(x, y)) {
 		if (_inventoryOffset >= 2) {
 			_inventoryOffset -= 2;
@@ -441,10 +437,6 @@
 	VerbSlot *vs;
 	int i = _numVerbs - 1;
 
-	// Verbs are shifted right
-	if (_features & GF_NES)
-		x -= 16;
-
 	vs = &_verbs[i];
 	do {
 		if (vs->curmode != 1 || !vs->verbid || vs->saveid || y < vs->curRect.top || y >= vs->curRect.bottom)





More information about the Scummvm-git-logs mailing list