diff options
author | Andrew Kurushin | 2005-01-06 19:15:01 +0000 |
---|---|---|
committer | Andrew Kurushin | 2005-01-06 19:15:01 +0000 |
commit | 00c98c519e85ee7d3f7f2a262e80a2b24b1914e0 (patch) | |
tree | 229428b76d7a1cf76b9fe1a40a91ed1559db5443 /saga/actor.h | |
parent | 4fae197c67b8cecf5a674c710530c44f5cef814e (diff) | |
download | scummvm-rg350-00c98c519e85ee7d3f7f2a262e80a2b24b1914e0.tar.gz scummvm-rg350-00c98c519e85ee7d3f7f2a262e80a2b24b1914e0.tar.bz2 scummvm-rg350-00c98c519e85ee7d3f7f2a262e80a2b24b1914e0.zip |
- implement faceTowards (script function & etc)
- implement debug actor walk path (press f6)
svn-id: r16456
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) { |