[Scummvm-cvs-logs] CVS: scummvm/queen defs.h,1.5,1.6 logic.h,1.26,1.27 logic.cpp,1.36,1.37 walk.cpp,1.7,1.8

Gregory Montoir cyx at users.sourceforge.net
Tue Oct 14 02:13:01 CEST 2003


Update of /cvsroot/scummvm/scummvm/queen
In directory sc8-pr-cvs1:/tmp/cvs-serv26513

Modified Files:
	defs.h logic.h logic.cpp walk.cpp 
Log Message:
preliminary FIND_STATE implementation

Index: defs.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/defs.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- defs.h	12 Oct 2003 18:44:44 -0000	1.5
+++ defs.h	14 Oct 2003 09:12:00 -0000	1.6
@@ -89,12 +89,22 @@
 	PANEL_AREA_INV_4    = 14
 };
 
+
 enum Language {
 	ENGLISH  = 'E',
 	FRENCH   = 'F',
 	GERMAN   = 'G',
 	ITALIAN  = 'I'
 };
+
+
+enum StateDirection {
+	STATE_DIR_BACK  = 0,
+	STATE_DIR_RIGHT = 1,
+	STATE_DIR_LEFT  = 2,
+	STATE_DIR_FRONT = 3
+};
+
 
 } // End of namespace Queen
 

Index: logic.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/logic.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- logic.h	14 Oct 2003 07:46:24 -0000	1.26
+++ logic.h	14 Oct 2003 09:12:00 -0000	1.27
@@ -121,6 +121,8 @@
 	uint16 animCreate(uint16 curImage, const Person *person); // CREATE_ANIM
 	void animErase(uint16 bobNum);
 
+	StateDirection findStateDirection(uint16 state); // == FIND_STATE(state, "DIR");
+
 
 protected:
 	bool _textToggle;
@@ -137,7 +139,6 @@
 	uint16 _numItems;
 	uint16 _numGraphics;
 
-	uint16 _numObjectBoxes;
 	uint16 _numWalkOffs;
 	uint16 _numObjDesc;
 	uint16 _numCmdList;	//COM_LIST_MAX

Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/logic.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- logic.cpp	14 Oct 2003 06:41:08 -0000	1.36
+++ logic.cpp	14 Oct 2003 09:12:01 -0000	1.37
@@ -1340,6 +1340,26 @@
 }
 
 
+StateDirection Logic::findStateDirection(uint16 state) {
+	// see queen.c l.4016-4023
+	StateDirection sd = STATE_DIR_BACK;
+	switch ((state >> 2) & 3) {
+	case 0: 
+		sd = STATE_DIR_BACK;
+		break;
+	case 1: 
+		sd = STATE_DIR_RIGHT;
+		break;
+	case 2: 
+		sd = STATE_DIR_LEFT;
+		break;
+	case 3: 
+		sd = STATE_DIR_FRONT;
+		break;
+	}
+	return sd;
+}
+
 
 } // End of namespace Queen
 

Index: walk.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/walk.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- walk.cpp	13 Oct 2003 14:21:17 -0000	1.7
+++ walk.cpp	14 Oct 2003 09:12:01 -0000	1.8
@@ -411,8 +411,20 @@
 	// TODO: cutawayJoeFacing
 
     // check to see which way Joe entered room
-	// TODO: JoeFacing with _objectData[entryObj].state
-	_logic->joeFacing(DIR_FRONT);
+	switch (_logic->findStateDirection(pod->state)) {
+	case STATE_DIR_FRONT:
+		_logic->joeFacing(DIR_FRONT);
+		break;
+	case STATE_DIR_BACK:
+		_logic->joeFacing(DIR_BACK);
+		break;
+	case STATE_DIR_LEFT:
+		_logic->joeFacing(DIR_LEFT);
+		break;
+	case STATE_DIR_RIGHT:
+		_logic->joeFacing(DIR_RIGHT);
+		break;
+	}
 
 	_joePrevFacing = _logic->joeFacing();
 	BobSlot *pbs = _graphics->bob(0);





More information about the Scummvm-git-logs mailing list