aboutsummaryrefslogtreecommitdiff
path: root/queen/walk.h
diff options
context:
space:
mode:
authorGregory Montoir2003-10-10 09:19:52 +0000
committerGregory Montoir2003-10-10 09:19:52 +0000
commit7286df0c94a9c7a2236821c38914dc76db3287b3 (patch)
tree0366e2636ebb02c714b7742c8d69923c0864e04b /queen/walk.h
parentd93520b223be4f48848598839074fff3d0276900 (diff)
downloadscummvm-rg350-7286df0c94a9c7a2236821c38914dc76db3287b3.tar.gz
scummvm-rg350-7286df0c94a9c7a2236821c38914dc76db3287b3.tar.bz2
scummvm-rg350-7286df0c94a9c7a2236821c38914dc76db3287b3.zip
additions/corrections to walking functions
svn-id: r10709
Diffstat (limited to 'queen/walk.h')
-rw-r--r--queen/walk.h54
1 files changed, 34 insertions, 20 deletions
diff --git a/queen/walk.h b/queen/walk.h
index b95c5bfb95..43911cf199 100644
--- a/queen/walk.h
+++ b/queen/walk.h
@@ -31,21 +31,12 @@ namespace Queen {
#define MAX_AREAS 11
-struct WalkData {
-// int16 sign; // never used
- int16 dx, dy;
- int16 area;
-};
-
struct MovePersonAnim {
- int16 wx;
- int16 wy;
- uint16 firstFrame;
- uint16 lastFrame;
+ int16 firstFrame;
+ int16 lastFrame;
uint16 facing;
- const Area *walkingArea;
- void setFrames(uint16 ff, uint16 lf, uint16 face) {
+ void set(int16 ff, int16 lf, uint16 face) {
firstFrame = ff;
lastFrame = lf;
facing = face;
@@ -53,6 +44,14 @@ struct MovePersonAnim {
};
+struct WalkData {
+// int16 sign; // never used
+ int16 dx, dy;
+ const Area *area;
+ MovePersonAnim anim;
+};
+
+
struct MovePersonData {
const char *name;
int16 walkLeft1, walkLeft2;
@@ -66,6 +65,15 @@ struct MovePersonData {
};
+struct Person {
+ const char* name;
+ uint16 bobNum; // P_BOB
+ uint16 bankNum; // P_BANK
+ uint16 image; // MOVE_OTHER, CI arg
+ int direction; // MOVE_OTHER, dir arg
+};
+
+
class Logic;
class Graphics;
@@ -74,25 +82,31 @@ public:
Walk(Logic* logic, Graphics* graphics);
+ //! SETUP_JOE(), loads the various bobs needed to animate Joe
void joeSetup();
+
+ //! SETUP_HERO(), places Joe at the right place when entering a room
+ void joeSetupInRoom(int state, uint16 scale, uint16 entryObj);
//! MOVE_JOE()
- void joeMove(int dir, uint16 oldx, uint16 oldy, uint16 newx, uint16 newy, bool inCutaway);
+ void joeMove(int direction, uint16 endx, uint16 endy, bool inCutaway);
//! FACE_JOE()
- uint16 joeFace(uint16 prevFacing);
+ uint16 joeFace();
//! MOVE_OTHER
- void personMove(const char* name, uint16 endx, uint16 endy, uint16 image, int dir);
+ void personMove(Person* name, uint16 endx, uint16 endy);
private:
- void joeMoveBlock();
+ void joeMoveBlock(int facing);
- void animatePersonPrepare();
+ void animateJoePrepare();
+ void animateJoe();
- void animatePerson();
+ void animatePersonPrepare(const MovePersonData *mpd, const Person* pp);
+ void animatePerson(const MovePersonData *mpd, const Person* pp);
//! CALC_X, CALC_Y
static uint16 calcC(uint16 c1, uint16 c2, uint16 c3, uint16 c4, uint16 lastc);
@@ -118,9 +132,9 @@ private:
//! equivalent to l.2432,2469 MOVE_OTHER() and l.2696,2744 MOVE_JOE()
void calc(uint16 oldPos, uint16 newPos, uint16 oldx, uint16 oldy, uint16 x, uint16 y);
+ static const MovePersonData _moveData[];
- MovePersonAnim _moveAnim[15];
- static MovePersonData _moveData[];
+ uint16 _joePrevFacing;
uint16 _walkDataCount;
WalkData _walkData[16];