diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-06-06 00:04:33 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-06-06 00:04:33 +0300 |
commit | 7b155f111daf5d7ae477b16d0f0789b1113bea74 (patch) | |
tree | 2d2711ab1f9daed793171383af1a7e1fa6ff737c /src/maplayer.cpp | |
parent | c3afff20d4989ab2835545715bbe67e5b5d9b353 (diff) | |
download | manaverse-7b155f111daf5d7ae477b16d0f0789b1113bea74.tar.gz manaverse-7b155f111daf5d7ae477b16d0f0789b1113bea74.tar.bz2 manaverse-7b155f111daf5d7ae477b16d0f0789b1113bea74.tar.xz manaverse-7b155f111daf5d7ae477b16d0f0789b1113bea74.zip |
Fix some issues after auto checking.
Diffstat (limited to 'src/maplayer.cpp')
-rw-r--r-- | src/maplayer.cpp | 12 |
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() |