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-06-22 02:04:17 +00:00
|
|
|
class CStepArray : public CObject {
|
|
|
|
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:
|
|
|
|
CStepArray();
|
|
|
|
~CStepArray();
|
|
|
|
void clear();
|
|
|
|
|
|
|
|
int getCurrPointIndex() { return _currPointIndex; }
|
2013-08-09 23:32:00 +00:00
|
|
|
Common::Point *getCurrPoint(Common::Point *point);
|
|
|
|
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-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-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-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-06-22 02:04:17 +00:00
|
|
|
int _field_24;
|
|
|
|
int _field_28;
|
|
|
|
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;
|
|
|
|
CPtrList _dynamicPhases;
|
|
|
|
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
|
|
|
|
|
|
|
void initStatics(StaticANIObject *ani);
|
|
|
|
void updateCurrDynamicPhase();
|
2013-07-22 22:42:22 +00:00
|
|
|
|
2013-08-03 09:29:02 +00:00
|
|
|
void setDynamicPhaseIndex(int index);
|
|
|
|
|
2013-07-29 11:28:47 +00:00
|
|
|
void removeFirstPhase();
|
2013-08-19 20:19:00 +00:00
|
|
|
bool gotoNextFrame(int callback1, 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;
|
|
|
|
int _callback1;
|
2013-08-19 20:19:00 +00:00
|
|
|
void (*_callback2)(int *);
|
2013-06-22 02:04:17 +00:00
|
|
|
CPtrList _movements;
|
|
|
|
CPtrList _staticsList;
|
|
|
|
CStepArray _stepArray;
|
|
|
|
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-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();
|
|
|
|
|
|
|
|
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);
|
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
|
|
|
bool setPicAniInfo(PicAniInfo *picAniInfo);
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
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 */
|