22 #ifndef DRACI_WALKING_H 23 #define DRACI_WALKING_H 25 #include "common/array.h" 26 #include "common/rect.h" 36 WalkingMap() : _realWidth(0), _realHeight(0), _deltaX(1), _deltaY(1),
37 _mapWidth(0), _mapHeight(0), _byteWidth(0), _data(NULL) { }
39 void load(
const byte *data, uint length);
41 bool getPixel(
int x,
int y)
const;
44 Sprite *newOverlayFromMap(byte color)
const;
48 void obliquePath(
const WalkingPath& path, WalkingPath *obliquedPath);
49 Sprite *newOverlayFromPath(
const WalkingPath &path, byte color)
const;
56 int _realWidth, _realHeight;
58 int _mapWidth, _mapHeight;
65 static const int kDirections[][2];
67 void drawOverlayRectangle(
const Common::Point &p, byte color, byte *buf)
const;
71 bool managedToOblique(WalkingPath *path)
const;
78 kDirectionLast, kDirectionMouse, kDirectionUnknown,
79 kDirectionRight, kDirectionLeft, kDirectionIntelligent
87 kMoveDown, kMoveUp, kMoveRight, kMoveLeft,
90 kMoveRightDown = kFirstTurning, kMoveRightUp, kMoveLeftDown, kMoveLeftUp,
91 kMoveDownRight, kMoveUpRight, kMoveDownLeft, kMoveUpLeft,
92 kMoveLeftRight, kMoveRightLeft, kMoveUpStopLeft, kMoveUpStopRight,
93 kLastTurning = kMoveUpStopRight,
95 kSpeakRight, kSpeakLeft, kStopRight, kStopLeft,
97 kFirstTemporaryAnimation
106 _dir = kDirectionLast;
107 _startingDirection = kMoveUndefined;
110 _turningFinished = 0;
112 _callbackOffsetLast = 0;
124 const WalkingPath& getPath()
const {
return _path; }
126 void setCallback(
const GPL2Program *program, uint16 offset);
130 bool isActive()
const {
return _path.size() > 0; }
137 bool continueWalking();
138 bool continueWalkingOrClearPath();
141 void heroAnimationFinished();
159 bool _turningFinished;
163 uint16 _callbackOffset;
164 uint16 _callbackOffsetLast;
169 bool turnForTheNextSegment();
173 bool walkOnNextEdge();
182 Movement directionForNextPhase()
const;
189 static bool isTurningMovement(
Movement m) {
190 return m >= kFirstTurning && m <= kLastTurning;
201 #endif // DRACI_WALKING_H Definition: walking.h:103
Movement
Definition: walking.h:85
Definition: animation.h:30