2013-06-16 15:11:18 +03:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2014-02-18 02:34:20 +01:00
|
|
|
*
|
2013-06-16 15:11:18 +03:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2014-02-18 02:34:20 +01:00
|
|
|
*
|
2013-06-16 15:11:18 +03:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef FULLPIPE_MOTION_H
|
|
|
|
#define FULLPIPE_MOTION_H
|
|
|
|
|
|
|
|
namespace Fullpipe {
|
|
|
|
|
2013-10-02 09:03:08 +03:00
|
|
|
class Statics;
|
|
|
|
class Movement;
|
2013-10-04 23:14:09 +03:00
|
|
|
class MctlConnectionPoint;
|
2013-12-19 23:00:23 +02:00
|
|
|
class MovGraphLink;
|
2014-01-03 23:25:37 +02:00
|
|
|
class MessageQueue;
|
2014-01-04 14:23:55 +02:00
|
|
|
class ExCommand2;
|
2014-05-13 09:32:02 +02:00
|
|
|
struct MovItem;
|
2013-10-02 09:03:08 +03:00
|
|
|
|
2013-08-26 22:17:20 +03:00
|
|
|
int startWalkTo(int objId, int objKey, int x, int y, int a5);
|
|
|
|
int doSomeAnimation(int objId, int objKey, int a3);
|
|
|
|
int doSomeAnimation2(int objId, int objKey);
|
|
|
|
|
2013-09-18 19:04:36 +04:00
|
|
|
class MotionController : public CObject {
|
2013-09-22 11:42:50 +03:00
|
|
|
public:
|
2013-06-16 15:11:18 +03:00
|
|
|
int _field_4;
|
2013-07-21 23:22:04 +03:00
|
|
|
bool _isEnabled;
|
2013-06-16 15:11:18 +03:00
|
|
|
|
2013-09-22 11:42:50 +03:00
|
|
|
public:
|
|
|
|
MotionController() : _isEnabled(true), _field_4(0) {}
|
2013-09-24 23:24:33 +03:00
|
|
|
virtual ~MotionController() {}
|
2013-06-16 15:11:18 +03:00
|
|
|
virtual bool load(MfcArchive &file);
|
2013-09-24 23:24:33 +03:00
|
|
|
virtual void methodC() {}
|
|
|
|
virtual void method10() {}
|
|
|
|
virtual void clearEnabled() { _isEnabled = false; }
|
|
|
|
virtual void setEnabled() { _isEnabled = true; }
|
2013-09-28 13:06:06 +03:00
|
|
|
virtual void addObject(StaticANIObject *obj) {}
|
2013-09-24 23:24:33 +03:00
|
|
|
virtual int removeObject(StaticANIObject *obj) { return 0; }
|
2013-09-12 22:47:45 +03:00
|
|
|
virtual void freeItems() {}
|
2014-05-13 09:32:02 +02:00
|
|
|
virtual MovItem *method28(StaticANIObject *ani, int x, int y, int flag1, int *rescount) { return 0; }
|
2013-12-19 00:43:19 +02:00
|
|
|
virtual int method2C(StaticANIObject *obj, int x, int y) { return 0; }
|
2013-09-24 23:24:33 +03:00
|
|
|
virtual int method30() { return 0; }
|
2013-10-15 09:10:57 +03:00
|
|
|
virtual MessageQueue *method34(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) { return 0; }
|
2013-09-24 23:24:33 +03:00
|
|
|
virtual int changeCallback() { return 0; }
|
2013-12-19 00:43:19 +02:00
|
|
|
virtual int method3C(StaticANIObject *ani, int flag) { return 0; }
|
2013-09-24 23:24:33 +03:00
|
|
|
virtual int method40() { return 0; }
|
2014-05-16 20:57:03 +03:00
|
|
|
virtual bool method44(StaticANIObject *ani, int x, int y) { return false; }
|
2013-09-24 23:24:33 +03:00
|
|
|
virtual int method48() { return -1; }
|
2013-10-17 00:37:04 +03:00
|
|
|
virtual MessageQueue *doWalkTo(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) { return 0; }
|
2013-12-18 23:23:32 +02:00
|
|
|
|
|
|
|
void enableLinks(const char *linkName, bool enable);
|
2013-12-19 23:00:23 +02:00
|
|
|
MovGraphLink *getLinkByName(const char *name);
|
2013-06-16 15:11:18 +03:00
|
|
|
};
|
|
|
|
|
2013-09-27 22:16:15 +03:00
|
|
|
class MovGraphReact : public CObject {
|
2013-10-04 23:14:09 +03:00
|
|
|
public:
|
2013-10-05 11:52:50 +03:00
|
|
|
int _pointCount;
|
|
|
|
Common::Point **_points;
|
|
|
|
|
|
|
|
public:
|
|
|
|
MovGraphReact() : _pointCount(0), _points(0) {}
|
|
|
|
~MovGraphReact() { free(_points); }
|
|
|
|
|
2014-01-03 22:54:51 +02:00
|
|
|
virtual void setCenter(int x1, int y1, int x2, int y2) {}
|
2013-10-04 23:14:09 +03:00
|
|
|
virtual void createRegion() {}
|
2013-10-05 11:52:50 +03:00
|
|
|
virtual bool pointInRegion(int x, int y);
|
2013-09-27 22:16:15 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
class MctlCompoundArrayItem : public CObject {
|
2013-12-14 14:49:59 +02:00
|
|
|
public:
|
2013-09-27 22:16:15 +03:00
|
|
|
MotionController *_motionControllerObj;
|
|
|
|
MovGraphReact *_movGraphReactObj;
|
2013-10-04 23:14:09 +03:00
|
|
|
Common::Array<MctlConnectionPoint *> _connectionPoints;
|
2013-09-27 22:16:15 +03:00
|
|
|
int _field_20;
|
|
|
|
int _field_24;
|
|
|
|
int _field_28;
|
|
|
|
|
2013-11-17 12:19:25 +02:00
|
|
|
public:
|
2013-11-10 11:23:36 +02:00
|
|
|
MctlCompoundArrayItem() : _movGraphReactObj(0), _motionControllerObj(0), _field_20(0), _field_24(0), _field_28(0) {}
|
2013-12-15 02:46:22 +02:00
|
|
|
~MctlCompoundArrayItem();
|
2013-09-27 22:16:15 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
class MctlCompoundArray : public Common::Array<MctlCompoundArrayItem *>, public CObject {
|
2013-06-16 15:11:18 +03:00
|
|
|
public:
|
|
|
|
virtual bool load(MfcArchive &file);
|
|
|
|
};
|
|
|
|
|
2013-09-18 19:04:36 +04:00
|
|
|
class MctlCompound : public MotionController {
|
2013-12-14 14:49:59 +02:00
|
|
|
public:
|
2013-09-18 19:04:36 +04:00
|
|
|
MctlCompoundArray _motionControllers;
|
2013-06-16 15:11:18 +03:00
|
|
|
|
2013-09-25 09:35:07 +03:00
|
|
|
MctlCompound() { _objtype = kObjTypeMctlCompound; }
|
|
|
|
|
2013-06-16 15:11:18 +03:00
|
|
|
virtual bool load(MfcArchive &file);
|
2013-07-21 23:22:04 +03:00
|
|
|
|
2013-09-28 13:06:06 +03:00
|
|
|
virtual void addObject(StaticANIObject *obj);
|
2013-09-24 23:24:33 +03:00
|
|
|
virtual int removeObject(StaticANIObject *obj);
|
|
|
|
virtual void freeItems();
|
2013-10-15 09:10:57 +03:00
|
|
|
virtual MessageQueue *method34(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId);
|
2013-10-17 00:37:04 +03:00
|
|
|
virtual MessageQueue *doWalkTo(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId);
|
2013-09-08 23:53:02 +03:00
|
|
|
|
2013-09-24 23:24:33 +03:00
|
|
|
void initMovGraph2();
|
2013-10-04 23:14:09 +03:00
|
|
|
MctlConnectionPoint *findClosestConnectionPoint(int ox, int oy, int destIndex, int connectionX, int connectionY, int sourceIndex, int *minDistancePtr);
|
2013-12-24 00:08:18 +02:00
|
|
|
void replaceNodeX(int from, int to);
|
2013-12-29 23:50:15 +02:00
|
|
|
|
|
|
|
uint getMotionControllerCount() { return _motionControllers.size(); }
|
|
|
|
MotionController *getMotionController(int num) { return _motionControllers[num]->_motionControllerObj; }
|
2013-06-16 15:11:18 +03:00
|
|
|
};
|
|
|
|
|
2013-10-02 09:24:23 +03:00
|
|
|
struct MGMSubItem {
|
2013-12-15 14:20:13 +02:00
|
|
|
Movement *movement;
|
2013-10-02 09:24:23 +03:00
|
|
|
int staticsIndex;
|
|
|
|
int field_8;
|
|
|
|
int field_C;
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
|
|
|
|
MGMSubItem();
|
|
|
|
};
|
|
|
|
|
2013-10-02 08:20:04 +03:00
|
|
|
struct MGMItem {
|
|
|
|
int16 objId;
|
2013-10-02 09:24:23 +03:00
|
|
|
Common::Array<MGMSubItem *> subItems;
|
2013-10-02 09:03:08 +03:00
|
|
|
Common::Array<Statics *> statics;
|
|
|
|
Common::Array<Movement *> movements1;
|
2014-04-25 14:30:51 +03:00
|
|
|
Common::Array<int> movements2;
|
2013-10-02 08:20:04 +03:00
|
|
|
|
|
|
|
MGMItem();
|
|
|
|
};
|
|
|
|
|
2013-11-17 12:19:25 +02:00
|
|
|
struct MGMInfo {
|
|
|
|
StaticANIObject *ani;
|
|
|
|
int staticsId1;
|
|
|
|
int staticsId2;
|
|
|
|
int movementId;
|
|
|
|
int field_10;
|
|
|
|
int x1;
|
|
|
|
int y1;
|
|
|
|
int field_1C;
|
|
|
|
int x2;
|
|
|
|
int y2;
|
|
|
|
int flags;
|
2013-12-14 13:14:00 +02:00
|
|
|
|
|
|
|
MGMInfo() { memset(this, 0, sizeof(MGMInfo)); }
|
2013-11-17 12:19:25 +02:00
|
|
|
};
|
2013-10-02 08:20:04 +03:00
|
|
|
|
2013-10-01 22:22:24 +03:00
|
|
|
class MGM : public CObject {
|
2013-09-28 14:15:46 +03:00
|
|
|
public:
|
2013-10-02 08:20:04 +03:00
|
|
|
Common::Array<MGMItem *> _items;
|
2013-06-16 15:11:18 +03:00
|
|
|
|
2013-09-28 14:15:46 +03:00
|
|
|
public:
|
2013-10-01 22:56:50 +03:00
|
|
|
void clear();
|
|
|
|
void addItem(int objId);
|
2013-10-02 08:20:04 +03:00
|
|
|
void rebuildTables(int objId);
|
|
|
|
int getItemIndexById(int objId);
|
2013-11-17 12:19:25 +02:00
|
|
|
|
|
|
|
MessageQueue *genMovement(MGMInfo *mgminfo);
|
2013-12-11 22:54:15 +02:00
|
|
|
void updateAnimStatics(StaticANIObject *ani, int staticsId);
|
2013-12-11 23:03:51 +02:00
|
|
|
Common::Point *getPoint(Common::Point *point, int aniId, int staticsId1, int staticsId2);
|
2013-12-15 14:20:13 +02:00
|
|
|
int getStaticsIndexById(int idx, int16 id);
|
2014-01-08 10:58:26 +02:00
|
|
|
int getStaticsIndex(int idx, Statics *st);
|
2013-12-15 14:20:13 +02:00
|
|
|
void clearMovements2(int idx);
|
|
|
|
int recalcOffsets(int idx, int st1idx, int st2idx, bool flip, bool flop);
|
2014-02-01 12:55:26 +02:00
|
|
|
Common::Point *calcLength(Common::Point *point, Movement *mov, int x, int y, int *mult, int *len, int flag);
|
2014-01-04 22:16:53 +02:00
|
|
|
ExCommand2 *buildExCommand2(Movement *mov, int objId, int x1, int y1, Common::Point *x2, Common::Point *y2, int len);
|
2014-04-25 22:30:10 +03:00
|
|
|
MessageQueue *genMQ(StaticANIObject *ani, int staticsIndex, int staticsId, int *resStatId, Common::Point **pointArr);
|
2014-04-26 10:39:34 +03:00
|
|
|
int countPhases(int idx, int subIdx, int subOffset, int flag);
|
2014-04-26 12:03:58 +03:00
|
|
|
int refreshOffsets(int objectId, int idx1, int idx2);
|
2013-06-16 15:11:18 +03:00
|
|
|
};
|
|
|
|
|
2013-12-06 22:47:30 +02:00
|
|
|
struct MctlLadderMovementVars {
|
|
|
|
int varUpGo;
|
|
|
|
int varDownGo;
|
|
|
|
int varUpStop;
|
|
|
|
int varDownStop;
|
|
|
|
int varUpStart;
|
|
|
|
int varDownStart;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct MctlLadderMovement {
|
|
|
|
int objId;
|
|
|
|
int staticIdsSize;
|
|
|
|
MctlLadderMovementVars *movVars;
|
|
|
|
int *staticIds;
|
|
|
|
};
|
|
|
|
|
2013-12-05 22:41:02 +02:00
|
|
|
class MctlLadder : public MotionController {
|
|
|
|
public:
|
2013-12-14 14:53:15 +02:00
|
|
|
int _ladderX;
|
2013-12-08 15:25:47 +02:00
|
|
|
int _ladderY;
|
2013-12-05 22:41:02 +02:00
|
|
|
int _ladder_field_14;
|
2013-12-14 14:53:15 +02:00
|
|
|
int _width;
|
2013-12-08 15:25:47 +02:00
|
|
|
int _height;
|
2013-12-05 22:41:02 +02:00
|
|
|
int _ladder_field_20;
|
|
|
|
int _ladder_field_24;
|
2013-12-06 22:47:30 +02:00
|
|
|
Common::List<MctlLadderMovement *> _movements;
|
2013-12-05 22:41:02 +02:00
|
|
|
MGM _mgm;
|
|
|
|
|
|
|
|
public:
|
|
|
|
MctlLadder();
|
2013-12-06 23:36:31 +02:00
|
|
|
virtual ~MctlLadder();
|
2013-12-05 22:44:32 +02:00
|
|
|
int collisionDetection(StaticANIObject *man);
|
2013-12-06 22:59:42 +02:00
|
|
|
|
|
|
|
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);
|
2013-12-06 23:22:28 +02:00
|
|
|
|
2013-12-14 14:49:59 +02:00
|
|
|
MessageQueue *controllerWalkTo(StaticANIObject *ani, int off);
|
|
|
|
|
2013-12-06 23:22:28 +02:00
|
|
|
private:
|
|
|
|
int findObjectPos(StaticANIObject *obj);
|
|
|
|
bool initMovement(StaticANIObject *ani, MctlLadderMovement *movement);
|
2013-12-05 22:41:02 +02:00
|
|
|
};
|
|
|
|
|
2013-09-18 19:04:36 +04:00
|
|
|
class MovGraphNode : public CObject {
|
2013-10-17 00:55:34 +03:00
|
|
|
public:
|
2013-06-22 13:26:49 -04:00
|
|
|
int _x;
|
|
|
|
int _y;
|
|
|
|
int _distance;
|
|
|
|
int16 _field_10;
|
|
|
|
int _field_14;
|
2013-06-16 16:10:46 +03:00
|
|
|
|
2013-10-17 00:55:34 +03:00
|
|
|
public:
|
|
|
|
MovGraphNode() : _x(0), _y(0), _distance(0), _field_10(0), _field_14(0) { _objtype = kObjTypeMovGraphNode; }
|
2013-06-16 16:10:46 +03:00
|
|
|
virtual bool load(MfcArchive &file);
|
|
|
|
};
|
|
|
|
|
2013-09-18 19:04:36 +04:00
|
|
|
class ReactParallel : public MovGraphReact {
|
2013-06-22 13:26:49 -04:00
|
|
|
//CRgn _rgn;
|
|
|
|
int _x1;
|
|
|
|
int _y1;
|
|
|
|
int _x2;
|
|
|
|
int _y2;
|
|
|
|
int _dx;
|
|
|
|
int _dy;
|
2013-06-18 10:04:29 -04:00
|
|
|
|
2014-01-03 22:54:51 +02:00
|
|
|
public:
|
2013-09-18 19:04:36 +04:00
|
|
|
ReactParallel();
|
2013-06-22 13:26:49 -04:00
|
|
|
virtual bool load(MfcArchive &file);
|
2013-10-04 23:14:09 +03:00
|
|
|
|
2014-01-03 22:54:51 +02:00
|
|
|
virtual void setCenter(int x1, int y1, int x2, int y2);
|
2013-10-04 23:14:09 +03:00
|
|
|
virtual void createRegion();
|
2013-06-18 10:04:29 -04:00
|
|
|
};
|
|
|
|
|
2013-09-18 19:04:36 +04:00
|
|
|
class ReactPolygonal : public MovGraphReact {
|
2014-01-04 01:02:12 +02:00
|
|
|
Common::Rect *_bbox;
|
2014-01-03 22:43:46 +02:00
|
|
|
int _centerX;
|
|
|
|
int _centerY;
|
2013-06-18 10:23:49 -04:00
|
|
|
|
2014-01-03 22:54:51 +02:00
|
|
|
public:
|
2013-09-18 19:04:36 +04:00
|
|
|
ReactPolygonal();
|
2014-01-04 01:02:12 +02:00
|
|
|
~ReactPolygonal();
|
|
|
|
|
2013-06-22 13:26:49 -04:00
|
|
|
virtual bool load(MfcArchive &file);
|
2013-10-04 23:14:09 +03:00
|
|
|
|
2014-01-03 22:54:51 +02:00
|
|
|
virtual void setCenter(int x1, int y1, int x2, int y2);
|
2013-10-04 23:14:09 +03:00
|
|
|
virtual void createRegion();
|
2014-01-04 01:02:12 +02:00
|
|
|
|
|
|
|
void getBBox(Common::Rect *rect);
|
2013-06-18 10:23:49 -04:00
|
|
|
};
|
|
|
|
|
2013-09-18 19:04:36 +04:00
|
|
|
class MovGraphLink : public CObject {
|
2013-09-18 00:00:33 +04:00
|
|
|
public:
|
2013-09-18 19:04:36 +04:00
|
|
|
MovGraphNode *_movGraphNode1;
|
|
|
|
MovGraphNode *_movGraphNode2;
|
2013-09-18 19:08:31 +04:00
|
|
|
DWordArray _dwordArray1;
|
|
|
|
DWordArray _dwordArray2;
|
2013-06-22 13:26:49 -04:00
|
|
|
int _flags;
|
|
|
|
int _field_38;
|
|
|
|
int _field_3C;
|
|
|
|
double _distance;
|
|
|
|
double _angle;
|
2013-09-18 19:04:36 +04:00
|
|
|
MovGraphReact *_movGraphReact;
|
2013-06-22 13:26:49 -04:00
|
|
|
char *_name;
|
2013-06-16 16:10:46 +03:00
|
|
|
|
|
|
|
public:
|
2013-09-18 19:04:36 +04:00
|
|
|
MovGraphLink();
|
2014-01-09 22:24:14 +02:00
|
|
|
virtual ~MovGraphLink();
|
|
|
|
|
2013-06-22 13:26:49 -04:00
|
|
|
virtual bool load(MfcArchive &file);
|
2013-10-23 00:49:55 +03:00
|
|
|
|
|
|
|
void calcNodeDistanceAndAngle();
|
2013-06-16 15:11:18 +03:00
|
|
|
};
|
|
|
|
|
2014-05-13 09:32:02 +02:00
|
|
|
struct MovStep {
|
|
|
|
int sfield_0;
|
|
|
|
MovGraphLink *link;
|
|
|
|
};
|
|
|
|
|
2014-05-04 10:41:36 +03:00
|
|
|
struct MovArr {
|
2014-05-13 09:32:02 +02:00
|
|
|
MovStep *_movSteps;
|
|
|
|
int _movStepCount;
|
2014-05-04 10:41:36 +03:00
|
|
|
int _afield_8;
|
|
|
|
MovGraphLink *_link;
|
|
|
|
double _dist;
|
|
|
|
Common::Point _point;
|
|
|
|
};
|
|
|
|
|
2014-05-10 09:30:09 +03:00
|
|
|
struct MovItem {
|
2014-05-15 12:34:55 +02:00
|
|
|
Common::Array<MovArr *> *movarr;
|
2014-05-10 09:30:09 +03:00
|
|
|
int _mfield_4;
|
|
|
|
int _mfield_8;
|
|
|
|
int _mfield_C;
|
|
|
|
};
|
|
|
|
|
2013-10-01 22:56:50 +03:00
|
|
|
struct MovGraphItem {
|
|
|
|
StaticANIObject *ani;
|
|
|
|
int field_4;
|
2014-05-04 10:41:36 +03:00
|
|
|
Common::Array<MovArr *> *movarr;
|
2013-10-01 22:56:50 +03:00
|
|
|
int field_C;
|
|
|
|
int field_10;
|
|
|
|
int field_14;
|
|
|
|
int field_18;
|
|
|
|
int field_1C;
|
|
|
|
int field_20;
|
|
|
|
int field_24;
|
2014-05-10 09:30:09 +03:00
|
|
|
MovItem *items;
|
2013-10-01 22:56:50 +03:00
|
|
|
int count;
|
|
|
|
int field_30;
|
|
|
|
int field_34;
|
|
|
|
int field_38;
|
|
|
|
int field_3C;
|
|
|
|
|
|
|
|
MovGraphItem();
|
2014-05-04 10:41:36 +03:00
|
|
|
void free();
|
2014-05-04 09:33:25 +03:00
|
|
|
};
|
|
|
|
|
2013-09-18 19:04:36 +04:00
|
|
|
class MovGraph : public MotionController {
|
2013-11-17 12:19:25 +02:00
|
|
|
public:
|
2013-09-18 19:08:31 +04:00
|
|
|
ObList _nodes;
|
|
|
|
ObList _links;
|
2013-06-22 13:26:49 -04:00
|
|
|
int _field_44;
|
2013-10-01 22:56:50 +03:00
|
|
|
Common::Array<MovGraphItem *> _items;
|
2014-05-13 09:32:02 +02:00
|
|
|
MovArr *(*_callback1)(StaticANIObject *ani, MovItem *item, int counter);
|
2013-10-01 22:22:24 +03:00
|
|
|
MGM _mgm;
|
2013-06-16 15:11:18 +03:00
|
|
|
|
2013-11-17 12:19:25 +02:00
|
|
|
public:
|
2013-09-18 19:04:36 +04:00
|
|
|
MovGraph();
|
2014-01-08 18:48:34 +02:00
|
|
|
virtual ~MovGraph();
|
|
|
|
|
2013-06-16 15:11:18 +03:00
|
|
|
virtual bool load(MfcArchive &file);
|
2013-07-21 23:22:04 +03:00
|
|
|
|
2013-09-28 13:06:06 +03:00
|
|
|
virtual void addObject(StaticANIObject *obj);
|
2013-09-27 22:16:15 +03:00
|
|
|
virtual int removeObject(StaticANIObject *obj);
|
|
|
|
virtual void freeItems();
|
2014-05-13 09:32:02 +02:00
|
|
|
virtual MovItem *method28(StaticANIObject *ani, int x, int y, int flag1, int *rescount);
|
2013-12-19 00:43:19 +02:00
|
|
|
virtual int method2C(StaticANIObject *obj, int x, int y);
|
2013-10-15 09:10:57 +03:00
|
|
|
virtual MessageQueue *method34(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId);
|
2013-09-27 22:16:15 +03:00
|
|
|
virtual int changeCallback();
|
2013-12-19 00:43:19 +02:00
|
|
|
virtual int method3C(StaticANIObject *ani, int flag);
|
2014-05-16 20:57:03 +03:00
|
|
|
virtual bool method44(StaticANIObject *ani, int x, int y);
|
2013-10-17 00:37:04 +03:00
|
|
|
virtual MessageQueue *doWalkTo(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId);
|
2013-09-27 22:16:15 +03:00
|
|
|
virtual int method50();
|
2013-09-18 00:00:33 +04:00
|
|
|
|
2013-10-15 09:10:57 +03:00
|
|
|
double calcDistance(Common::Point *point, MovGraphLink *link, int fuzzyMatch);
|
2013-10-23 00:49:55 +03:00
|
|
|
void calcNodeDistancesAndAngles();
|
2014-05-05 08:02:26 +03:00
|
|
|
bool findClosestLink(int unusedArg, Common::Point *p, MovArr *movarr);
|
2013-09-18 19:04:36 +04:00
|
|
|
MovGraphNode *calcOffset(int ox, int oy);
|
2014-04-22 21:20:34 +03:00
|
|
|
int getItemIndexByStaticAni(StaticANIObject *ani);
|
2014-05-04 09:33:25 +03:00
|
|
|
Common::Array<MovArr *> *genMovArr(int x, int y, int *arrSize, int flag1, int flag2);
|
2014-05-06 07:10:50 +03:00
|
|
|
void shuffleTree(MovGraphLink *lnk, MovGraphLink *lnk2, Common::Array<MovGraphLink *> &tempObList1, Common::Array<MovGraphLink *> &tempObList2);
|
2014-05-07 22:08:57 +03:00
|
|
|
Common::Array<Common::Rect *> *getBboxes(MovArr *movarr1, MovArr *movarr2, int *listCount);
|
|
|
|
void calcBbox(Common::Rect *rect, MovGraphLink *grlink, MovArr *movarr1, MovArr *movarr2);
|
2014-05-08 23:00:34 +03:00
|
|
|
bool calcChunk(int idx, int x, int y, MovArr *arr, int a6);
|
2014-05-13 09:32:02 +02:00
|
|
|
MessageQueue *sub1(StaticANIObject *ani, int x, int y, int a5, int x1, int y1, int a8, int a9);
|
|
|
|
MessageQueue *fillMGMinfo(StaticANIObject *ani, MovArr *movarr, int staticsId);
|
2013-06-16 15:11:18 +03:00
|
|
|
};
|
|
|
|
|
2013-09-28 14:15:46 +03:00
|
|
|
class Movement;
|
|
|
|
|
|
|
|
struct MG2I {
|
|
|
|
int _movementId;
|
2013-09-28 15:59:46 +03:00
|
|
|
Movement *_mov;
|
2013-09-28 14:15:46 +03:00
|
|
|
int _mx;
|
|
|
|
int _my;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct MovGraph2ItemSub {
|
|
|
|
int _staticsId2;
|
|
|
|
int _staticsId1;
|
2013-09-28 15:59:46 +03:00
|
|
|
MG2I _walk[3];
|
|
|
|
MG2I _turn[4];
|
|
|
|
MG2I _turnS[4];
|
2013-09-28 14:15:46 +03:00
|
|
|
};
|
|
|
|
|
2013-10-15 09:10:57 +03:00
|
|
|
struct LinkInfo {
|
|
|
|
MovGraphLink *link;
|
|
|
|
MovGraphNode *node;
|
|
|
|
};
|
|
|
|
|
2013-10-19 15:54:17 +03:00
|
|
|
struct MovInfo1Sub {
|
|
|
|
int subIndex;
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
int distance;
|
|
|
|
};
|
|
|
|
|
2013-10-15 09:10:57 +03:00
|
|
|
struct MovInfo1 {
|
2014-01-04 23:16:56 +02:00
|
|
|
int index;
|
2013-10-15 09:10:57 +03:00
|
|
|
Common::Point pt1;
|
|
|
|
Common::Point pt2;
|
|
|
|
int distance1;
|
|
|
|
int distance2;
|
|
|
|
int subIndex;
|
|
|
|
int item1Index;
|
2013-10-19 15:54:17 +03:00
|
|
|
Common::Array<MovInfo1Sub *> items;
|
2013-10-15 09:10:57 +03:00
|
|
|
int itemsCount;
|
|
|
|
int flags;
|
2013-12-21 22:36:19 +02:00
|
|
|
|
|
|
|
MovInfo1() { clear(); }
|
|
|
|
MovInfo1(MovInfo1 *src);
|
|
|
|
void clear();
|
2013-10-15 09:10:57 +03:00
|
|
|
};
|
|
|
|
|
2013-11-17 12:19:25 +02:00
|
|
|
struct MovGraph2Item { // 744
|
2013-09-28 14:15:46 +03:00
|
|
|
int _objectId;
|
|
|
|
StaticANIObject *_obj;
|
2013-11-13 23:37:50 +02:00
|
|
|
MovGraph2ItemSub _subItems[4]; // 184
|
2013-09-28 14:15:46 +03:00
|
|
|
};
|
|
|
|
|
2013-09-27 22:16:15 +03:00
|
|
|
class MovGraph2 : public MovGraph {
|
|
|
|
public:
|
2013-11-17 05:04:42 +02:00
|
|
|
Common::Array<MovGraph2Item *> _items2;
|
2013-09-27 22:16:15 +03:00
|
|
|
|
|
|
|
public:
|
2013-09-28 13:06:06 +03:00
|
|
|
virtual void addObject(StaticANIObject *obj);
|
2013-09-27 22:16:15 +03:00
|
|
|
virtual int removeObject(StaticANIObject *obj);
|
|
|
|
virtual void freeItems();
|
2013-10-15 09:10:57 +03:00
|
|
|
virtual MessageQueue *method34(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId);
|
2013-10-17 00:37:04 +03:00
|
|
|
virtual MessageQueue *doWalkTo(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId);
|
2013-09-28 14:15:46 +03:00
|
|
|
|
|
|
|
int getItemIndexByGameObjectId(int objectId);
|
2013-10-15 00:48:49 +03:00
|
|
|
int getItemSubIndexByStaticsId(int index, int staticsId);
|
|
|
|
int getItemSubIndexByMovementId(int index, int movId);
|
|
|
|
int getItemSubIndexByMGM(int idx, StaticANIObject *ani);
|
|
|
|
|
2013-10-17 00:35:02 +03:00
|
|
|
int getShortSide(MovGraphLink *lnk, int x, int y);
|
2013-10-19 17:30:57 +03:00
|
|
|
int findLink(Common::Array<MovGraphLink *> *linkList, int idx, Common::Rect *a3, Common::Point *a4);
|
2013-10-17 00:35:02 +03:00
|
|
|
|
2013-09-28 14:15:46 +03:00
|
|
|
bool initDirections(StaticANIObject *obj, MovGraph2Item *item);
|
2013-10-17 00:35:02 +03:00
|
|
|
void buildMovInfo1SubItems(MovInfo1 *movinfo, Common::Array<MovGraphLink *> *linkList, LinkInfo *lnkSrc, LinkInfo *lnkDst);
|
|
|
|
MessageQueue *buildMovInfo1MessageQueue(MovInfo1 *movInfo);
|
2013-10-15 09:10:57 +03:00
|
|
|
|
|
|
|
MovGraphNode *findNode(int x, int y, int fuzzyMatch);
|
|
|
|
MovGraphLink *findLink1(int x, int y, int idx, int fuzzyMatch);
|
|
|
|
MovGraphLink *findLink2(int x, int y);
|
|
|
|
double findMinPath(LinkInfo *linkInfoSource, LinkInfo *linkInfoDest, Common::Array<MovGraphLink *> *listObj);
|
2013-11-17 12:19:25 +02:00
|
|
|
|
|
|
|
MessageQueue *genMovement(MovInfo1 *movinfo);
|
2013-09-27 22:16:15 +03:00
|
|
|
};
|
|
|
|
|
2013-09-18 19:04:36 +04:00
|
|
|
class MctlConnectionPoint : public CObject {
|
2013-09-28 14:15:46 +03:00
|
|
|
public:
|
2013-06-18 17:07:28 -04:00
|
|
|
int _connectionX;
|
|
|
|
int _connectionY;
|
|
|
|
int _field_C;
|
|
|
|
int _field_10;
|
|
|
|
int16 _field_14;
|
|
|
|
int16 _field_16;
|
2013-10-04 23:14:09 +03:00
|
|
|
MessageQueue *_messageQueueObj;
|
2013-06-18 17:07:28 -04:00
|
|
|
int _motionControllerObj;
|
2013-12-15 02:46:22 +02:00
|
|
|
|
|
|
|
MctlConnectionPoint();
|
|
|
|
~MctlConnectionPoint();
|
2013-06-18 17:07:28 -04:00
|
|
|
};
|
|
|
|
|
2013-06-16 15:11:18 +03:00
|
|
|
} // End of namespace Fullpipe
|
|
|
|
|
|
|
|
#endif /* FULLPIPE_MOTION_H */
|