aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe/motion.h
diff options
context:
space:
mode:
Diffstat (limited to 'engines/fullpipe/motion.h')
-rw-r--r--engines/fullpipe/motion.h116
1 files changed, 98 insertions, 18 deletions
diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h
index bab0ffc8ca..8ca1cdff57 100644
--- a/engines/fullpipe/motion.h
+++ b/engines/fullpipe/motion.h
@@ -28,6 +28,9 @@ namespace Fullpipe {
class Statics;
class Movement;
class MctlConnectionPoint;
+class MovGraphLink;
+class MessageQueue;
+class ExCommand2;
int startWalkTo(int objId, int objKey, int x, int y, int a5);
int doSomeAnimation(int objId, int objKey, int a3);
@@ -50,15 +53,18 @@ public:
virtual int removeObject(StaticANIObject *obj) { return 0; }
virtual void freeItems() {}
virtual int method28() { return 0; }
- virtual int method2C() { return 0; }
+ virtual int method2C(StaticANIObject *obj, int x, int y) { return 0; }
virtual int method30() { return 0; }
virtual MessageQueue *method34(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) { return 0; }
virtual int changeCallback() { return 0; }
- virtual int method3C() { return 0; }
+ virtual int method3C(StaticANIObject *ani, int flag) { return 0; }
virtual int method40() { return 0; }
virtual int method44() { return 0; }
virtual int method48() { return -1; }
virtual MessageQueue *doWalkTo(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) { return 0; }
+
+ void enableLinks(const char *linkName, bool enable);
+ MovGraphLink *getLinkByName(const char *name);
};
class MovGraphReact : public CObject {
@@ -70,15 +76,13 @@ public:
MovGraphReact() : _pointCount(0), _points(0) {}
~MovGraphReact() { free(_points); }
- virtual void method14() {}
+ virtual void setCenter(int x1, int y1, int x2, int y2) {}
virtual void createRegion() {}
virtual bool pointInRegion(int x, int y);
};
class MctlCompoundArrayItem : public CObject {
- friend class MctlCompound;
-
-protected:
+public:
MotionController *_motionControllerObj;
MovGraphReact *_movGraphReactObj;
Common::Array<MctlConnectionPoint *> _connectionPoints;
@@ -88,6 +92,7 @@ protected:
public:
MctlCompoundArrayItem() : _movGraphReactObj(0), _motionControllerObj(0), _field_20(0), _field_24(0), _field_28(0) {}
+ ~MctlCompoundArrayItem();
};
class MctlCompoundArray : public Common::Array<MctlCompoundArrayItem *>, public CObject {
@@ -96,9 +101,9 @@ class MctlCompoundArray : public Common::Array<MctlCompoundArrayItem *>, public
};
class MctlCompound : public MotionController {
+public:
MctlCompoundArray _motionControllers;
- public:
MctlCompound() { _objtype = kObjTypeMctlCompound; }
virtual bool load(MfcArchive &file);
@@ -111,10 +116,14 @@ class MctlCompound : public MotionController {
void initMovGraph2();
MctlConnectionPoint *findClosestConnectionPoint(int ox, int oy, int destIndex, int connectionX, int connectionY, int sourceIndex, int *minDistancePtr);
+ void replaceNodeX(int from, int to);
+
+ uint getMotionControllerCount() { return _motionControllers.size(); }
+ MotionController *getMotionController(int num) { return _motionControllers[num]->_motionControllerObj; }
};
struct MGMSubItem {
- int movement;
+ Movement *movement;
int staticsIndex;
int field_8;
int field_C;
@@ -146,6 +155,8 @@ struct MGMInfo {
int x2;
int y2;
int flags;
+
+ MGMInfo() { memset(this, 0, sizeof(MGMInfo)); }
};
class MGM : public CObject {
@@ -159,6 +170,60 @@ public:
int getItemIndexById(int objId);
MessageQueue *genMovement(MGMInfo *mgminfo);
+ void updateAnimStatics(StaticANIObject *ani, int staticsId);
+ Common::Point *getPoint(Common::Point *point, int aniId, int staticsId1, int staticsId2);
+ int getStaticsIndexById(int idx, int16 id);
+ int getStaticsIndex(int idx, Statics *st);
+ void clearMovements2(int idx);
+ int recalcOffsets(int idx, int st1idx, int st2idx, bool flip, bool flop);
+ Common::Point *calcLength(Common::Point *point, Movement *mov, int x, int y, int *mult, int *len, int flag);
+ ExCommand2 *buildExCommand2(Movement *mov, int objId, int x1, int y1, Common::Point *x2, Common::Point *y2, int len);
+};
+
+struct MctlLadderMovementVars {
+ int varUpGo;
+ int varDownGo;
+ int varUpStop;
+ int varDownStop;
+ int varUpStart;
+ int varDownStart;
+};
+
+struct MctlLadderMovement {
+ int objId;
+ int staticIdsSize;
+ MctlLadderMovementVars *movVars;
+ int *staticIds;
+};
+
+class MctlLadder : public MotionController {
+public:
+ int _ladderX;
+ int _ladderY;
+ int _ladder_field_14;
+ int _width;
+ int _height;
+ int _ladder_field_20;
+ int _ladder_field_24;
+ Common::List<MctlLadderMovement *> _movements;
+ MGM _mgm;
+
+public:
+ MctlLadder();
+ virtual ~MctlLadder();
+ int collisionDetection(StaticANIObject *man);
+
+ virtual void addObject(StaticANIObject *obj);
+ virtual int removeObject(StaticANIObject *obj) { return 1; }
+ virtual void freeItems();
+ virtual MessageQueue *method34(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId);
+ virtual MessageQueue *doWalkTo(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId);
+
+ MessageQueue *controllerWalkTo(StaticANIObject *ani, int off);
+
+private:
+ int findObjectPos(StaticANIObject *obj);
+ bool initMovement(StaticANIObject *ani, MctlLadderMovement *movement);
};
class MovGraphNode : public CObject {
@@ -183,25 +248,29 @@ class ReactParallel : public MovGraphReact {
int _dx;
int _dy;
- public:
+public:
ReactParallel();
virtual bool load(MfcArchive &file);
- virtual void method14();
+ virtual void setCenter(int x1, int y1, int x2, int y2);
virtual void createRegion();
};
class ReactPolygonal : public MovGraphReact {
- //CRgn _rgn;
- int _field_C;
- int _field_10;
+ Common::Rect *_bbox;
+ int _centerX;
+ int _centerY;
- public:
+public:
ReactPolygonal();
+ ~ReactPolygonal();
+
virtual bool load(MfcArchive &file);
- virtual void method14();
+ virtual void setCenter(int x1, int y1, int x2, int y2);
virtual void createRegion();
+
+ void getBBox(Common::Rect *rect);
};
class MovGraphLink : public CObject {
@@ -220,6 +289,8 @@ class MovGraphLink : public CObject {
public:
MovGraphLink();
+ virtual ~MovGraphLink();
+
virtual bool load(MfcArchive &file);
void calcNodeDistanceAndAngle();
@@ -257,16 +328,18 @@ public:
public:
MovGraph();
+ virtual ~MovGraph();
+
virtual bool load(MfcArchive &file);
virtual void addObject(StaticANIObject *obj);
virtual int removeObject(StaticANIObject *obj);
virtual void freeItems();
virtual int method28();
- virtual int method2C();
+ virtual int method2C(StaticANIObject *obj, int x, int y);
virtual MessageQueue *method34(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId);
virtual int changeCallback();
- virtual int method3C();
+ virtual int method3C(StaticANIObject *ani, int flag);
virtual int method44();
virtual MessageQueue *doWalkTo(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId);
virtual int method50();
@@ -306,7 +379,7 @@ struct MovInfo1Sub {
};
struct MovInfo1 {
- int field_0;
+ int index;
Common::Point pt1;
Common::Point pt2;
int distance1;
@@ -316,6 +389,10 @@ struct MovInfo1 {
Common::Array<MovInfo1Sub *> items;
int itemsCount;
int flags;
+
+ MovInfo1() { clear(); }
+ MovInfo1(MovInfo1 *src);
+ void clear();
};
struct MovGraph2Item { // 744
@@ -365,6 +442,9 @@ public:
int16 _field_16;
MessageQueue *_messageQueueObj;
int _motionControllerObj;
+
+ MctlConnectionPoint();
+ ~MctlConnectionPoint();
};
} // End of namespace Fullpipe