summaryrefslogtreecommitdiff
path: root/src/maplayer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-06-06 00:04:33 +0300
committerAndrei Karas <akaras@inbox.ru>2012-06-06 00:04:33 +0300
commit7b155f111daf5d7ae477b16d0f0789b1113bea74 (patch)
tree2d2711ab1f9daed793171383af1a7e1fa6ff737c /src/maplayer.cpp
parentc3afff20d4989ab2835545715bbe67e5b5d9b353 (diff)
downloadplus-7b155f111daf5d7ae477b16d0f0789b1113bea74.tar.gz
plus-7b155f111daf5d7ae477b16d0f0789b1113bea74.tar.bz2
plus-7b155f111daf5d7ae477b16d0f0789b1113bea74.tar.xz
plus-7b155f111daf5d7ae477b16d0f0789b1113bea74.zip
Fix some issues after auto checking.
Diffstat (limited to 'src/maplayer.cpp')
-rw-r--r--src/maplayer.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/maplayer.cpp b/src/maplayer.cpp
index 28976e099..52b43ac4b 100644
--- a/src/maplayer.cpp
+++ b/src/maplayer.cpp
@@ -43,12 +43,10 @@ MapLayer::MapLayer(int x, int y, int width, int height, bool fringeLayer):
mX(x), mY(y),
mWidth(width), mHeight(height),
mIsFringeLayer(fringeLayer),
- mHighlightAttackRange(config.getBoolValue("highlightAttackRange"))
+ mHighlightAttackRange(config.getBoolValue("highlightAttackRange")),
+ mTiles(new Image*[mWidth * mHeight])
{
- const int size = mWidth * mHeight;
- mTiles = new Image*[size];
-
- std::fill_n(mTiles, size, static_cast<Image*>(nullptr));
+ std::fill_n(mTiles, mWidth * mHeight, static_cast<Image*>(nullptr));
config.addListener("highlightAttackRange", this);
}
@@ -520,12 +518,12 @@ int MapLayer::getTileDrawWidth(Image *img, int endX, int &width) const
}
SpecialLayer::SpecialLayer(int width, int height, bool drawSprites):
- mWidth(width), mHeight(height)
+ mWidth(width), mHeight(height),
+ mDrawSprites(drawSprites)
{
const int size = mWidth * mHeight;
mTiles = new MapItem*[size];
std::fill_n(mTiles, size, static_cast<MapItem*>(nullptr));
- mDrawSprites = drawSprites;
}
SpecialLayer::~SpecialLayer()