diff options
author | Bertram <bertram@cegetel.net> | 2010-03-02 23:20:50 +0100 |
---|---|---|
committer | Bertram <yohanndotferreiraatorange.fr> | 2010-04-12 23:50:21 +0200 |
commit | dd2b559ea0d467db7fec522a63a66a82c1415b36 (patch) | |
tree | 06925dcb5d47d631a1425e4ced8ec1cf8975f88b /src/map.h | |
parent | 98967ec85b48fcc85d1468b7fa02b847389431fb (diff) | |
download | mana-dd2b559ea0d467db7fec522a63a66a82c1415b36.tar.gz mana-dd2b559ea0d467db7fec522a63a66a82c1415b36.tar.bz2 mana-dd2b559ea0d467db7fec522a63a66a82c1415b36.tar.xz mana-dd2b559ea0d467db7fec522a63a66a82c1415b36.zip |
Move path finding related code to the Map class and small fixes.
It permits two things:
1. It simplifies and demystifies Being::SetDestination() code.
2. It will permit to show the *real* calulated path when using
the drawDebugPath feature for ManaServ.
Diffstat (limited to 'src/map.h')
-rw-r--r-- | src/map.h | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -272,6 +272,23 @@ class Map : public Properties const std::string *getFilename() const; /** + * Check the current position against surrounding blocking tiles, and + * correct the position offset within tile when needed. + */ + Position checkNodeOffsets(int radius, unsigned char walkMask, + const Position &position) const; + Position checkNodeOffsets(int radius, unsigned char walkMask, + int x, int y) const + { return checkNodeOffsets(radius, walkMask, Position(x, y)); } + + /** + * Find a pixel path from one location to the next. + */ + Path findPixelPath(int startPixelX, int startPixelY, + int destPixelX, int destPixelY, + int radius, unsigned char walkmask, int maxCost = 20); + + /** * Find a path from one location to the next. */ Path findPath(int startX, int startY, int destX, int destY, |