[Scummvm-cvs-logs] CVS: scummvm/scumm verbs.h,1.9,1.10 verbs.cpp,1.91,1.92 scummvm.cpp,2.547,2.548 script_v2.cpp,2.229,2.230 script_v5.cpp,1.223,1.224 script_v6.cpp,1.267,1.268 script_v8.cpp,2.222,2.223 saveload.cpp,1.137,1.138

Max Horn fingolfin at users.sourceforge.net
Thu Jan 15 11:26:01 CET 2004


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv26431

Modified Files:
	verbs.h verbs.cpp scummvm.cpp script_v2.cpp script_v5.cpp 
	script_v6.cpp script_v8.cpp saveload.cpp 
Log Message:
use Rect in struct VerbSlot

Index: verbs.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/verbs.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- verbs.h	6 Jan 2004 12:45:31 -0000	1.9
+++ verbs.h	15 Jan 2004 19:25:16 -0000	1.10
@@ -32,9 +32,8 @@
 };
 
 struct VerbSlot {
-	int16 x, y;
-	int16 right, bottom;
-	Common::Rect old;
+	Common::Rect curRect;
+	Common::Rect oldRect;
 	uint16 verbid;
 	uint8 color, hicolor, dimcolor, bkcolor, type;
 	uint8 charset_nr, curmode;

Index: verbs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/verbs.cpp,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- verbs.cpp	8 Jan 2004 03:24:41 -0000	1.91
+++ verbs.cpp	15 Jan 2004 19:25:17 -0000	1.92
@@ -345,13 +345,13 @@
 
 	vs = &_verbs[i];
 	do {
-		if (vs->curmode != 1 || !vs->verbid || vs->saveid || y < vs->y || y >= vs->bottom)
+		if (vs->curmode != 1 || !vs->verbid || vs->saveid || y < vs->curRect.top || y >= vs->curRect.bottom)
 			continue;
 		if (vs->center) {
-			if (x < -(vs->right - vs->x - vs->x) || x >= vs->right)
+			if (x < -(vs->curRect.right - 2 * vs->curRect.left) || x >= vs->curRect.right)
 				continue;
 		} else {
-			if (x < vs->x || x >= vs->right)
+			if (x < vs->curRect.left || x >= vs->curRect.right)
 				continue;
 		}
 
@@ -372,15 +372,15 @@
 
 	if (!vs->saveid && vs->curmode && vs->verbid) {
 		if (vs->type == kImageVerbType) {
-			drawVerbBitmap(verb, vs->x, vs->y);
+			drawVerbBitmap(verb, vs->curRect.left, vs->curRect.top);
 			return;
 		}
 		
 		restoreVerbBG(verb);
 
 		_string[4].charset = vs->charset_nr;
-		_string[4].xpos = vs->x;
-		_string[4].ypos = vs->y;
+		_string[4].xpos = vs->curRect.left;
+		_string[4].ypos = vs->curRect.top;
 		_string[4].right = _screenWidth - 1;
 		_string[4].center = vs->center;
 
@@ -412,9 +412,9 @@
 		drawString(4);
 		_charset->_center = tmp;
 
-		vs->right = _charset->_str.right;
-		vs->bottom = _charset->_str.bottom;
-		vs->old = _charset->_str;
+		vs->curRect.right = _charset->_str.right;
+		vs->curRect.bottom = _charset->_str.bottom;
+		vs->oldRect = _charset->_str;
 		_charset->_str.left = _charset->_str.right;
 	} else {
 		restoreVerbBG(verb);
@@ -426,9 +426,9 @@
 
 	vs = &_verbs[verb];
 
-	if (vs->old.left != -1) {
-		restoreBG(vs->old, vs->bkcolor);
-		vs->old.left = -1;
+	if (vs->oldRect.left != -1) {
+		restoreBG(vs->oldRect, vs->bkcolor);
+		vs->oldRect.left = -1;
 	}
 }
 
@@ -490,12 +490,9 @@
 	}
 
 	vst = &_verbs[verb];
-	vst->right = vst->x + imgw * 8;
-	vst->bottom = vst->y + imgh * 8;
-	vst->old.left = vst->x;
-	vst->old.right = vst->right;
-	vst->old.top = vst->y;
-	vst->old.bottom = vst->bottom;
+	vst->curRect.right = vst->curRect.left + imgw * 8;
+	vst->curRect.bottom = vst->curRect.right + imgh * 8;
+	vst->oldRect = vst->curRect;
 
 	gdi.enableZBuffer();
 

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 2.547
retrieving revision 2.548
diff -u -d -r2.547 -r2.548
--- scummvm.cpp	15 Jan 2004 13:45:57 -0000	2.547
+++ scummvm.cpp	15 Jan 2004 19:25:17 -0000	2.548
@@ -1073,8 +1073,8 @@
 
 	for (i = 0; i < _numVerbs; i++) {
 		_verbs[i].verbid = 0;
-		_verbs[i].right = _screenWidth - 1;
-		_verbs[i].old.left = -1;
+		_verbs[i].curRect.right = _screenWidth - 1;
+		_verbs[i].oldRect.left = -1;
 		_verbs[i].type = 0;
 		_verbs[i].color = 2;
 		_verbs[i].hicolor = 0;

Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v2.cpp,v
retrieving revision 2.229
retrieving revision 2.230
diff -u -d -r2.229 -r2.230
--- script_v2.cpp	11 Jan 2004 20:42:40 -0000	2.229
+++ script_v2.cpp	15 Jan 2004 19:25:17 -0000	2.230
@@ -844,8 +844,8 @@
 		vs->imgindex = 0;
 		vs->prep = prep;
 		
-		vs->x = x;
-		vs->y = y;
+		vs->curRect.left = x;
+		vs->curRect.top = y;
 		
 		// FIXME: again, this map depends on the language of the game.
 		// E.g. a german keyboard has 'z' and 'y' swapped, while a french

Index: script_v5.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v5.cpp,v
retrieving revision 1.223
retrieving revision 1.224
diff -u -d -r1.223 -r1.224
--- script_v5.cpp	11 Jan 2004 20:42:40 -0000	1.223
+++ script_v5.cpp	15 Jan 2004 19:25:17 -0000	1.224
@@ -2421,8 +2421,8 @@
 			vs->hicolor = getVarOrDirectByte(PARAM_1);
 			break;
 		case 5:		// SO_VERB_AT
-			vs->x = getVarOrDirectWord(PARAM_1);
-			vs->y = getVarOrDirectWord(PARAM_2);
+			vs->curRect.left = getVarOrDirectWord(PARAM_1);
+			vs->curRect.top = getVarOrDirectWord(PARAM_2);
 			// Macintosh verison of indy3ega used different interface, so adjust values.
 			if ((_features & GF_MACINTOSH) && (_gameId == GID_INDY3)) {
 				if ((verb > 0) && (verb < 14) || (verb > 31) && (verb < 35)) {
@@ -2430,23 +2430,23 @@
 					case 1:
 					case 2:
 					case 9:
-						vs->x += 16;
+						vs->curRect.left += 16;
 						break;
 					case 10:
 					case 11:
 					case 12:
-						vs->x += 36;
+						vs->curRect.left += 36;
 						break;
 					case 4:
 					case 5:
 					case 8:
-						vs->x += 60;
+						vs->curRect.left += 60;
 						break;
 					case 13:
 					case 32:
 					case 33:
 					case 34:
-						vs->x += 90;
+						vs->curRect.left += 90;
 						break;
 					}
 				}
@@ -2456,22 +2456,22 @@
 					switch (verb) {
 					case 90:
 					case 91:
-						vs->y -= 7;
+						vs->curRect.top -= 7;
 						break;
 					case 92:
-						vs->y -= 6;
+						vs->curRect.top -= 6;
 						break;
 					case 93:
-						vs->y -= 4;
+						vs->curRect.top -= 4;
 						break;
 					case 94:
-						vs->y -= 3;
+						vs->curRect.top -= 3;
 						break;
 					case 95:
-						vs->y -= 1;
+						vs->curRect.top -= 1;
 						break;
 					case 97:
-						vs->y -= 5;
+						vs->curRect.top -= 5;
 					}
 				}
 			}

Index: script_v6.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6.cpp,v
retrieving revision 1.267
retrieving revision 1.268
diff -u -d -r1.267 -r1.268
--- script_v6.cpp	15 Jan 2004 06:25:57 -0000	1.267
+++ script_v6.cpp	15 Jan 2004 19:25:17 -0000	1.268
@@ -1867,8 +1867,8 @@
 		vs->hicolor = pop();
 		break;
 	case 128:		// SO_VERB_AT
-		vs->y = pop();
-		vs->x = pop();
+		vs->curRect.top = pop();
+		vs->curRect.left = pop();
 		break;
 	case 129:		// SO_VERB_ON
 		vs->curmode = 1;
@@ -2682,11 +2682,11 @@
 		break;
 	case 213:
 		slot = getVerbSlot(args[1], 0);
-		push(_verbs[slot].x);
+		push(_verbs[slot].curRect.left);
 		break;
 	case 214:
 		slot = getVerbSlot(args[1], 0);
-		push(_verbs[slot].y);
+		push(_verbs[slot].curRect.top);
 		break;
 	case 215:
 		if ((_extraBoxFlags[args[1]] & 0x00FF) == 0x00C0) {

Index: script_v8.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v8.cpp,v
retrieving revision 2.222
retrieving revision 2.223
diff -u -d -r2.222 -r2.223
--- script_v8.cpp	11 Jan 2004 21:48:31 -0000	2.222
+++ script_v8.cpp	15 Jan 2004 19:25:17 -0000	2.223
@@ -1155,8 +1155,8 @@
 		vs->imgindex = 0;
 		break;
 	case 0x9A:		// SO_VERB_AT Set verb (X,Y) placement
-		vs->y = pop();
-		vs->x = pop();
+		vs->curRect.top = pop();
+		vs->curRect.left = pop();
 		break;
 	case 0x9B:		// SO_VERB_ON Turn verb on
 		vs->curmode = 1;

Index: saveload.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/saveload.cpp,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -d -r1.137 -r1.138
--- saveload.cpp	11 Jan 2004 19:58:28 -0000	1.137
+++ saveload.cpp	15 Jan 2004 19:25:17 -0000	1.138
@@ -326,14 +326,14 @@
 	const SaveLoadEntry *actorEntries = Actor::getSaveLoadEntries();
 
 	const SaveLoadEntry verbEntries[] = {
-		MKLINE(VerbSlot, x, sleInt16, VER(8)),
-		MKLINE(VerbSlot, y, sleInt16, VER(8)),
-		MKLINE(VerbSlot, right, sleInt16, VER(8)),
-		MKLINE(VerbSlot, bottom, sleInt16, VER(8)),
-		MKLINE(VerbSlot, old.left, sleInt16, VER(8)),
-		MKLINE(VerbSlot, old.top, sleInt16, VER(8)),
-		MKLINE(VerbSlot, old.right, sleInt16, VER(8)),
-		MKLINE(VerbSlot, old.bottom, sleInt16, VER(8)),
+		MKLINE(VerbSlot, curRect.left, sleInt16, VER(8)),
+		MKLINE(VerbSlot, curRect.top, sleInt16, VER(8)),
+		MKLINE(VerbSlot, curRect.right, sleInt16, VER(8)),
+		MKLINE(VerbSlot, curRect.bottom, sleInt16, VER(8)),
+		MKLINE(VerbSlot, oldRect.left, sleInt16, VER(8)),
+		MKLINE(VerbSlot, oldRect.top, sleInt16, VER(8)),
+		MKLINE(VerbSlot, oldRect.right, sleInt16, VER(8)),
+		MKLINE(VerbSlot, oldRect.bottom, sleInt16, VER(8)),
 
 		MKLINE_OLD(VerbSlot, verbid, sleByte, VER(8), VER(11)),
 		MKLINE(VerbSlot, verbid, sleInt16, VER(12)),





More information about the Scummvm-git-logs mailing list