diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-03-18 17:48:29 +0200 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-03-18 17:49:00 +0200 |
commit | f98d003e354a1792117b7cbc771d1dd91475a156 (patch) | |
tree | dc2a297f7c4026394c9954ae4bfd4abd22ef9612 /src/map.cpp | |
parent | bb0a6cb25b2985fd1f74c9d27d5a46f6863e2dee (diff) | |
download | ManaVerse-f98d003e354a1792117b7cbc771d1dd91475a156.tar.gz ManaVerse-f98d003e354a1792117b7cbc771d1dd91475a156.tar.bz2 ManaVerse-f98d003e354a1792117b7cbc771d1dd91475a156.tar.xz ManaVerse-f98d003e354a1792117b7cbc771d1dd91475a156.zip |
Fix most old style cast except manaserv and libxml2 defines.
Diffstat (limited to 'src/map.cpp')
-rw-r--r-- | src/map.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/map.cpp b/src/map.cpp index c5cd1e3b5..9557d7b79 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -119,7 +119,7 @@ MapLayer::MapLayer(int x, int y, int width, int height, bool isFringeLayer): const int size = mWidth * mHeight; mTiles = new Image*[size]; - std::fill_n(mTiles, size, (Image*) 0); + std::fill_n(mTiles, size, static_cast<Image*>(0)); config.addListener("highlightAttackRange", this); } @@ -951,9 +951,9 @@ Path Map::findPixelPath(int startPixelX, int startPixelY, int endPixelX, float endOffsetY = static_cast<float>(endPixelY % 32); // Find the distance, and divide it by the number of steps - int changeX = (int)((endOffsetX - startOffsetX) + int changeX = static_cast<int>((endOffsetX - startOffsetX) / static_cast<float>(myPath.size())); - int changeY = (int)((endOffsetY - startOffsetY) + int changeY = static_cast<int>((endOffsetY - startOffsetY) / static_cast<float>(myPath.size())); // Convert the map path to pixels over tiles @@ -1323,8 +1323,9 @@ void Map::saveExtraLayer() if (item && item->mType != MapItem::EMPTY && item->mType != MapItem::HOME) { - mapFile << x << " " << y << " " << (int)item->mType - << " " << item->mComment << std::endl; + mapFile << x << " " << y << " " + << static_cast<int>(item->mType) << " " + << item->mComment << std::endl; } } } @@ -1434,7 +1435,7 @@ SpecialLayer::SpecialLayer(int width, int height, bool drawSprites): { const int size = mWidth * mHeight; mTiles = new MapItem*[size]; - std::fill_n(mTiles, size, (MapItem*) 0); + std::fill_n(mTiles, size, static_cast<MapItem*>(0)); mDrawSprites = drawSprites; } |