summaryrefslogtreecommitdiff
path: root/src/map.h
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-04-26 23:40:37 +0200
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-04-26 23:40:37 +0200
commit2d0e84449b14615bdacb6f897791628662bbfd39 (patch)
tree08019ae6c24c6da25e25da027d04ad008c25d6a2 /src/map.h
parent42605753159d7b63276351311e0fd43874a3366b (diff)
parent0056412ed33b941d72a175dcd3f025abcd8fc02b (diff)
downloadmana-client-2d0e84449b14615bdacb6f897791628662bbfd39.tar.gz
mana-client-2d0e84449b14615bdacb6f897791628662bbfd39.tar.bz2
mana-client-2d0e84449b14615bdacb6f897791628662bbfd39.tar.xz
mana-client-2d0e84449b14615bdacb6f897791628662bbfd39.zip
Made the client use a unique kind of movement code.
This is fixng many issues and (hopefully) will make the movement rendering much smoother. Merge branch 'master' of gitorious.org:~bertram/mana/mana-movement-code-merge Conflicts: src/being.cpp src/net/manaserv/beinghandler.cpp Resolves: TMW-Mantis #946. Reviewed-by: Thorbjorn.
Diffstat (limited to 'src/map.h')
-rw-r--r--src/map.h29
1 files changed, 22 insertions, 7 deletions
diff --git a/src/map.h b/src/map.h
index cfc0b7ef..67135a99 100644
--- a/src/map.h
+++ b/src/map.h
@@ -258,6 +258,14 @@ class Map : public Properties
int getTileHeight() const
{ return mTileHeight; }
+ /**
+ * Returns the tile center position in pixel coordinates.
+ *
+ * @param x the horizontal tile position
+ * @param y the vertical tile position
+ */
+ Vector getTileCenter(int x, int y);
+
const std::string getMusicFile() const;
const std::string getName() const;
@@ -277,17 +285,19 @@ class Map : public Properties
{ return checkNodeOffsets(radius, walkMask, Position(x, y)); }
/**
- * Find a pixel path from one location to the next.
+ * Find a tile-centered path in pixel coordinates
+ * from one location to the next.
*/
- Path findPixelPath(int startPixelX, int startPixelY,
- int destPixelX, int destPixelY,
- int radius, unsigned char walkmask, int maxCost = 20);
+ Path findTilePath(int startPixelX, int startPixelY, int endPixelX,
+ int endPixelY, unsigned char walkMask,
+ int maxCost = 20);
/**
- * Find a path from one location to the next.
+ * Find a pixel path from one location to the next using free offsets.
*/
- Path findPath(int startX, int startY, int destX, int destY,
- unsigned char walkmask, int maxCost = 20);
+ Path findPixelPath(int startPixelX, int startPixelY,
+ int destPixelX, int destPixelY,
+ int radius, unsigned char walkmask, int maxCost = 20);
/**
* Adds a particle effect
@@ -328,6 +338,11 @@ class Map : public Properties
void removeActor(Actors::iterator iterator);
private:
+ /**
+ * Find a path from one location to the next in tile coordinates.
+ */
+ Path findPath(int startX, int startY, int destX, int destY,
+ unsigned char walkmask, int maxCost = 20);
enum LayerType
{