21 #ifndef DRAGONS_ACTOR_H 22 #define DRAGONS_ACTOR_H 24 #include "common/system.h" 28 class ActorResourceLoader;
32 #define DRAGONS_ENGINE_NUM_ACTORS 64 43 ACTOR_FLAG_100 = 0x100,
44 ACTOR_FLAG_200 = 0x200,
45 ACTOR_FLAG_400 = 0x400,
46 ACTOR_FLAG_800 = 0x800,
47 ACTOR_FLAG_1000 = 0x1000,
48 ACTOR_FLAG_2000 = 0x2000,
49 ACTOR_FLAG_4000 = 0x4000,
50 ACTOR_FLAG_8000 = 0x8000
53 enum ActorFrameFlags {
54 ACTOR_FRAME_FLAG_2 = 0x2,
55 ACTOR_FRAME_FLAG_10 = 0x10,
56 ACTOR_FRAME_FLAG_20 = 0x20
66 uint16 _displayOrder[DRAGONS_ENGINE_NUM_ACTORS];
71 Actor *loadActor(uint32 resourceId, uint32 sequenceId, int16 x, int16 y);
72 Actor *loadActor(uint32 resourceId, uint32 sequenceId, int16 x, int16 y, uint16 priorityLayer);
73 Actor *loadActor(uint32 resourceId, uint16 actorId);
74 Actor *getActor(uint16 actorId);
75 Actor *getActorByDisplayOrder(uint16 position);
76 void clearActorFlags(uint16 startingActorId);
78 void updateActorDisplayOrder();
80 Actor *findFreeActor(int16 resourceID);
81 void resetDisplayOrder();
88 uint16 _actorFileDictionaryIndex;
93 uint16 _sequenceTimerMaxValue;
95 uint16 _sequenceTimer;
108 uint16 _walkPointsTbl[32];
109 int16 _walkPointsIndex;
110 int16 _finalWalkDestX;
111 int16 _finalWalkDestY;
118 void init(
ActorResource *resource, int16 x, int16 y, uint32 sequenceID);
119 void updateSequence(uint16 newSequenceID);
120 void resetSequenceIP();
121 byte *getSeqIpAtOffset(uint32 offset);
122 void loadFrame(uint16 frameOffset);
125 bool startWalk(int16 destX, int16 destY, uint16 flags);
127 void waitUntilFlag4IsSet();
128 void waitUntilFlag8IsSet();
129 void waitUntilFlag8And4AreSet();
130 void waitUntilFlag8SetThenSet1000();
131 void waitUntilFlag8SetThenSet1000AndWaitFor4();
132 void waitForWalkToFinish();
134 bool waitUntilFlag4IsSetAllowSkip();
135 bool actorSetSequenceAndWaitAllowSkip(uint16 newSequenceID);
137 void clearFlag(uint32 flag);
138 void setFlag(uint32 flag);
139 bool isFlagSet(uint32 flag);
140 bool isFlagClear(uint32 flag) {
return !isFlagSet(flag); }
143 int16 getFrameYOffset();
146 uint16 canWalkLine(int16 actor_x, int16 actor_y, int16 target_x, int16 target_y, uint16 walkFlags);
147 int16 pathfindingFindClosestPoint(int16 actor_x, int16 actor_y, int16 target_x, int16 target_y, int16 unkType,
148 bool *pointsInUseTbl);
149 int startMoveToPoint(
int destX,
int destY);
154 #endif //DRAGONS_ACTOR_H
Definition: actorresource.h:47
Definition: actorresource.h:56
Definition: actorresource.h:31