[Scummvm-cvs-logs] CVS: scummvm/queen defs.h,1.2,1.3 structs.h,1.4,1.5 logic.h,1.15,1.16 logic.cpp,1.25,1.26 walk.h,1.1,1.2 walk.cpp,1.1,1.2

Gregory Montoir cyx at users.sourceforge.net
Thu Oct 9 06:15:04 CEST 2003


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

Modified Files:
	defs.h structs.h logic.h logic.cpp walk.h walk.cpp 
Log Message:
minor additions to walk class + get/set functions for Logic::_area

Index: defs.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/defs.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- defs.h	7 Oct 2003 14:05:56 -0000	1.2
+++ defs.h	9 Oct 2003 13:14:15 -0000	1.3
@@ -65,6 +65,13 @@
 };
 
 
+//! GameState vars
+enum {
+	VAR_DRESSING_MODE = 19, // 0=normal clothes, 1=underwear, 2=dress
+	VAR_INTRO_PLAYED = 117
+};
+
+
 } // End of namespace Queen
 
 #endif

Index: structs.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/structs.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- structs.h	9 Oct 2003 09:09:40 -0000	1.4
+++ structs.h	9 Oct 2003 13:14:15 -0000	1.5
@@ -132,6 +132,7 @@
 	int16 verb;
 	int16 nounObj1;
 	int16 nounObj2;
+	int16 song; // >0: playbefore, <0: playafter
 	bool setAreas;
 	bool setObjects;
 	bool setItems;
@@ -157,8 +158,8 @@
 
 struct CmdInventory {
 	int16 id;
-	int16 dstItem; // <0 : delete, >0 : add
-	int16 srcItem; // >0 : valid
+	int16 dstItem; // <0: delete, >0: add
+	int16 srcItem; // >0: valid
 };
 
 

Index: logic.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/logic.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- logic.h	9 Oct 2003 09:09:40 -0000	1.15
+++ logic.h	9 Oct 2003 13:14:15 -0000	1.16
@@ -62,19 +62,24 @@
 	uint16 findBob(uint16 obj); // FIXME: move that to QueenDisplay ?
 	uint16 findFrame(uint16 obj); // FIXME: move that to QueenDisplay ?
 
-	Area *area(int index, int subIndex);
+	Area *area(int room, int num);
+	Area *currentRoomArea(int num);
+	uint16 areaMax(int room);
+	uint16 currentRoomAreaMax();
 	uint16 walkOffCount();
 	WalkOffData *walkOffData(int index);
 
 	uint16 joeFacing()	{ return _joe.facing; }
 	uint16 joeX()		{ return _joe.x; }
 	uint16 joeY()		{ return _joe.y; }
-	uint16 joeWalk()    { return _joe.walk; }
+	uint16 joeWalk()	{ return _joe.walk; }
+	uint16 joeScale()	{ return _joe.scale; }
 
 	void joeFacing(uint16 dir);
 	void joeX(uint16 x);
 	void joeY(uint16 y);
 	void joeWalk(uint16 walk);
+	void joeScale(uint16 scale);
 	
 	int16 gameState(int index);
 	void gameState(int index, int16 newValue);
@@ -129,6 +134,7 @@
 		uint16	x, y;
 		uint16	facing;
 		uint16  walk;
+		uint16  scale;
 	} _joe;
 	
 	int16 _gameState[GAME_STATE_COUNT];

Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/logic.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- logic.cpp	9 Oct 2003 09:09:40 -0000	1.25
+++ logic.cpp	9 Oct 2003 13:14:15 -0000	1.26
@@ -240,8 +240,20 @@
 	return _objMax[room];
 }
 
