summaryrefslogtreecommitdiff
path: root/src/resources/map/map.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-07 16:18:13 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-07 16:18:13 +0300
commit9fe21fcd8883b37bdc30224822e6e42afb35b8f0 (patch)
tree798117abd4dc7e610997d59d530a96ddc1509f53 /src/resources/map/map.cpp
parent4429cb14e9e187edef27aba692a4266733f79c17 (diff)
downloadmanaplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.gz
manaplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.bz2
manaplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.xz
manaplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.zip
Replace most static_cast<Type> to shorter versions from defines.
Diffstat (limited to 'src/resources/map/map.cpp')
-rw-r--r--src/resources/map/map.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/resources/map/map.cpp b/src/resources/map/map.cpp
index cb5d67583..51bb90f9d 100644
--- a/src/resources/map/map.cpp
+++ b/src/resources/map/map.cpp
@@ -1207,7 +1207,7 @@ void Map::saveExtraLayer() const restrict2
&& item->mType != MapItemType::HOME)
{
mapFile << x << " " << y << " "
- << static_cast<int>(item->mType) << " "
+ << CAST_S32(item->mType) << " "
<< item->mComment << std::endl;
}
}
@@ -1365,8 +1365,8 @@ void Map::indexTilesets() restrict2
FOR_EACH (Tilesets::const_iterator, it, mTilesets)
{
const size_t sz = (*it)->size();
- if (!s || static_cast<size_t>(s->getFirstGid()) + sSz
- < static_cast<size_t>((*it)->getFirstGid()) + sz)
+ if (!s || CAST_SIZE(s->getFirstGid()) + sSz
+ < CAST_SIZE((*it)->getFirstGid()) + sz)
{
s = *it;
sSz = sz;
@@ -1379,10 +1379,10 @@ void Map::indexTilesets() restrict2
return;
}
- const int size = static_cast<int>(s->getFirstGid())
- + static_cast<int>(s->size());
+ const int size = CAST_S32(s->getFirstGid())
+ + CAST_S32(s->size());
mIndexedTilesetsSize = size;
- mIndexedTilesets = new Tileset*[static_cast<size_t>(size)];
+ mIndexedTilesets = new Tileset*[CAST_SIZE(size)];
std::fill_n(mIndexedTilesets, size, static_cast<Tileset*>(nullptr));
FOR_EACH (Tilesets::const_iterator, it, mTilesets)
@@ -1391,7 +1391,7 @@ void Map::indexTilesets() restrict2
if (s2)
{
const int start = s2->getFirstGid();
- const int end = start + static_cast<int>(s2->size());
+ const int end = start + CAST_S32(s2->size());
for (int f = start; f < end; f ++)
{
if (f < size)
@@ -1546,7 +1546,7 @@ void Map::reduce() restrict2
++ ri;
continue;
}
- const size_t pos = static_cast<size_t>(
+ const size_t pos = CAST_SIZE(
x + y * layer2->mWidth);
img = layer2->mTiles[pos].image;
if (img)