21 #ifndef DRAGONS_ACTOR_H 22 #define DRAGONS_ACTOR_H 24 #include "common/array.h" 25 #include "common/scummsys.h" 26 #include "graphics/surface.h" 30 class ActorResourceLoader;
34 #define DRAGONS_ENGINE_NUM_ACTORS 64 45 ACTOR_FLAG_100 = 0x100,
46 ACTOR_FLAG_200 = 0x200,
47 ACTOR_FLAG_400 = 0x400,
48 ACTOR_FLAG_800 = 0x800,
49 ACTOR_FLAG_1000 = 0x1000,
50 ACTOR_FLAG_2000 = 0x2000,
51 ACTOR_FLAG_4000 = 0x4000,
52 ACTOR_FLAG_8000 = 0x8000
55 enum ActorFrameFlags {
56 ACTOR_FRAME_FLAG_2 = 0x2,
57 ACTOR_FRAME_FLAG_10 = 0x10,
58 ACTOR_FRAME_FLAG_20 = 0x20
68 uint16 _displayOrder[DRAGONS_ENGINE_NUM_ACTORS];
73 Actor *loadActor(uint32 resourceId, uint32 sequenceId, int16 x, int16 y);
74 Actor *loadActor(uint32 resourceId, uint32 sequenceId, int16 x, int16 y, uint16 priorityLayer);
75 Actor *loadActor(uint32 resourceId, uint16 actorId);
76 Actor *getActor(uint16 actorId);
77 Actor *getActorByDisplayOrder(uint16 position);
78 void clearActorFlags(uint16 startingActorId);
80 void updateActorDisplayOrder();
82 Actor *findFreeActor(int16 resourceID);
83 void resetDisplayOrder();
90 uint16 _actorFileDictionaryIndex;
95 uint16 _sequenceTimerMaxValue;
97 uint16 _sequenceTimer;
100 int16 _priorityLayer;
110 uint16 _walkPointsTbl[32];
111 int16 _walkPointsIndex;
112 int16 _finalWalkDestX;
113 int16 _finalWalkDestY;
120 void init(
ActorResource *resource, int16 x, int16 y, uint32 sequenceID);
121 void updateSequence(uint16 newSequenceID);
122 void resetSequenceIP();
123 byte *getSeqIpAtOffset(uint32 offset);
124 void loadFrame(uint16 frameOffset);
127 bool startWalk(int16 destX, int16 destY, uint16 flags);
129 void waitUntilFlag4IsSet();
130 void waitUntilFlag8IsSet();
131 void waitUntilFlag8And4AreSet();
132 void waitUntilFlag8SetThenSet1000();
133 void waitUntilFlag8SetThenSet1000AndWaitFor4();
134 void waitForWalkToFinish();
136 bool waitUntilFlag4IsSetAllowSkip();
137 bool actorSetSequenceAndWaitAllowSkip(uint16 newSequenceID);
139 void clearFlag(uint32 flag);
140 void setFlag(uint32 flag);
141 bool isFlagSet(uint32 flag);
142 bool isFlagClear(uint32 flag) {
return !isFlagSet(flag); }
145 int16 getFrameYOffset();
148 uint16 canWalkLine(int16 actor_x, int16 actor_y, int16 target_x, int16 target_y, uint16 walkFlags);
149 int16 pathfindingFindClosestPoint(int16 actor_x, int16 actor_y, int16 target_x, int16 target_y, int16 unkType,
150 bool *pointsInUseTbl);
151 int startMoveToPoint(
int destX,
int destY);
156 #endif //DRAGONS_ACTOR_H
Definition: actorresource.h:49
Definition: actorresource.h:58
Definition: actorresource.h:33