From 030beaba34912a9249b9219b43c7bdc1359859e6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 6 Jan 2017 20:19:20 +0300 Subject: Fix code style. --- src/being/localplayer.cpp | 2 +- src/gui/cliprect.h | 4 ++-- src/gui/colorpair.h | 2 +- src/gui/rect.h | 6 +++--- src/resources/dye/dyepalette_replaceaoglcolor.cpp | 2 -- src/resources/map/map.cpp | 2 +- src/resources/map/maplayer.cpp | 6 +----- src/resources/map/maplayer_unittest.cc | 4 ---- src/resources/map/speciallayer.h | 4 ++-- 9 files changed, 11 insertions(+), 21 deletions(-) diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index 90a2e9efa..0bc0e51ed 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -2555,9 +2555,9 @@ void LocalPlayer::setRealPos(const int x, const int y) return; SpecialLayer *const layer = mMap->getTempLayer(); - bool cacheUpdated(false); if (layer) { + bool cacheUpdated(false); if ((mCrossX || mCrossY) && layer->getTile(mCrossX, mCrossY) && layer->getTile(mCrossX, mCrossY)->getType() == MapItemType::CROSS) diff --git a/src/gui/cliprect.h b/src/gui/cliprect.h index bb8a1257e..149420b8c 100644 --- a/src/gui/cliprect.h +++ b/src/gui/cliprect.h @@ -80,7 +80,7 @@ class ClipRect final : public Rect /** * Constructor. */ - constexpr ClipRect() : + ClipRect() : Rect(0, 0, 0, 0), xOffset(0), yOffset(0) @@ -101,7 +101,7 @@ class ClipRect final : public Rect * calculating the actual screen coordinate from * the relative screen coordinate. */ - constexpr ClipRect(const int x0, + ClipRect(const int x0, const int y0, const int width0, const int height0, diff --git a/src/gui/colorpair.h b/src/gui/colorpair.h index 29981bd60..d4ef13656 100644 --- a/src/gui/colorpair.h +++ b/src/gui/colorpair.h @@ -28,7 +28,7 @@ class Color; struct ColorPair final { constexpr ColorPair(const Color *const c1, - const Color *const c2) : + const Color *const c2) : color1(c1), color2(c2) { diff --git a/src/gui/rect.h b/src/gui/rect.h index 994886e92..303781354 100644 --- a/src/gui/rect.h +++ b/src/gui/rect.h @@ -93,9 +93,9 @@ class Rect notfinal * @param height_ The height of the rectangle. */ constexpr Rect(const int x_, - const int y_, - const int width_, - const int height_) : + const int y_, + const int width_, + const int height_) : x(x_), y(y_), width(width_), diff --git a/src/resources/dye/dyepalette_replaceaoglcolor.cpp b/src/resources/dye/dyepalette_replaceaoglcolor.cpp index 0b87d675b..16b54a666 100644 --- a/src/resources/dye/dyepalette_replaceaoglcolor.cpp +++ b/src/resources/dye/dyepalette_replaceaoglcolor.cpp @@ -54,8 +54,6 @@ void DyePalette::replaceAOGLColorDefault(uint32_t *restrict pixels, #include "resources/dye/dyepalette_replaceaoglcolor_default.hpp" } - - #ifdef SIMD_SUPPORTED /* static void print256(const char *const text, const __m256i &val); diff --git a/src/resources/map/map.cpp b/src/resources/map/map.cpp index c4a4e7fa8..6070a137b 100644 --- a/src/resources/map/map.cpp +++ b/src/resources/map/map.cpp @@ -963,7 +963,7 @@ Path Map::findPath(const int startX, const int startY, ? basicCost : basicCost2); /* Demote an arbitrary direction to speed pathfinding by - adding a defect + adding a defect Important: as long as the total defect along any path is less than the basicCost, the pathfinder will still find one of the shortest paths! */ diff --git a/src/resources/map/maplayer.cpp b/src/resources/map/maplayer.cpp index 0780cd8d1..74d5cacde 100644 --- a/src/resources/map/maplayer.cpp +++ b/src/resources/map/maplayer.cpp @@ -170,17 +170,13 @@ void MapLayer::draw(Graphics *const graphics, } const int x32 = x * mapTileSize; - int c = 0; const Image *const img = tilePtr->image; const int px = x32 + dx; const int py = py0 - img->mBounds.h; if (mSpecialFlag || img->mBounds.h <= mapTileSize) { - // here need not draw over player position - c = tilePtr->count; - - if (c == 0) + if (tilePtr->count == 0) { graphics->drawImage(img, px, py); } diff --git a/src/resources/map/maplayer_unittest.cc b/src/resources/map/maplayer_unittest.cc index 184afce1d..2cfe7a0f5 100644 --- a/src/resources/map/maplayer_unittest.cc +++ b/src/resources/map/maplayer_unittest.cc @@ -528,8 +528,6 @@ TEST_CASE("MapLayer updateCache") Image *const img2 = new Image(32, 32); Image *const img3 = new Image(32, 32); MapLayer *layer = nullptr; - int width; - int nextTile; SECTION("simple 1") { @@ -893,8 +891,6 @@ TEST_CASE("MapLayer updateConditionTiles") Image *const img1 = new Image(32, 32); Map *map = nullptr; MapLayer *layer = nullptr; - int width; - int nextTile; SECTION("simple 1") { diff --git a/src/resources/map/speciallayer.h b/src/resources/map/speciallayer.h index d71f1dab3..f418aec7c 100644 --- a/src/resources/map/speciallayer.h +++ b/src/resources/map/speciallayer.h @@ -68,8 +68,8 @@ class SpecialLayer final : public MemoryCounter private: const std::string mName; - MapItem **mTiles __attribute__((packed)); - int *mCache __attribute__((packed)); + MapItem **mTiles; + int *mCache; int mWidth; int mHeight; }; -- cgit v1.2.3-60-g2f50