diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-03-12 13:32:49 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-03-17 14:53:41 +0300 |
commit | 8571843f1405e676142e7bb289f9879d10a888ed (patch) | |
tree | e414c90b31979372220fa5c78f9ebb6cc05cd024 /src/map.cpp | |
parent | 3d8682618f0b46a334f9db5dd0c780f671e7f072 (diff) | |
download | manaverse-8571843f1405e676142e7bb289f9879d10a888ed.tar.gz manaverse-8571843f1405e676142e7bb289f9879d10a888ed.tar.bz2 manaverse-8571843f1405e676142e7bb289f9879d10a888ed.tar.xz manaverse-8571843f1405e676142e7bb289f9879d10a888ed.zip |
add walkmaps support.
Fast detecting between two targets is they in same walkable area.
Diffstat (limited to 'src/map.cpp')
-rw-r--r-- | src/map.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/map.cpp b/src/map.cpp index db2a46ef8..8ce96bdc5 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -30,6 +30,7 @@ #include "particle.h" #include "simpleanimation.h" #include "tileset.h" +#include "walklayer.h" #include "resources/ambientlayer.h" #include "resources/image.h" @@ -126,6 +127,7 @@ Map::Map(const int width, const int height, mTileWidth(tileWidth), mTileHeight(tileHeight), mMaxTileHeight(height), mMetaTiles(new MetaTile[mWidth * mHeight]), + mWalkLayer(nullptr), mHasWarps(false), mDebugFlags(MAP_NORMAL), mOnClosedList(1), mOnOpenList(2), @@ -187,6 +189,11 @@ Map::~Map() for (int i = 0; i < NB_BLOCKTYPES; i++) delete [] mOccupation[i]; + if (mWalkLayer) + { + mWalkLayer->decRef(); + mWalkLayer = nullptr; + } mFringeLayer = nullptr; delete_all(mLayers); delete_all(mTilesets); |