diff options
author | Philipp Sehmisch <crush@themanaworld.org> | 2009-08-16 17:47:51 +0200 |
---|---|---|
committer | Philipp Sehmisch <crush@themanaworld.org> | 2009-08-16 17:47:51 +0200 |
commit | e0ba8f7f67ddd08c54f0d453a316b3620d52529d (patch) | |
tree | 7324fa33f2c6af04067b77e0ce7f73d9effed1c6 /src/map.cpp | |
parent | 346d68307553c18777df4c49f9b3fe57955c5c0d (diff) | |
parent | 6460413ee2f50be561fd0824e3eaa9c2c09415b1 (diff) | |
download | mana-e0ba8f7f67ddd08c54f0d453a316b3620d52529d.tar.gz mana-e0ba8f7f67ddd08c54f0d453a316b3620d52529d.tar.bz2 mana-e0ba8f7f67ddd08c54f0d453a316b3620d52529d.tar.xz mana-e0ba8f7f67ddd08c54f0d453a316b3620d52529d.zip |
Merged changes from last month with a commit I forgot to commit before I went on vacation.
Diffstat (limited to 'src/map.cpp')
-rw-r--r-- | src/map.cpp | 49 |
1 files changed, 3 insertions, 46 deletions
diff --git a/src/map.cpp b/src/map.cpp index 61fcdfe8..dbecda3d 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -218,11 +218,12 @@ void Map::initializeOverlays() const float speedX = getFloatProperty(name + "scrollX"); const float speedY = getFloatProperty(name + "scrollY"); const float parallax = getFloatProperty(name + "parallax"); + const bool keepRatio = getBoolProperty(name + "keepratio"); if (img) { mOverlays.push_back( - new AmbientOverlay(img, parallax, speedX, speedY)); + new AmbientOverlay(img, parallax, speedX, speedY, keepRatio)); // The AmbientOverlay takes control over the image. img->decRef(); @@ -448,7 +449,7 @@ bool Map::occupied(int x, int y) const const Being *being = *i; // job 45 is a portal, they don't collide - if (being->mX == x && being->mY == y && being->mJob != 45) + if (being->getTileX() == x && being->getTileY() == y && being->mJob != 45) return true; } @@ -490,50 +491,6 @@ const std::string &Map::getName() const return getProperty("mapname"); } -Path Map::findSimplePath(int startX, int startY, - int destX, int destY, - unsigned char walkmask) -{ - // Path to be built up (empty by default) - Path path; - int positionX = startX, positionY = startY; - int directionX, directionY; - // Checks our path up to 1 tiles, if a blocking tile is found - // We go to the last good tile, and break out of the loop - while(true) - { - directionX = destX - positionX; - directionY = destY - positionY; - - if (directionX > 0) - directionX = 1; - else if(directionX < 0) - directionX = -1; - - if (directionY > 0) - directionY = 1; - else if(directionY < 0) - directionY = -1; - - positionX += directionX; - positionY += directionY; - - if (getWalk(positionX, positionY, walkmask)) - { - path.push_back(Position(positionX, positionY)); - - if ((positionX == destX) && (positionY == destY)) - { - return path; - } - } - else - { - return path; - } - } -} - static int const basicCost = 100; Path Map::findPath(int startX, int startY, int destX, int destY, |