summaryrefslogtreecommitdiff
path: root/src/resources/map
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-05-06 19:18:09 +0300
committerAndrei Karas <akaras@inbox.ru>2016-05-06 19:18:09 +0300
commitf3d00667c5a1bffa5a04d5e86676caca6979b58d (patch)
tree8c326bea9dfeee35670ad201f39818fc1a7765bc /src/resources/map
parentbbfe142ec3b7879bbd618f36367f95c030d65968 (diff)
downloadmanaverse-f3d00667c5a1bffa5a04d5e86676caca6979b58d.tar.gz
manaverse-f3d00667c5a1bffa5a04d5e86676caca6979b58d.tar.bz2
manaverse-f3d00667c5a1bffa5a04d5e86676caca6979b58d.tar.xz
manaverse-f3d00667c5a1bffa5a04d5e86676caca6979b58d.zip
Fix code style.
Diffstat (limited to 'src/resources/map')
-rw-r--r--src/resources/map/map.cpp4
-rw-r--r--src/resources/map/mapheights.cpp2
-rw-r--r--src/resources/map/maplayer.cpp4
-rw-r--r--src/resources/map/objectslayer.h2
-rw-r--r--src/resources/map/speciallayer.cpp4
-rw-r--r--src/resources/map/tileset.h6
-rw-r--r--src/resources/map/walklayer.cpp4
7 files changed, 12 insertions, 14 deletions
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<int>(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<int>(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<int>(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 <string>
-
#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<int>(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<int>(sizeof(Tileset));
const std::map<std::string, std::string>::const_iterator it_end =
mProperties.end();
std::map<std::string, std::string>::const_iterator it =
mProperties.begin();
while (it != it_end)
{
- sz += (*it).first.capacity() +
- (*it).second.capacity();
+ sz += static_cast<int>((*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<int>(sizeof(WalkLayer) +
+ sizeof(int) * mWidth * mHeight);
}