From f3d00667c5a1bffa5a04d5e86676caca6979b58d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 6 May 2016 19:18:09 +0300 Subject: Fix code style. --- src/resources/map/map.cpp | 4 ++-- src/resources/map/mapheights.cpp | 2 +- src/resources/map/maplayer.cpp | 4 ++-- src/resources/map/objectslayer.h | 2 -- src/resources/map/speciallayer.cpp | 4 ++-- src/resources/map/tileset.h | 6 +++--- src/resources/map/walklayer.cpp | 4 ++-- 7 files changed, 12 insertions(+), 14 deletions(-) (limited to 'src/resources/map') diff --git a/src/resources/map/map.cpp b/src/resources/map/map.cpp index 51bd7952c..ee4e0dc59 100644 --- a/src/resources/map/map.cpp +++ b/src/resources/map/map.cpp @@ -1701,7 +1701,7 @@ void Map::updateConditionLayers() restrict2 int Map::calcMemoryLocal() const { - return sizeof(Map) + + return static_cast(sizeof(Map) + mName.capacity() + sizeof(MetaTile) * mWidth * mHeight + sizeof(MapLayer*) * (mLayers.capacity() + @@ -1714,7 +1714,7 @@ int Map::calcMemoryLocal() const sizeof(ParticleEffectData) * mParticleEffects.capacity() + sizeof(MapItem) * mMapPortals.capacity() + (sizeof(TileAnimation) + sizeof(int)) * mTileAnimations.size() + - sizeof(Tileset*) * mIndexedTilesetsSize; + sizeof(Tileset*) * mIndexedTilesetsSize); } int Map::calcMemoryChilds(const int level) const diff --git a/src/resources/map/mapheights.cpp b/src/resources/map/mapheights.cpp index 5d5c30aa8..b785df72c 100644 --- a/src/resources/map/mapheights.cpp +++ b/src/resources/map/mapheights.cpp @@ -42,6 +42,6 @@ void MapHeights::setHeight(const int x, const int y, const uint8_t height) int MapHeights::calcMemoryLocal() const { - return sizeof(MapHeights) + + return static_cast(sizeof(MapHeights)) + mWidth * mHeight; } diff --git a/src/resources/map/maplayer.cpp b/src/resources/map/maplayer.cpp index 5d81cfb09..7ccf26396 100644 --- a/src/resources/map/maplayer.cpp +++ b/src/resources/map/maplayer.cpp @@ -749,9 +749,9 @@ void MapLayer::updateConditionTiles(MetaTile *const metaTiles, int MapLayer::calcMemoryLocal() const { - return sizeof(MapLayer) + + return static_cast(sizeof(MapLayer) + sizeof(TileInfo) * mWidth * mHeight + - sizeof(MapRowVertexes) * mTempRows.capacity(); + sizeof(MapRowVertexes) * mTempRows.capacity()); } int MapLayer::calcMemoryChilds(const int level) const diff --git a/src/resources/map/objectslayer.h b/src/resources/map/objectslayer.h index 09573a627..57e5dc1ff 100644 --- a/src/resources/map/objectslayer.h +++ b/src/resources/map/objectslayer.h @@ -23,8 +23,6 @@ #include "resources/memorycounter.h" -#include - #include "localconsts.h" class MapObjectList; diff --git a/src/resources/map/speciallayer.cpp b/src/resources/map/speciallayer.cpp index e57189d84..ddf5cc35e 100644 --- a/src/resources/map/speciallayer.cpp +++ b/src/resources/map/speciallayer.cpp @@ -154,6 +154,6 @@ void SpecialLayer::draw(Graphics *const graphics, int startX, int startY, int SpecialLayer::calcMemoryLocal() const { - return sizeof(SpecialLayer) + - sizeof(MapItem) * mWidth * mHeight; + return static_cast(sizeof(SpecialLayer) + + sizeof(MapItem) * mWidth * mHeight); } diff --git a/src/resources/map/tileset.h b/src/resources/map/tileset.h index c2f4a297c..93ff16c2d 100644 --- a/src/resources/map/tileset.h +++ b/src/resources/map/tileset.h @@ -77,15 +77,15 @@ class Tileset final : public ImageSet int calcMemoryLocal() const override final { int sz = ImageSet::calcMemoryLocal() + - sizeof(Tileset); + static_cast(sizeof(Tileset)); const std::map::const_iterator it_end = mProperties.end(); std::map::const_iterator it = mProperties.begin(); while (it != it_end) { - sz += (*it).first.capacity() + - (*it).second.capacity(); + sz += static_cast((*it).first.capacity() + + (*it).second.capacity()); ++ it; } return sz; diff --git a/src/resources/map/walklayer.cpp b/src/resources/map/walklayer.cpp index 7bc505f18..a52f75179 100644 --- a/src/resources/map/walklayer.cpp +++ b/src/resources/map/walklayer.cpp @@ -46,6 +46,6 @@ int WalkLayer::getDataAt(const int x, const int y) const int WalkLayer::calcMemoryLocal() const { return Resource::calcMemoryLocal() + - sizeof(WalkLayer) + - sizeof(int) * mWidth * mHeight; + static_cast(sizeof(WalkLayer) + + sizeof(int) * mWidth * mHeight); } -- cgit v1.2.3-70-g09d2