2013-06-22 02:04:17 +00: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.
|
|
|
|
|
|
|
|
* 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.
|
|
|
|
|
|
|
|
* 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_STATICS_H
|
|
|
|
#define FULLPIPE_STATICS_H
|
|
|
|
|
2013-07-20 18:28:32 +00:00
|
|
|
#include "fullpipe/gfx.h"
|
|
|
|
|
2013-06-22 02:04:17 +00:00
|
|
|
namespace Fullpipe {
|
|
|
|
|
2013-07-26 12:47:12 +00:00
|
|
|
class ExCommand;
|
|
|
|
|
2013-09-18 15:21:51 +00:00
|
|
|
class StepArray : public CObject {
|
2013-06-22 02:04:17 +00:00
|
|
|
int _currPointIndex;
|
2013-07-20 13:08:05 +00:00
|
|
|
Common::Point **_points;
|
2013-06-22 02:04:17 +00:00
|
|
|
int _maxPointIndex;
|
|
|
|
int _pointsCount;
|
|
|
|
int _isEos;
|
2013-07-20 13:08:05 +00:00
|
|
|
|
|
|
|
public:
|
2013-09-18 15:21:51 +00:00
|
|
|
StepArray();
|
|
|
|
~StepArray();
|
2013-07-20 13:08:05 +00:00
|
|
|
void clear();
|
|
|
|
|
|
|
|
int getCurrPointIndex() { return _currPointIndex; }
|
2013-10-24 21:34:24 +00:00
|
|
|
int getPointsCount() { return _maxPointIndex; }
|
|
|
|
|
2013-08-09 23:32:00 +00:00
|
|
|
Common::Point *getCurrPoint(Common::Point *point);
|
2013-10-24 21:34:24 +00:00
|
|
|
Common::Point *getPoint(Common::Point *point, int index, int offset);
|
2013-08-09 23:32:00 +00:00
|
|
|
bool gotoNextPoint();
|
2013-06-22 02:04:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class StaticPhase : public Picture {
|
2013-08-09 23:32:00 +00:00
|
|
|
public:
|
2013-06-22 02:04:17 +00:00
|
|
|
int16 _initialCountdown;
|
|
|
|
int16 _countdown;
|
|
|
|
int16 _field_68;
|
|
|
|
int16 _field_6A;
|
2013-07-13 08:51:22 +00:00
|
|
|
ExCommand *_exCommand;
|
|
|
|
|
|
|
|
public:
|
|
|
|
StaticPhase();
|
2013-09-14 22:53:19 +00:00
|
|
|
virtual ~StaticPhase();
|
2013-07-26 12:39:17 +00:00
|
|
|
|
2013-07-13 08:51:22 +00:00
|
|
|
virtual bool load(MfcArchive &file);
|
2013-07-26 12:39:17 +00:00
|
|
|
|
|
|
|
ExCommand *getExCommand() { return _exCommand; }
|
2013-06-22 02:04:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class DynamicPhase : public StaticPhase {
|
2013-08-09 23:32:00 +00:00
|
|
|
public:
|
2013-07-13 08:51:22 +00:00
|
|
|
int _someX;
|
|
|
|
int _someY;
|
|
|
|
Common::Rect *_rect;
|
2013-06-22 02:04:17 +00:00
|
|
|
int16 _field_7C;
|
|
|
|
int16 _field_7E;
|
2013-07-26 12:39:17 +00:00
|
|
|
int _dynFlags;
|
2013-07-13 08:51:22 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
DynamicPhase();
|
2013-07-26 12:39:17 +00:00
|
|
|
DynamicPhase(DynamicPhase *src, bool reverse);
|
2013-09-14 22:53:19 +00:00
|
|
|
virtual ~DynamicPhase();
|
2013-07-26 12:39:17 +00:00
|
|
|
|
2013-07-13 08:51:22 +00:00
|
|
|
virtual bool load(MfcArchive &file);
|
2013-07-29 11:28:47 +00:00
|
|
|
|
|
|
|
int getDynFlags() { return _dynFlags; }
|
2013-06-22 02:04:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class Statics : public DynamicPhase {
|
2013-08-11 14:18:42 +00:00
|
|
|
public:
|
2013-06-22 02:04:17 +00:00
|
|
|
int16 _staticsId;
|
2013-07-19 15:13:00 +00:00
|
|
|
char *_staticsName;
|
2013-07-13 08:51:22 +00:00
|
|
|
Picture *_picture;
|
|
|
|
|
|
|
|
public:
|
|
|
|
Statics();
|
2013-07-26 12:39:17 +00:00
|
|
|
Statics(Statics *src, bool reverse);
|
2013-09-14 22:53:19 +00:00
|
|
|
virtual ~Statics();
|
2013-07-26 12:39:17 +00:00
|
|
|
|
2013-07-13 08:51:22 +00:00
|
|
|
virtual bool load(MfcArchive &file);
|
|
|
|
Statics *getStaticsById(int itemId);
|
2013-07-25 21:14:47 +00:00
|
|
|
|
|
|
|
Common::Point *getSomeXY(Common::Point &p);
|
2013-07-29 11:28:47 +00:00
|
|
|
Common::Point *getCenter(Common::Point *p);
|
2013-06-22 02:04:17 +00:00
|
|
|
};
|
|
|
|
|
2013-06-22 17:26:49 +00:00
|
|
|
class StaticANIObject;
|
|
|
|
|
2013-06-22 02:04:17 +00:00
|
|
|
class Movement : public GameObject {
|
2013-08-19 20:19:00 +00:00
|
|
|
public:
|
2013-11-21 00:27:24 +00:00
|
|
|
Common::Point _somePoint;
|
2013-06-22 02:04:17 +00:00
|
|
|
int _lastFrameSpecialFlag;
|
|
|
|
int _flipFlag;
|
|
|
|
int _updateFlag1;
|
|
|
|
Statics *_staticsObj1;
|
|
|
|
Statics *_staticsObj2;
|
|
|
|
int _mx;
|
|
|
|
int _my;
|
|
|
|
int _m2x;
|
|
|
|
int _m2y;
|
|
|
|
int _field_50;
|
|
|
|
int _counterMax;
|
|
|
|
int _counter;
|
2013-09-18 15:20:53 +00:00
|
|
|
PtrList _dynamicPhases;
|
2013-06-22 02:04:17 +00:00
|
|
|
int _field_78;
|
2013-07-13 08:51:22 +00:00
|
|
|
Common::Point **_framePosOffsets;
|
2013-07-29 11:28:47 +00:00
|
|
|
Movement *_currMovement;
|
2013-06-22 02:04:17 +00:00
|
|
|
int _field_84;
|
|
|
|
DynamicPhase *_currDynamicPhase;
|
|
|
|
int _field_8C;
|
|
|
|
int _currDynamicPhaseIndex;
|
|
|
|
int _field_94;
|
2013-06-22 17:26:49 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
Movement();
|
2013-08-06 18:31:48 +00:00
|
|
|
Movement(Movement *src, StaticANIObject *ani);
|
|
|
|
Movement(Movement *src, int *flag1, int flag2, StaticANIObject *ani);
|
|
|
|
|
2013-06-22 17:26:49 +00:00
|
|
|
virtual bool load(MfcArchive &file);
|
|
|
|
bool load(MfcArchive &file, StaticANIObject *ani);
|
|
|
|
|
|
|
|
Common::Point *getCurrDynamicPhaseXY(Common::Point &p);
|
2013-07-29 11:28:47 +00:00
|
|
|
Common::Point *getCenter(Common::Point *p);
|
|
|
|
Common::Point *getDimensionsOfPhase(Common::Point *p, int phaseIndex);
|
2013-07-13 08:51:22 +00:00
|
|
|
|
2013-09-28 12:59:46 +00:00
|
|
|
Common::Point *calcSomeXY(Common::Point &p, int idx);
|
|
|
|
|
2013-07-13 08:51:22 +00:00
|
|
|
void initStatics(StaticANIObject *ani);
|
|
|
|
void updateCurrDynamicPhase();
|
2013-07-22 22:42:22 +00:00
|
|
|
|
2013-09-01 21:37:27 +00:00
|
|
|
void setAlpha(int alpha);
|
|
|
|
|
2013-08-03 09:29:02 +00:00
|
|
|
void setDynamicPhaseIndex(int index);
|
2013-09-02 21:21:34 +00:00
|
|
|
DynamicPhase *getDynamicPhaseByIndex(int idx);
|
2013-08-03 09:29:02 +00:00
|
|
|
|
2013-09-08 20:53:02 +00:00
|
|
|
int calcDuration();
|
2014-01-04 12:23:55 +00:00
|
|
|
int countPhasesWithFlag(int maxidx, int flag);
|
2013-09-08 20:53:02 +00:00
|
|
|
|
2013-07-29 11:28:47 +00:00
|
|
|
void removeFirstPhase();
|
2013-12-11 19:41:00 +00:00
|
|
|
bool gotoNextFrame(void (*_callback1)(int, Common::Point *point, int, int), void (*callback2)(int *));
|
2013-08-09 23:32:00 +00:00
|
|
|
bool gotoPrevFrame();
|
|
|
|
void gotoFirstFrame();
|
2013-08-03 09:29:02 +00:00
|
|
|
void gotoLastFrame();
|
2013-07-29 11:28:47 +00:00
|
|
|
|
2013-07-22 22:42:22 +00:00
|
|
|
void loadPixelData();
|
2013-07-25 21:14:47 +00:00
|
|
|
|
|
|
|
void draw(bool flipFlag, int angle);
|
2013-06-22 02:04:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class StaticANIObject : public GameObject {
|
2013-08-11 14:18:42 +00:00
|
|
|
public:
|
2013-07-25 21:14:47 +00:00
|
|
|
Movement *_movement;
|
|
|
|
Statics *_statics;
|
2013-06-22 02:04:17 +00:00
|
|
|
int _shadowsOn;
|
|
|
|
int16 _field_30;
|
|
|
|
int16 _field_32;
|
|
|
|
int _field_34;
|
|
|
|
int _initialCounter;
|
2013-12-11 19:41:00 +00:00
|
|
|
void (*_callback1)(int, Common::Point *point, int, int);
|
2013-08-19 20:19:00 +00:00
|
|
|
void (*_callback2)(int *);
|
2013-09-18 15:20:53 +00:00
|
|
|
PtrList _movements;
|
|
|
|
PtrList _staticsList;
|
2013-09-18 15:21:51 +00:00
|
|
|
StepArray _stepArray;
|
2013-06-22 02:04:17 +00:00
|
|
|
int16 _field_96;
|
|
|
|
int _messageQueueId;
|
|
|
|
int _messageNum;
|
|
|
|
int _animExFlag;
|
|
|
|
int _counter;
|
|
|
|
int _someDynamicPhaseIndex;
|
|
|
|
|
|
|
|
public:
|
|
|
|
int16 _sceneId;
|
2013-06-22 17:26:49 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
StaticANIObject();
|
2013-08-05 22:50:16 +00:00
|
|
|
StaticANIObject(StaticANIObject *src);
|
|
|
|
|
2013-06-22 17:26:49 +00:00
|
|
|
virtual bool load(MfcArchive &file);
|
2013-07-13 08:51:22 +00:00
|
|
|
|
2013-06-22 17:26:49 +00:00
|
|
|
void setOXY(int x, int y);
|
2013-07-13 08:51:22 +00:00
|
|
|
Statics *getStaticsById(int id);
|
2013-08-14 09:52:59 +00:00
|
|
|
Statics *getStaticsByName(char *name);
|
2013-07-13 08:51:22 +00:00
|
|
|
Movement *getMovementById(int id);
|
2013-08-06 18:31:48 +00:00
|
|
|
int getMovementIdById(int itemId);
|
2013-07-22 22:42:22 +00:00
|
|
|
Movement *getMovementByName(char *name);
|
2013-07-29 11:28:47 +00:00
|
|
|
Common::Point *getCurrDimensions(Common::Point &p);
|
2013-07-13 08:51:22 +00:00
|
|
|
|
2013-10-26 21:50:27 +00:00
|
|
|
Common::Point *getSomeXY(Common::Point &p);
|
|
|
|
|
2013-07-20 13:08:05 +00:00
|
|
|
void clearFlags();
|
2013-08-19 20:19:00 +00:00
|
|
|
void setFlags40(bool state);
|
2013-07-20 13:08:05 +00:00
|
|
|
bool isIdle();
|
2013-09-01 21:37:27 +00:00
|
|
|
void setAlpha(int alpha);
|
2013-07-20 13:08:05 +00:00
|
|
|
|
|
|
|
void deleteFromGlobalMessageQueue();
|
2013-08-10 20:41:38 +00:00
|
|
|
void queueMessageQueue(MessageQueue *msg);
|
2013-08-11 19:47:46 +00:00
|
|
|
MessageQueue *getMessageQueue();
|
|
|
|
bool trySetMessageQueue(int msgNum, int qId);
|
2014-01-04 23:06:42 +00:00
|
|
|
void startMQIfIdle(int qId, int flag);
|
2013-07-20 13:08:05 +00:00
|
|
|
|
2013-07-29 11:28:47 +00:00
|
|
|
void initMovements();
|
2013-07-22 22:42:22 +00:00
|
|
|
void loadMovementsPixelData();
|
|
|
|
|
2013-08-05 22:50:16 +00:00
|
|
|
void setSomeDynamicPhaseIndex(int val) { _someDynamicPhaseIndex = val; }
|
2013-08-11 19:47:46 +00:00
|
|
|
void adjustSomeXY();
|
|
|
|
|
|
|
|
bool startAnim(int movementId, int messageQueueId, int dynPhaseIdx);
|
|
|
|
bool startAnimEx(int movid, int parId, int flag1, int flag2);
|
|
|
|
void startAnimSteps(int movementId, int messageQueueId, int x, int y, Common::Point **points, int pointsCount, int someDynamicPhaseIndex);
|
2013-08-05 22:50:16 +00:00
|
|
|
|
2013-08-11 19:47:46 +00:00
|
|
|
void hide();
|
|
|
|
void show1(int x, int y, int movementId, int mqId);
|
|
|
|
void show2(int x, int y, int movementId, int mqId);
|
|
|
|
void playIdle();
|
2013-07-31 17:06:13 +00:00
|
|
|
void update(int counterdiff);
|
|
|
|
|
2013-07-26 12:39:17 +00:00
|
|
|
Statics *addReverseStatics(Statics *ani);
|
2013-07-12 19:35:51 +00:00
|
|
|
void draw();
|
|
|
|
void draw2();
|
2013-07-28 11:54:25 +00:00
|
|
|
|
|
|
|
MovTable *countMovements();
|
|
|
|
void setSpeed(int speed);
|
2013-08-09 23:32:00 +00:00
|
|
|
|
2013-10-24 21:34:24 +00:00
|
|
|
void updateStepPos();
|
2013-08-09 23:32:00 +00:00
|
|
|
void stopAnim_maybe();
|
2013-08-11 19:47:46 +00:00
|
|
|
|
|
|
|
MessageQueue *changeStatics1(int msgNum);
|
|
|
|
void changeStatics2(int objId);
|
2013-08-28 07:50:03 +00:00
|
|
|
|
|
|
|
bool getPixelAtPos(int x, int y, int *pixel);
|
2013-07-28 11:54:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct MovTable {
|
|
|
|
int count;
|
|
|
|
int16 *movs;
|
2013-06-22 02:04:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Fullpipe
|
|
|
|
|
|
|
|
#endif /* FULLPIPE_STATICS_H */
|