diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-07-28 20:11:47 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-07-28 20:11:47 +0300 |
commit | 441a90b599613813f97f85537b7a05e628fba4cb (patch) | |
tree | 884b469df7eb5f0f48d773d60d18022837d81fb5 | |
parent | 71ed8b67e2988e4452dde73643e8b609dc0a64cf (diff) | |
download | manaplus-441a90b599613813f97f85537b7a05e628fba4cb.tar.gz manaplus-441a90b599613813f97f85537b7a05e628fba4cb.tar.bz2 manaplus-441a90b599613813f97f85537b7a05e628fba4cb.tar.xz manaplus-441a90b599613813f97f85537b7a05e628fba4cb.zip |
move bools in maplayer.
-rw-r--r-- | src/maplayer.cpp | 38 | ||||
-rw-r--r-- | src/maplayer.h | 19 |
2 files changed, 39 insertions, 18 deletions
diff --git a/src/maplayer.cpp b/src/maplayer.cpp index af1a6c165..980a9a786 100644 --- a/src/maplayer.cpp +++ b/src/maplayer.cpp @@ -45,12 +45,12 @@ MapLayer::MapLayer(const int x, const int y, const int width, const int height, mY(y), mWidth(width), mHeight(height), - mIsFringeLayer(fringeLayer), - mHighlightAttackRange(config.getBoolValue("highlightAttackRange")), mTiles(new Image*[mWidth * mHeight]), mSpecialLayer(nullptr), mTempLayer(nullptr), - mTempRows() + mTempRows(), + mIsFringeLayer(fringeLayer), + mHighlightAttackRange(config.getBoolValue("highlightAttackRange")) { std::fill_n(mTiles, mWidth * mHeight, static_cast<Image*>(nullptr)); @@ -558,8 +558,8 @@ SpecialLayer::SpecialLayer(const int width, const int height, const bool drawSprites) : mWidth(width), mHeight(height), - mDrawSprites(drawSprites), - mTiles(new MapItem*[mWidth * mHeight]) + mTiles(new MapItem*[mWidth * mHeight]), + mDrawSprites(drawSprites) { std::fill_n(mTiles, mWidth * mHeight, static_cast<MapItem*>(nullptr)); } @@ -676,26 +676,46 @@ void SpecialLayer::draw(Graphics *const graphics, int startX, int startY, } MapItem::MapItem(): - mType(EMPTY), mImage(nullptr), mComment(""), mName(""), mX(-1), mY(-1) + mImage(nullptr), + mComment(), + mName(), + mType(EMPTY), + mX(-1), + mY(-1) { setType(EMPTY); } MapItem::MapItem(const int type): - mType(type), mImage(nullptr), mComment(""), mName(""), mX(-1), mY(-1) + mImage(nullptr), + mComment(), + mName(), + mType(type), + mX(-1), + mY(-1) { setType(type); } MapItem::MapItem(const int type, std::string comment): - mType(type), mImage(nullptr), mComment(comment), mName(""), mX(-1), mY(-1) + mImage(nullptr), + mComment(comment), + mName(), + mType(type), + mX(-1), + mY(-1) { setType(type); } MapItem::MapItem(const int type, std::string comment, const int x, const int y): - mType(type), mImage(nullptr), mComment(comment), mName(""), mX(x), mY(y) + mImage(nullptr), + mComment(comment), + mName(), + mType(type), + mX(x), + mY(y) { setType(type); } diff --git a/src/maplayer.h b/src/maplayer.h index 952dd6785..b36ab0cc7 100644 --- a/src/maplayer.h +++ b/src/maplayer.h @@ -173,17 +173,17 @@ class MapLayer final: public ConfigListener const int endX, int &width) const A_WARN_UNUSED; private: - int mX, mY; - int mWidth, mHeight; - bool mIsFringeLayer; /**< Whether the actors are drawn. */ - bool mHighlightAttackRange; + int mX; + int mY; + int mWidth; + int mHeight; Image **mTiles; -// int *mTilesWidth; -// int *mTilesCount; SpecialLayer *mSpecialLayer; SpecialLayer *mTempLayer; typedef std::vector<MapRowVertexes*> MapRows; MapRows mTempRows; + bool mIsFringeLayer; /**< Whether the actors are drawn. */ + bool mHighlightAttackRange; }; class SpecialLayer final @@ -214,9 +214,10 @@ class SpecialLayer final void clean() const; private: - int mWidth, mHeight; - bool mDrawSprites; + int mWidth; + int mHeight; MapItem **mTiles; + bool mDrawSprites; }; class MapItem final @@ -286,10 +287,10 @@ class MapItem final const int dx, const int dy) const; private: - int mType; Image *mImage; std::string mComment; std::string mName; + int mType; int mX; int mY; }; |