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
|
|
|
|
|
2016-08-14 19:54:20 +02:00
|
|
|
#include "fullpipe/anihandler.h"
|
2014-06-26 19:05:15 +03:00
|
|
|
|
2013-06-16 15:11:18 +03:00
|
|
|
namespace Fullpipe {
|
|
|
|
|
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-05-23 09:41:54 +03:00
|
|
|
struct MovArr;
|
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);
|
2014-05-21 08:07:21 +03:00
|
|
|
bool doSomeAnimation(int objId, int objKey, int a3);
|
|
|
|
bool doSomeAnimation2(int objId, int objKey);
|
2013-08-26 22:17:20 +03:00
|
|
|
|
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) {}
|
2020-02-09 12:05:28 +01:00
|
|
|
~MotionController() override {}
|
|
|
|
bool load(MfcArchive &file) override;
|
2013-09-24 23:24:33 +03:00
|
|
|
virtual void methodC() {}
|
|
|
|
virtual void method10() {}
|
2015-09-20 00:39:53 +02:00
|
|
|
virtual void deactivate() { _isEnabled = false; }
|
|
|
|
virtual void activate() { _isEnabled = true; }
|
|
|
|
virtual void attachObject(StaticANIObject *obj) {}
|
|
|
|
virtual int detachObject(StaticANIObject *obj) { return 0; }
|
|
|
|
virtual void detachAllObjects() {}
|
|
|
|
virtual Common::Array<MovItem *> *getPaths(StaticANIObject *ani, int x, int y, int flag1, int *rescount) { return 0; }
|
|
|
|
virtual bool setPosImmediate(StaticANIObject *obj, int x, int y) { return false; }
|
2013-09-24 23:24:33 +03:00
|
|
|
virtual int method30() { return 0; }
|
2015-09-20 00:39:53 +02:00
|
|
|
virtual MessageQueue *startMove(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) { return 0; }
|
|
|
|
virtual void setSelFunc(MovArr *(*_callback1)(StaticANIObject *ani, Common::Array<MovItem *> *items, signed int counter)) {}
|
|
|
|
virtual bool resetPosition(StaticANIObject *ani, int flag) { return 0; }
|
2013-09-24 23:24:33 +03:00
|
|
|
virtual int method40() { return 0; }
|
2015-09-20 00:39:53 +02:00
|
|
|
virtual bool canDropInventory(StaticANIObject *ani, int x, int y) { return false; }
|
2013-09-24 23:24:33 +03:00
|
|
|
virtual int method48() { return -1; }
|
2016-08-14 22:55:48 +02:00
|
|
|
virtual MessageQueue *makeQueue(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:
|
2017-11-16 10:31:59 -06:00
|
|
|
PointList _points;
|
2013-10-05 11:52:50 +03:00
|
|
|
|
|
|
|
public:
|
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
|
|
|
};
|
|
|
|
|
2015-09-20 00:39:53 +02:00
|
|
|
class MctlItem : public CObject {
|
2013-12-14 14:49:59 +02:00
|
|
|
public:
|
2017-11-15 16:24:37 -06:00
|
|
|
Common::ScopedPtr<MotionController> _motionControllerObj;
|
|
|
|
Common::ScopedPtr<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:
|
2017-11-15 16:24:37 -06:00
|
|
|
MctlItem() : _field_20(0), _field_24(0), _field_28(0) {}
|
2020-02-09 12:05:28 +01:00
|
|
|
~MctlItem() override;
|
2013-09-27 22:16:15 +03:00
|
|
|
};
|
|
|
|
|
2013-09-18 19:04:36 +04:00
|
|
|
class MctlCompound : public MotionController {
|
2013-12-14 14:49:59 +02:00
|
|
|
public:
|
2017-11-16 22:30:25 -06:00
|
|
|
/** list items are owned */
|
|
|
|
Common::Array<MctlItem *> _motionControllers;
|
2013-06-16 15:11:18 +03:00
|
|
|
|
2013-09-25 09:35:07 +03:00
|
|
|
MctlCompound() { _objtype = kObjTypeMctlCompound; }
|
2020-02-09 12:05:28 +01:00
|
|
|
~MctlCompound() override;
|
2013-09-25 09:35:07 +03:00
|
|
|
|
2020-02-09 12:05:28 +01:00
|
|
|
bool load(MfcArchive &file) override;
|
2013-07-21 23:22:04 +03:00
|
|
|
|
2020-02-09 12:05:28 +01:00
|
|
|
void attachObject(StaticANIObject *obj) override;
|
|
|
|
int detachObject(StaticANIObject *obj) override;
|
|
|
|
void detachAllObjects() override;
|
|
|
|
MessageQueue *startMove(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) override;
|
|
|
|
MessageQueue *makeQueue(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) override;
|
2013-09-08 23:53:02 +03:00
|
|
|
|
2016-08-14 22:09:34 +02:00
|
|
|
void initMctlGraph();
|
2014-05-30 09:26:24 +03:00
|
|
|
MctlConnectionPoint *findClosestConnectionPoint(int ox, int oy, int destIndex, int connectionX, int connectionY, int sourceIndex, double *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(); }
|
2017-11-15 16:24:37 -06:00
|
|
|
MotionController *getMotionController(int num) { return _motionControllers[num]->_motionControllerObj.get(); }
|
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;
|
2014-06-04 12:24:01 +03:00
|
|
|
Common::Array<MctlLadderMovement *> _ladmovements;
|
2016-08-14 20:05:32 +02:00
|
|
|
AniHandler _aniHandler;
|
2013-12-05 22:41:02 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
MctlLadder();
|
2020-02-09 12:05:28 +01:00
|
|
|
~MctlLadder() override;
|
2013-12-05 22:44:32 +02:00
|
|
|
int collisionDetection(StaticANIObject *man);
|
2013-12-06 22:59:42 +02:00
|
|
|
|
2020-02-09 12:05:28 +01:00
|
|
|
void attachObject(StaticANIObject *obj) override;
|
|
|
|
int detachObject(StaticANIObject *obj) override { return 1; }
|
|
|
|
void detachAllObjects() override;
|
|
|
|
MessageQueue *startMove(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) override;
|
|
|
|
MessageQueue *makeQueue(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) override;
|
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;
|
2015-09-26 11:33:34 +02:00
|
|
|
int _z;
|
2013-06-22 13:26:49 -04:00
|
|
|
int16 _field_10;
|
|
|
|
int _field_14;
|
2013-06-16 16:10:46 +03:00
|
|
|
|
2013-10-17 00:55:34 +03:00
|
|
|
public:
|
2015-09-26 11:33:34 +02:00
|
|
|
MovGraphNode() : _x(0), _y(0), _z(0), _field_10(0), _field_14(0) { _objtype = kObjTypeMovGraphNode; }
|
2020-02-09 12:05:28 +01:00
|
|
|
bool load(MfcArchive &file) override;
|
2013-06-16 16:10:46 +03:00
|
|
|
};
|
|
|
|
|
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();
|
2020-02-09 12:05:28 +01:00
|
|
|
bool load(MfcArchive &file) override;
|
2013-10-04 23:14:09 +03:00
|
|
|
|
2020-02-09 12:05:28 +01:00
|
|
|
void setCenter(int x1, int y1, int x2, int y2) override;
|
|
|
|
void createRegion() override;
|
2013-06-18 10:04:29 -04:00
|
|
|
};
|
|
|
|
|
2013-09-18 19:04:36 +04:00
|
|
|
class ReactPolygonal : public MovGraphReact {
|
2017-11-16 10:31:59 -06: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
|
|
|
|
2020-02-09 12:05:28 +01:00
|
|
|
bool load(MfcArchive &file) override;
|
2013-10-04 23:14:09 +03:00
|
|
|
|
2020-02-09 12:05:28 +01:00
|
|
|
void setCenter(int x1, int y1, int x2, int y2) override;
|
|
|
|
void createRegion() override;
|
2014-01-04 01:02:12 +02:00
|
|
|
|
2017-11-16 10:31:59 -06:00
|
|
|
Common::Rect getBBox();
|
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:
|
2016-07-20 22:45:25 +03:00
|
|
|
MovGraphNode *_graphSrc;
|
|
|
|
MovGraphNode *_graphDst;
|
2013-09-18 19:08:31 +04:00
|
|
|
DWordArray _dwordArray1;
|
|
|
|
DWordArray _dwordArray2;
|
2016-10-01 21:49:54 +02:00
|
|
|
uint32 _flags;
|
2013-06-22 13:26:49 -04:00
|
|
|
int _field_38;
|
|
|
|
int _field_3C;
|
2016-07-20 22:45:25 +03:00
|
|
|
double _length;
|
2013-06-22 13:26:49 -04:00
|
|
|
double _angle;
|
2013-09-18 19:04:36 +04:00
|
|
|
MovGraphReact *_movGraphReact;
|
2017-03-22 04:11:49 +02:00
|
|
|
Common::String _name;
|
2013-06-16 16:10:46 +03:00
|
|
|
|
|
|
|
public:
|
2013-09-18 19:04:36 +04:00
|
|
|
MovGraphLink();
|
2020-02-09 12:05:28 +01:00
|
|
|
~MovGraphLink() override;
|
2014-01-09 22:24:14 +02:00
|
|
|
|
2020-02-09 12:05:28 +01:00
|
|
|
bool load(MfcArchive &file) override;
|
2013-10-23 00:49:55 +03:00
|
|
|
|
2015-09-20 00:39:53 +02:00
|
|
|
void recalcLength();
|
2013-06-16 15:11:18 +03:00
|
|
|
};
|
2017-11-16 10:31:59 -06:00
|
|
|
typedef Common::Array<MovGraphLink *> MovGraphLinkList;
|
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-24 10:11:08 +03:00
|
|
|
Common::Array<MovStep *> _movSteps;
|
2014-05-13 09:32:02 +02:00
|
|
|
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-24 11:05:07 +03:00
|
|
|
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-24 11:05:07 +03:00
|
|
|
MovArr movarr;
|
2016-12-01 08:05:57 +01:00
|
|
|
Common::Array<MovItem *> *mi_movitems;
|
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 {
|
2017-11-12 17:05:24 -06:00
|
|
|
friend class MctlCompound;
|
|
|
|
friend class MctlGraph;
|
|
|
|
friend class MotionController;
|
|
|
|
private:
|
2017-11-14 22:30:35 -06:00
|
|
|
typedef ObList<MovGraphNode> NodeList;
|
|
|
|
typedef ObList<MovGraphLink> LinkList;
|
|
|
|
NodeList _nodes;
|
|
|
|
LinkList _links;
|
2013-06-22 13:26:49 -04:00
|
|
|
int _field_44;
|
2017-11-12 17:05:24 -06:00
|
|
|
Common::Array<MovGraphItem> _items;
|
2014-05-24 11:05:07 +03:00
|
|
|
MovArr *(*_callback1)(StaticANIObject *ani, Common::Array<MovItem *> *items, signed int counter);
|
2016-08-14 20:05:32 +02:00
|
|
|
AniHandler _aniHandler;
|
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();
|
2020-02-09 12:05:28 +01:00
|
|
|
~MovGraph() override;
|
2014-01-08 18:48:34 +02:00
|
|
|
|
2017-11-12 17:05:24 -06:00
|
|
|
static int messageHandler(ExCommand *cmd);
|
|
|
|
|
2020-02-09 12:05:28 +01:00
|
|
|
bool load(MfcArchive &file) override;
|
|
|
|
|
|
|
|
void attachObject(StaticANIObject *obj) override;
|
|
|
|
int detachObject(StaticANIObject *obj) override;
|
|
|
|
void detachAllObjects() override;
|
|
|
|
Common::Array<MovItem *> *getPaths(StaticANIObject *ani, int x, int y, int flag1, int *rescount) override;
|
|
|
|
bool setPosImmediate(StaticANIObject *obj, int x, int y) override;
|
|
|
|
MessageQueue *startMove(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) override;
|
|
|
|
void setSelFunc(MovArr *(*_callback1)(StaticANIObject *ani, Common::Array<MovItem *> *items, signed int counter)) override;
|
|
|
|
bool resetPosition(StaticANIObject *ani, int flag) override;
|
|
|
|
bool canDropInventory(StaticANIObject *ani, int x, int y) override;
|
|
|
|
MessageQueue *makeQueue(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) override;
|
2014-05-24 11:05:07 +03:00
|
|
|
virtual MessageQueue *method50(StaticANIObject *ani, MovArr *movarr, int staticsId);
|
2013-09-18 00:00:33 +04:00
|
|
|
|
2016-07-25 00:11:04 +03:00
|
|
|
double putToLink(Common::Point *point, MovGraphLink *link, int fuzzyMatch);
|
2015-09-20 00:39:53 +02:00
|
|
|
void recalcLinkParams();
|
|
|
|
bool getNearestPoint(int unusedArg, Common::Point *p, MovArr *movarr);
|
2013-09-18 19:04:36 +04:00
|
|
|
MovGraphNode *calcOffset(int ox, int oy);
|
2015-09-20 00:39:53 +02:00
|
|
|
int getObjectIndex(StaticANIObject *ani);
|
2016-07-23 01:01:20 +03:00
|
|
|
Common::Array<MovArr *> *getHitPoints(int x, int y, int *arrSize, int flag1, int flag2);
|
2017-11-16 10:31:59 -06:00
|
|
|
void findAllPaths(MovGraphLink *lnk, MovGraphLink *lnk2, MovGraphLinkList &tempObList1, MovGraphLinkList &tempObList2);
|
2016-07-23 01:01:20 +03:00
|
|
|
Common::Array<MovItem *> *getPaths(MovArr *movarr1, MovArr *movarr2, int *listCount);
|
2014-05-25 09:00:44 +03:00
|
|
|
void genMovItem(MovItem *movitem, MovGraphLink *grlink, MovArr *movarr1, MovArr *movarr2);
|
2016-07-23 01:01:20 +03:00
|
|
|
bool getHitPoint(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);
|
2016-07-23 01:01:20 +03:00
|
|
|
MessageQueue *makeWholeQueue(StaticANIObject *ani, MovArr *movarr, int staticsId);
|
2014-05-25 12:50:09 +03:00
|
|
|
void setEnds(MovStep *step1, MovStep *step2);
|
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;
|
|
|
|
};
|
|
|
|
|
2016-08-14 23:11:15 +02:00
|
|
|
struct MctlAniSub {
|
2013-09-28 14:15:46 +03:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2016-08-14 23:11:15 +02:00
|
|
|
struct MctlMQSub {
|
2013-10-19 15:54:17 +03:00
|
|
|
int subIndex;
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
int distance;
|
|
|
|
};
|
|
|
|
|
2016-08-14 23:11:15 +02:00
|
|
|
struct MctlMQ {
|
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;
|
2017-11-16 10:31:59 -06:00
|
|
|
Common::Array<MctlMQSub> items;
|
2013-10-15 09:10:57 +03:00
|
|
|
int flags;
|
2013-12-21 22:36:19 +02:00
|
|
|
|
2016-08-14 23:11:15 +02:00
|
|
|
MctlMQ() { clear(); }
|
2013-12-21 22:36:19 +02:00
|
|
|
void clear();
|
2013-10-15 09:10:57 +03:00
|
|
|
};
|
|
|
|
|
2016-08-14 23:11:15 +02:00
|
|
|
struct MctlAni { // 744
|
2013-09-28 14:15:46 +03:00
|
|
|
int _objectId;
|
|
|
|
StaticANIObject *_obj;
|
2016-08-14 23:11:15 +02:00
|
|
|
MctlAniSub _subItems[4]; // 184
|
2013-09-28 14:15:46 +03:00
|
|
|
};
|
|
|
|
|
2016-08-14 22:09:34 +02:00
|
|
|
class MctlGraph : public MovGraph {
|
2013-09-27 22:16:15 +03:00
|
|
|
public:
|
2017-11-16 10:31:59 -06:00
|
|
|
Common::Array<MctlAni> _items2;
|
2013-09-27 22:16:15 +03:00
|
|
|
|
|
|
|
public:
|
2020-02-09 12:05:28 +01:00
|
|
|
void attachObject(StaticANIObject *obj) override;
|
|
|
|
int detachObject(StaticANIObject *obj) override;
|
|
|
|
void detachAllObjects() override;
|
|
|
|
MessageQueue *startMove(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) override;
|
|
|
|
MessageQueue *makeQueue(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) override;
|
2013-09-28 14:15:46 +03:00
|
|
|
|
2016-08-14 22:55:48 +02:00
|
|
|
int getObjIndex(int objectId);
|
|
|
|
int getDirByStatics(int index, int staticsId);
|
|
|
|
int getDirByMovement(int index, int movId);
|
|
|
|
int getDirByPoint(int idx, StaticANIObject *ani);
|
2013-10-15 00:48:49 +03:00
|
|
|
|
2016-08-14 22:55:48 +02:00
|
|
|
int getDirBySize(MovGraphLink *lnk, int x, int y);
|
2017-11-16 10:31:59 -06:00
|
|
|
int getLinkDir(MovGraphLinkList *linkList, int idx, Common::Rect *a3, Common::Point *a4);
|
2013-10-17 00:35:02 +03:00
|
|
|
|
2017-11-16 10:31:59 -06:00
|
|
|
bool fillData(StaticANIObject *obj, MctlAni &item);
|
|
|
|
void generateList(MctlMQ &movinfo, MovGraphLinkList *linkList, LinkInfo *lnkSrc, LinkInfo *lnkDst);
|
|
|
|
MessageQueue *makeWholeQueue(MctlMQ &mctlMQ);
|
2013-10-15 09:10:57 +03:00
|
|
|
|
2016-08-22 23:15:01 +03:00
|
|
|
MovGraphNode *getHitNode(int x, int y, int strictMatch);
|
2016-08-14 22:55:48 +02:00
|
|
|
MovGraphLink *getHitLink(int x, int y, int idx, int fuzzyMatch);
|
|
|
|
MovGraphLink *getNearestLink(int x, int y);
|
2017-11-16 10:31:59 -06:00
|
|
|
double iterate(LinkInfo *linkInfoSource, LinkInfo *linkInfoDest, MovGraphLinkList *listObj);
|
2013-11-17 12:19:25 +02:00
|
|
|
|
2016-08-14 23:11:15 +02:00
|
|
|
MessageQueue *makeLineQueue(MctlMQ *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;
|
2015-09-20 02:43:04 +02:00
|
|
|
int _mctlflags;
|
|
|
|
int _mctlstatic;
|
|
|
|
int16 _mctlmirror;
|
2017-11-15 16:24:37 -06:00
|
|
|
Common::ScopedPtr<MessageQueue> _messageQueueObj;
|
2013-06-18 17:07:28 -04:00
|
|
|
int _motionControllerObj;
|
2013-12-15 02:46:22 +02:00
|
|
|
|
|
|
|
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 */
|