[Scummvm-cvs-logs] CVS: scummvm/scumm script_v2.cpp,2.90,2.91 scumm.h,1.204,1.205 verbs.cpp,1.42,1.43

James Brown ender at users.sourceforge.net
Wed May 21 02:30:05 CEST 2003


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

Modified Files:
	script_v2.cpp scumm.h verbs.cpp 
Log Message:
Move stuff around


Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v2.cpp,v
retrieving revision 2.90
retrieving revision 2.91
diff -u -d -r2.90 -r2.91
--- script_v2.cpp	21 May 2003 07:22:43 -0000	2.90
+++ script_v2.cpp	21 May 2003 09:29:24 -0000	2.91
@@ -1186,53 +1186,7 @@
 	clearDrawObjectQueue();
 	runHook(1);
 
-	// FIXME: Ender Quick Hack to allow further Zak testing.
-	// In reality, we should probably stuff the inventory into verbs
-	// as later games do. Easier hotspot tracking :)
-	if (!(_userState & 64))
-		return;
-{
-        int i, items = 0, curInventoryCount = 0;
-	bool alternate = false;
-
-        if (curInventoryCount > _maxInventoryItems)
-                curInventoryCount = _maxInventoryItems;
-
-        for (i = curInventoryCount + 1; i <= _maxInventoryItems; i++) {
-                if (_inventory[i] != 0) {
-			_string[1].charset = 1;
-			_string[1].ypos = virtscr[2].topline + 34 + (8*(items / 2));
-			_string[1].color = 5;
-			_messagePtr = getObjOrActorName(_inventory[i]);
-
-			if (alternate)
-				_string[1].xpos = 200;
-			else
-				_string[1].xpos = 0;
-			drawString(1);
-
-			items++;
-			alternate = !alternate;
-		}
-		if (items == 4)
-			break;
-        }
-
-	//if (curInventoryCount > 0) { // Draw Up Arrow
-		_string[1].xpos = 145;
-		_string[1].ypos = virtscr[2].topline + 32;
-		_messagePtr = (byte*)strdup("U");
-		drawString(1);
-	//}
-
-	//if (items == 4) {	// Draw Down Arrow
-		_string[1].xpos = 145;
-		_string[1].ypos = virtscr[2].topline + 47;
-		_messagePtr = (byte*)strdup("D");
-		drawString(1);
-	//}
-
-}
+	redrawV2Inventory();
 }
 
 void Scumm_v2::o2_setObjectName() {
@@ -1282,6 +1236,7 @@
 
 	if (a2 & 4) {						// Userface
 		_userState = a2 & (32 | 64 | 128);
+		redrawV2Inventory();
 	}
 
 	if (a2 & 1) {						// Freeze

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.204
retrieving revision 1.205
diff -u -d -r1.204 -r1.205
--- scumm.h	21 May 2003 07:22:43 -0000	1.204
+++ scumm.h	21 May 2003 09:29:24 -0000	1.205
@@ -713,6 +713,8 @@
 	void runObjectScript(int script, int entry, bool freezeResistant, bool recursive, int *vars);
 	void setVerbObject(uint room, uint object, uint verb);
 
+	void redrawV2Inventory();
+
 public:
 	/* Should be in Actor class */
 	Actor *derefActor(int id);

Index: verbs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/verbs.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- verbs.cpp	17 May 2003 06:18:34 -0000	1.42
+++ verbs.cpp	21 May 2003 09:29:24 -0000	1.43
@@ -27,6 +27,51 @@
 #include "scumm.h"
 #include "verbs.h"
 
+void Scumm::redrawV2Inventory() {
+	int i, items = 0, curInventoryCount = 0;
+	bool alternate = false;
+
+	if (!(_userState & 64))
+		return;
+
+	if (curInventoryCount > _maxInventoryItems)
+		curInventoryCount = _maxInventoryItems;
+
+	for (i = curInventoryCount + 1; i <= _maxInventoryItems; i++) {
+		if (_inventory[i] != 0) {
+			_string[1].charset = 1;
+			_string[1].ypos = virtscr[2].topline + 34 + (8*(items / 2));
+			_string[1].color = 5;
+			_messagePtr = getObjOrActorName(_inventory[i]);
+
+			if (alternate)
+				_string[1].xpos = 200;
+			else
+				_string[1].xpos = 0;
+
+			drawString(1);
+
+			items++;
+			alternate = !alternate;
+		}
+		if (items == 4)
+			break;
+	}
+
+	if (curInventoryCount > 0) { // Draw Up Arrow
+		_string[1].xpos = 145;
+		_string[1].ypos = virtscr[2].topline + 32;
+		_messagePtr = (byte*)strdup("U");
+		drawString(1);
+	}
+
+	if (items == 4) {     // Draw Down Arrow
+		_string[1].xpos = 145;
+		_string[1].ypos = virtscr[2].topline + 47;
+		_messagePtr = (byte*)strdup("D");
+		drawString(1);
+	}
+}
 void Scumm::redrawVerbs() {
 	int i;
 	int verb = (_cursor.state > 0 ? checkMouseOver(_mouse.x, _mouse.y) : 0);





More information about the Scummvm-git-logs mailing list