aboutsummaryrefslogtreecommitdiff
path: root/engines/toltecs/segmap.h
diff options
context:
space:
mode:
authorBenjamin Haisch2008-08-07 14:30:27 +0000
committerWillem Jan Palenstijn2011-11-20 22:43:05 +0100
commit0c3f2ab5d51fe32792896e16c28dfeec97474010 (patch)
tree2acc36646477cfab0ec860a946c6cf9d2bcb889a /engines/toltecs/segmap.h
parentf4e156b3b313d63983c5da68e3b76811926db9de (diff)
downloadscummvm-rg350-0c3f2ab5d51fe32792896e16c28dfeec97474010.tar.gz
scummvm-rg350-0c3f2ab5d51fe32792896e16c28dfeec97474010.tar.bz2
scummvm-rg350-0c3f2ab5d51fe32792896e16c28dfeec97474010.zip
TOLTECS: Some cleanup of the pathfinding code.
Diffstat (limited to 'engines/toltecs/segmap.h')
-rw-r--r--engines/toltecs/segmap.h25
1 files changed, 13 insertions, 12 deletions
diff --git a/engines/toltecs/segmap.h b/engines/toltecs/segmap.h
index 7ec7cfb9a9..a625c84843 100644
--- a/engines/toltecs/segmap.h
+++ b/engines/toltecs/segmap.h
@@ -63,10 +63,10 @@ public:
void load(byte *source);
- int findPathRectAtPoint(int x, int y);
- void adjustPathPoint(int x, int y);
+ int16 findPathRectAtPoint(int16 x, int16 y);
+ void adjustPathPoint(int16 &x, int16 &y);
- void findPath(int16 *pointsArray, int destX, int destY, int x, int y);
+ void findPath(int16 *pointsArray, int16 destX, int16 destY, int16 sourceX, int16 sourceY);
int8 getScalingAtPoint(int16 x, int16 y);
void getRgbModifiertAtPoint(int16 x, int16 y, int16 id, byte &r, byte &g, byte &b);
@@ -87,8 +87,11 @@ public: // for debugging purposes
};
struct SegmapPathRect {
+ /*
int16 y, x;
int16 height, width;
+ */
+ int16 x1, y1, x2, y2;
};
struct SegmapInfoRect {
@@ -114,18 +117,16 @@ public: // for debugging purposes
SegmapPathRectArray _pathRects;
SegmapInfoRectArray _infoRects;
- int _rectIndexArray1[1000];
- uint _rectIndexArray1Count;
+ int16 _deadEndPathRects[1000];
+ uint _deadEndPathRectsCount;
- int _rectIndexArray2[1000];
- uint _rectIndexArray2Count;
+ int16 _closedPathRects[1000];
+ uint _closedPathRectsCount;
- PathPoint _pointsArray[1000];
- int16 _pointsCount;
+ PathPoint _pathNodes[1000];
+ int16 _pathNodesCount;
- int _x, _y;
-
- int findNextPathRect(int srcRectIndex);
+ int16 findNextPathRect(int16 srcRectIndex, int16 destX, int16 destY);
};