From 7b155f111daf5d7ae477b16d0f0789b1113bea74 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 6 Jun 2012 00:04:33 +0300 Subject: Fix some issues after auto checking. --- src/maplayer.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/maplayer.cpp') 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(nullptr)); + std::fill_n(mTiles, mWidth * mHeight, static_cast(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(nullptr)); - mDrawSprites = drawSprites; } SpecialLayer::~SpecialLayer() -- cgit v1.2.3-60-g2f50