diff options
Diffstat (limited to 'saga/actor.h')
-rw-r--r-- | saga/actor.h | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/saga/actor.h b/saga/actor.h index 48dda0ce27..bb2323d1eb 100644 --- a/saga/actor.h +++ b/saga/actor.h @@ -123,7 +123,7 @@ enum PathCellType { struct PathDirectionData { int direction; - int x; + int x; int y; }; @@ -151,10 +151,10 @@ struct ActorLocation { ActorLocation() { x = y = z = 0; } - int distance(const ActorLocation &location) { + int distance(const ActorLocation &location) const { return MAX(ABS(x - location.x), ABS(y - location.y)); } - void delta(const ActorLocation &location, ActorLocation &result) { + void delta(const ActorLocation &location, ActorLocation &result) const { result.x = x - location.x; result.y = y - location.y; result.z = z - location.z; @@ -286,11 +286,15 @@ public: int drawActors(); void updateActorsScene(); // calls from scene loading to update Actors info + void drawPathTest(); + bool actorEndWalk(uint16 actorId, bool recurse); bool actorWalkTo(uint16 actorId, const ActorLocation &toLocation); ActorData *getActor(uint16 actorId); ActorFrameRange *getActorFrameRange(uint16 actorId, int frameType); void realLocation(ActorLocation &location, uint16 objectId, uint16 walkFlags); + void actorFaceTowardsPoint(uint16 actorId, const ActorLocation &toLocation); + void actorFaceTowardsObject(uint16 actorId, uint16 objectId); // speech void actorSpeech(uint16 actorId, const char **strings, int stringsCount, uint16 sampleResourceId, int speechFlags); @@ -362,6 +366,23 @@ private: PathNode _newPathNodeList[PATH_NODE_MAX]; int _pathNodeIndex; +public: +//path debug - use with care + struct DebugPoint { + Point point; + byte color; + }; + DebugPoint *_debugPoints; + int _debugPointsCount; + int _debugPointsAlloced; + void addDebugPoint(const Point &point, byte color) { + if (_debugPointsCount + 1 > _debugPointsAlloced) { + _debugPointsAlloced += 1000; + _debugPoints = (DebugPoint*) realloc(_debugPoints, _debugPointsAlloced * sizeof(*_debugPoints)); + } + _debugPoints[_debugPointsCount].color = color; + _debugPoints[_debugPointsCount++].point = point; + } }; inline int16 quickDistance(const Point &point1, const Point &point2) { |