22 #ifndef ILLUSIONS_ACTOR_H 23 #define ILLUSIONS_ACTOR_H 25 #include "illusions/resources/actorresource.h" 26 #include "illusions/resources/backgroundresource.h" 27 #include "illusions/graphics.h" 28 #include "illusions/pathfinder.h" 29 #include "common/algorithm.h" 30 #include "common/func.h" 31 #include "common/list.h" 32 #include "graphics/surface.h" 37 class IllusionsEngine;
38 class SequenceOpcodes;
42 ACTOR_FLAG_IS_VISIBLE = 1,
43 ACTOR_FLAG_HAS_WALK_POINTS = 2,
44 ACTOR_FLAG_SCALED = 4,
45 ACTOR_FLAG_PRIORITY = 8,
46 ACTOR_FLAG_HAS_WALK_RECTS = 0x10,
47 ACTOR_FLAG_REGION = 0x20,
50 ACTOR_FLAG_100 = 0x100,
51 ACTOR_FLAG_200 = 0x200,
52 ACTOR_FLAG_400 = 0x400,
53 ACTOR_FLAG_800 = 0x800,
54 ACTOR_FLAG_1000 = 0x1000,
55 ACTOR_FLAG_2000 = 0x2000,
56 ACTOR_FLAG_4000 = 0x4000,
57 ACTOR_FLAG_8000 = 0x8000
60 enum ControlObjectID {
61 CURSOR_OBJECT_ID = 0x40004
64 const uint kSubObjectsCount = 15;
68 uint32 _newSequenceId;
70 : _sequenceId(0), _newSequenceId(0) {}
72 : _sequenceId(sequenceId), _newSequenceId(newSequenceId) {}
77 uint32 use(uint32 sequenceId);
78 void set(uint32 sequenceId, uint32 newSequenceId);
86 return defaultSequence._sequenceId == _sequenceId;
100 void createSurface(
SurfInfo &surfInfo);
101 void destroySurface();
102 void initSequenceStack();
103 void pushSequenceStack(int16 value);
104 int16 popSequenceStack();
105 void setControlRoutine(ActorControlRoutine *controlRoutine);
106 void runControlRoutine(
Control *control, uint32 deltaTime);
118 int16 _newFrameIndex;
144 uint32 _parentObjectId;
147 uint32 _subobjects[kSubObjectsCount];
149 uint32 _notifyThreadId1;
152 uint32 _notifyThreadId2;
155 ActorControlRoutine *_controlRoutine;
163 int _pathCtrX, _pathCtrY;
165 int32 _posXShl, _posYShl;
166 uint _pathPointIndex;
167 uint _pathPointsCount;
169 bool _pathInitialPosFlag;
173 uint32 _walkCallerThreadId1;
176 int16 _choiceJumpOffs;
187 void disappearActor();
188 bool isActorVisible();
189 void activateObject();
190 void deactivateObject();
191 void readPointsConfig(byte *pointsConfig);
194 void setActorScale(
int scale);
195 void faceActor(uint facing);
196 void linkToObject(uint32 parentObjectId, uint32 linkedObjectValue);
198 void clearNotifyThreadId1();
199 void clearNotifyThreadId2();
200 void setPriority(int16 priority);
201 uint32 getOverlapPriority();
202 uint32 getDrawPriority();
203 uint32 getPriority();
205 uint32 getSubActorParent();
206 void getCollisionRectAccurate(
Common::Rect &collisionRect);
208 void setActorUsePan(
int usePan);
209 void setActorFrameIndex(int16 frameIndex);
211 void startSequenceActor(uint32 sequenceId,
int value, uint32 notifyThreadId);
212 void stopSequenceActor();
213 void startTalkActor(uint32 sequenceId, byte *entryTblPtr, uint32 threadId);
214 void sequenceActor();
215 void setActorIndex(
int actorIndex);
216 void setActorIndexTo1();
217 void setActorIndexTo2();
218 void startSubSequence(
int linkIndex, uint32 sequenceId);
219 void stopSubSequence(
int linkIndex);
220 void startMoveActor(uint32 sequenceId,
Common::Point destPt, uint32 callerThreadId1, uint32 callerThreadId2);
222 void updateActorMovement(uint32 deltaTime);
223 void refreshSequenceCode();
224 void getActorFrameDimensions(
WidthHeight &dimensions);
226 void fillActor(byte color);
241 void startSequenceActorIntern(uint32 sequenceId,
int value, byte *entryTblPtr, uint32 notifyThreadId);
242 void execSequenceOpcode(
OpCall &opCall);
250 void placeActor(uint32 actorTypeId,
Common::Point placePt, uint32 sequenceId, uint32 objectId, uint32 notifyThreadId);
253 void placeSubActor(uint32 objectId,
int linkIndex, uint32 actorTypeId, uint32 sequenceId);
254 void placeDialogItem(uint16 objectNum, uint32 actorTypeId, uint32 sequenceId,
Common::Point placePt, int16 choiceJumpOffs);
255 void destroyControls();
256 void destroyActiveControls();
257 void destroyControlsBySceneId(uint32 sceneId);
258 void destroyDialogItems();
259 void threadIsDead(uint32 threadId);
260 void pauseControls();
261 void unpauseControls();
262 void pauseControlsBySceneId(uint32 sceneId);
263 void unpauseControlsBySceneId(uint32 sceneId);
268 void destroyControl(
Control *control);
270 void actorControlRoutine(
Control *control, uint32 deltaTime);
271 void dialogItemControlRoutine(
Control *control, uint32 deltaTime);
272 void disappearActors();
274 void pauseActors(uint32 objectId);
275 void unpauseActors(uint32 objectId);
282 uint32 _nextTempObjectId;
285 uint32 newTempObjectId();
286 void destroyControlInternal(
Control *control);
291 #endif // ILLUSIONS_ACTOR_H Definition: backgroundresource.h:91
Definition: graphics.h:44
Definition: backgroundresource.h:82
Definition: graphics.h:59
T * iterator
Definition: array.h:54
Definition: backgroundresource.h:119
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
Definition: graphics.h:38
Definition: sequenceopcodes.h:35
Definition: graphics.h:31
Definition: backgroundresource.h:126
Definition: backgroundresource.h:72
Definition: list_intern.h:51
Definition: scriptopcodes.h:32
Definition: graphics.h:49
Definition: illusions.h:92
Definition: backgroundresource.h:111
Definition: actorresource.h:76