-Area *Logic::area(int index, int subIndex) {
-	return &_area[index][subIndex];
+Area *Logic::area(int room, int num) {
+	return &_area[room][num];
+}
+
+Area *Logic::currentRoomArea(int num) {
+	return &_area[_currentRoom][num];
+}
+
+uint16 Logic::areaMax(int room) {
+	return _areaMax[room];
+}
+
+uint16 Logic::currentRoomAreaMax() {
+	return _areaMax[_currentRoom];
 }
 
 uint16 Logic::walkOffCount() {
@@ -442,6 +454,10 @@
 
 void Logic::joeWalk(uint16 walk) {
 	_joe.walk = walk;
+}
+
+void Logic::joeScale(uint16 scale) {
+	_joe.scale = scale;
 }
 
 int16 Logic::gameState(int index) {

Index: walk.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/walk.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- walk.h	9 Oct 2003 09:09:40 -0000	1.1
+++ walk.h	9 Oct 2003 13:14:16 -0000	1.2
@@ -53,6 +53,19 @@
 };
 
 
+struct MovePersonData {
+	const char *name;
+	int16 walkLeft1, walkLeft2;
+	int16 walkRight1, walkRight2;
+	int16 walkBack1, walkBack2;
+	int16 walkFront1, walkFront2;
+	uint16 frontStandingFrame;
+	uint16 backStandingFrame;
+	uint16 animSpeed;
+	uint16 moveSpeed;
+};
+
+
 class Logic;
 class Graphics;
 
@@ -62,19 +75,19 @@
 	Walk(Logic* logic, Graphics* graphics);
 
 	void joeSetup();
-
-	void setCurrentRoomAreas(const Area* roomAreas, uint16 roomAreasCount);
 	
 	//! MOVE_JOE()
 	void joeMove(int dir, uint16 oldx, uint16 oldy, uint16 newx, uint16 newy, bool inCutaway);
 	
 	//! FACE_JOE()
-	uint16 joeFace(uint16 prevFacing, uint16 scale);
+	uint16 joeFace(uint16 prevFacing);
+
+	//! MOVE_OTHER
+	void personMove(const char* name, uint16 endx, uint16 endy, uint16 image, int dir);
 
 
 private:
 
-
 	void joeMoveBlock();
 
 	void animatePersonPrepare();
@@ -107,12 +120,11 @@
 
 
 	MovePersonAnim _moveAnim[15];
+	static MovePersonData _moveData[];
 
 	uint16 _walkDataCount;
 	WalkData _walkData[16];	
 	
-	uint16 _roomAreasCount;
-	const Area* _roomAreas;
 	uint16 _areaStrikeCount;
 	uint16 _areaStrike[MAX_AREAS + 1];
 	uint16 _areaListCount;

Index: walk.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/walk.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- walk.cpp	9 Oct 2003 09:09:40 -0000	1.1
+++ walk.cpp	9 Oct 2003 13:14:16 -0000	1.2
@@ -26,13 +26,37 @@
 
 namespace Queen {
 
+MovePersonData Walk::_moveData[] = {
+   {"COMPY",-1,-6,1,6,0,0,0,0,12,12,1,14},
+   {"DEINO",-1,-8,1,8,0,0,0,0,11,11,1,10},
+   {"FAYE",-1,-6,1,6,13,18,7,12,19,22,2,5},
+   {"GUARDS",-1,-6,1,6,0,0,0,0,7,7,2,5},
+   {"PRINCESS1",-1,-6,1,6,13,18,7,12,19,21,2,5},
+   {"PRINCESS2",-1,-6,1,6,13,18,7,12,19,21,2,5},
+   {"AMGUARD",-1,-6,1,6,13,18,7,12,19,21,2,5},
+   {"SPARKY",-1,-6,1,6,13,18,7,12,21,20,2,5},
+   {"LOLA_SHOWER",-1,-6,55,60,0,0,0,0,7,7,2,5},
+   {"LOLA",-24,-29,24,29,0,0,0,0,30,30,2,5},
+   {"BOB",-15,-20,15,20,21,26,0,0,27,29,2,5},
+   {"CHEF",-1,-4,1,4,0,0,0,0,1,5,2,4},
+   {"HENRY",-1,-6,1,6,0,0,0,0,7,7,2,6},
+   {"ANDERSON",-1,-6,1,6,0,0,0,0,7,7,2,5},
+   {"JASPAR",-4,-9,4,9,16,21,10,15,1,3,1,10},
+   {"PYGMY",-7,-12,7,12,0,0,0,0,27,27,2,5},
+   {"FRANK",7,12,1,6,0,0,0,0,13,13,2,4},
+   {"WEDGEWOOD",-20,-25,20,25,0,0,0,0,1,1,1,5},
+   {"TMPD",-1,-6,1,6,13,18,7,12,19,21,2,5},
+   {"IAN",-1,-6,1,6,0,0,0,0,7,7,2,6},
+   {"*",0,0,0,0,0,0,0,0,0,0,0}
+};
+
 
 Walk::Walk(Logic *logic, Graphics *graphics)
 	: _logic(logic), _graphics(graphics) {
 }
 
 
-uint16 Walk::joeFace(uint16 prevFacing, uint16 scale) {
+uint16 Walk::joeFace(uint16 prevFacing) {
 	BobSlot *pbs = _graphics->bob(0);
 	uint16 frame;
 	if (_logic->currentRoom() == 108) {
@@ -48,7 +72,7 @@
 		}
 		// FIXME: handle prevFacing
 		pbs->frameNum = frame + FRAMES_JOE_XTRA;
-		pbs->scale = scale;
+		pbs->scale = _logic->joeScale();
 		pbs->xflip = (_logic->joeFacing() == DIR_LEFT);
 		_graphics->update();
 		// joePrevFacing = joeFacing;
@@ -78,7 +102,7 @@
 		WalkData *pwd = &_walkData[i];
 		mpa->wx = pwd->dx;
 		mpa->wy = pwd->dy;
-		mpa->walkingArea = &_roomAreas[ pwd->area ];
+		mpa->walkingArea = _logic->currentRoomArea(pwd->area); // &_roomAreas[ pwd->area ];
 
 		if (mpa->wx < 0) {
 			mpa->setFrames(11, 16 + FRAMES_JOE_XTRA, DIR_LEFT);
@@ -111,7 +135,8 @@
 	uint16 i;
 	BobSlot *pbs = _graphics->bob(0);
 	_logic->joeFacing(_moveAnim[1].facing);
-	joeFace(_logic->joeFacing(), _moveAnim[1].walkingArea->calcScale(pbs->y));
+	_logic->joeScale(_moveAnim[1].walkingArea->calcScale(pbs->y));
+	joeFace(_logic->joeFacing());
 	bool interrupted = false;
 	for (i = 1; i <= _walkDataCount && !interrupted; ++i) {
 		MovePersonAnim *mpa = &_moveAnim[i];
@@ -128,6 +153,7 @@
 		while (pbs->moving) {
 			// adjust Joe's movespeed according to scale
 			pbs->scale = mpa->walkingArea->calcScale(pbs->y);
+			_logic->joeScale(pbs->scale);
 			if (pbs->xmajor) {
 				pbs->speed = pbs->scale * 6 / 100;
 			}
@@ -172,7 +198,6 @@
 
 void Walk::joeMove(int direction, uint16 oldx, uint16 oldy, uint16 newx, uint16 newy, bool inCutaway) {
 
-
 //   CAN=0
 	initWalkData();
 
@@ -200,13 +225,16 @@
 //		SPEAK(JOE_RESPstr[4],"JOE",find_cd_desc(4))
 	}
 //MOVE_JOE_EXIT:
+	if (direction > 0) {
+		_logic->joeFacing(direction);
+	}
+//	joePrevFacing = _logic->joeFacing();
+	joeFace(0);
 }
 
 
-void Walk::setCurrentRoomAreas(const Area* roomAreas, uint16 roomAreasCount) {
-
-	_roomAreas = roomAreas;
-	_roomAreasCount = roomAreasCount;
+void Walk::personMove(const char* name, uint16 endx, uint16 endy, uint16 image, int dir) {
+	warning("Walk::personMove() unimplemented");
 }
 
 
@@ -233,8 +261,8 @@
 		for (i = 2; i <= _areaListCount; ++i) {
 			uint16 a1 = _areaList[i - 1];
 			uint16 a2 = _areaList[i];
-			const Area *pa1 = &_roomAreas[ a1 ];
-			const Area *pa2 = &_roomAreas[ a2 ];
+			const Area *pa1 = _logic->currentRoomArea(a1); //&_roomAreas[ a1 ];
+			const Area *pa2 = _logic->currentRoomArea(a2);
 			uint16 x1 = calcC(pa1->box.x1, pa1->box.x2, pa2->box.x1, pa2->box.x2, px);
 			uint16 y1 = calcC(pa1->box.y1, pa1->box.y2, pa2->box.y1, pa2->box.y2, py);
 			incWalkData(px, py, x1, y1, a1);
@@ -260,14 +288,14 @@
 int16 Walk::findAreaPosition(uint16 *x, uint16 *y, bool recalibrate) {
 	uint16 i;
 	uint16 pos = 1;
-	const Box *b = &_roomAreas[1].box;
+	const Box *b = &_logic->currentRoomArea(1)->box;
 	uint16 tx = b->x1;
 	uint16 bx = b->x2;
 	uint16 ty = b->y1;
 	uint16 by = b->y2;
 	uint16 prevClosestFace = 640;
-	for (i = 1; i <= _roomAreasCount; ++i) {
-		b = &_roomAreas[i].box;
+	for (i = 1; i <= _logic->currentRoomAreaMax(); ++i) {
+		b = &_logic->currentRoomArea(i)->box;
 		uint16 dx1 = ABS(b->x1 - *x);
 		uint16 dx2 = ABS(b->x2 - *x);
 		uint16 dy1 = ABS(b->y1 - *y);
@@ -296,7 +324,7 @@
  	// we now have the closest area near X,Y, so we can recalibrate
  	// the X,Y coord to be in this area
 	if (recalibrate) {
-		b = &_roomAreas[pos].box;
+		b = &_logic->currentRoomArea(pos)->box;
 		if(*x < b->x1) *x = b->x1;
 		if(*x > b->x2) *x = b->x2;
 		if(*y < b->y1) *y = b->y1;
@@ -310,9 +338,9 @@
 
 	uint16 testArea;
 	uint16 freeArea = 0;
-	uint16 map = ABS(_roomAreas[area].mapNeighbours);
-	for (testArea = 1; testArea <= _roomAreasCount; ++testArea) {
-		int b = _roomAreasCount - testArea;
+	uint16 map = ABS(_logic->currentRoomArea(area)->mapNeighbours);
+	for (testArea = 1; testArea <= _logic->currentRoomAreaMax(); ++testArea) {
+		int b = _logic->currentRoomAreaMax() - testArea;
 		if (map & (1 << b)) {
 			// connecting area, check if it's been struck off
 			if(!isAreaStruck(testArea)) {





More information about the Scummvm-git-logs mailing list