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
67 uint16 _displayOrder[DRAGONS_ENGINE_NUM_ACTORS];
72 Actor *loadActor(uint32 resourceId, uint32 sequenceId, int16 x, int16 y);
73 Actor *loadActor(uint32 resourceId, uint32 sequenceId, int16 x, int16 y, uint16 priorityLayer);
74 Actor *loadActor(uint32 resourceId, uint16 actorId);
75 Actor *getActor(uint16 actorId);
76 Actor *getActorByDisplayOrder(uint16 position);
77 void clearActorFlags(uint16 startingActorId);
79 void updateActorDisplayOrder();
81 Actor *findFreeActor(int16 resourceID);
82 void resetDisplayOrder();
89 uint16 _actorFileDictionaryIndex;
94 uint16 _sequenceTimerMaxValue;
96 uint16 _sequenceTimer;
109 uint16 _walkPointsTbl[32];
110 int16 _walkPointsIndex;
111 int16 _finalWalkDestX;
112 int16 _finalWalkDestY;
119 void init(
ActorResource *resource, int16 x, int16 y, uint32 sequenceID);
120 void updateSequence(uint16 newSequenceID);
121 void resetSequenceIP();
122 byte *getSeqIpAtOffset(uint32 offset);
123 void loadFrame(uint16 frameOffset);
126 bool startWalk(int16 destX, int16 destY, uint16 flags);
128 void waitUntilFlag4IsSet();
129 void waitUntilFlag8IsSet();
130 void waitUntilFlag8And4AreSet();
131 void waitUntilFlag8SetThenSet1000();
132 void waitUntilFlag8SetThenSet1000AndWaitFor4();
133 void waitForWalkToFinish();
135 bool waitUntilFlag4IsSetAllowSkip();
136 bool actorSetSequenceAndWaitAllowSkip(uint16 newSequenceID);
138 void clearFlag(uint32 flag);
139 void setFlag(uint32 flag);
140 bool isFlagSet(uint32 flag);
141 bool isFlagClear(uint32 flag) {
return !isFlagSet(flag); }
144 int16 getFrameYOffset();
147 uint16 canWalkLine(int16 actor_x, int16 actor_y, int16 target_x, int16 target_y, uint16 walkFlags);
148 int16 pathfindingFindClosestPoint(int16 actor_x, int16 actor_y, int16 target_x, int16 target_y, int16 unkType,
149 bool *pointsInUseTbl);
150 int startMoveToPoint(
int destX,
int destY);
155 #endif //DRAGONS_ACTOR_H
Actor * iterator
Definition: array.h:54
Definition: actorresource.h:47
Definition: actorresource.h:56
Definition: actorresource.h:31