summaryrefslogtreecommitdiff
path: root/src/tile_map.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-11-04 11:30:37 +0000
committerrubidium <rubidium@openttd.org>2011-11-04 11:30:37 +0000
commit19eabdba2cf0184d5dc55cb3b9b8a7b5fe7ccfd3 (patch)
treee0fd85356bbcae38f6b50b8e7bc9470156b81e2d /src/tile_map.cpp
parent643c54d288e091adf386bacd3615991e24e8909f (diff)
downloadopenttd-19eabdba2cf0184d5dc55cb3b9b8a7b5fe7ccfd3.tar.xz
(svn r23106) -Codechange: pass int* to GetTileSlope and friends
Diffstat (limited to 'src/tile_map.cpp')
-rw-r--r--src/tile_map.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/tile_map.cpp b/src/tile_map.cpp
index 6ac2db3dc..a936b78e7 100644
--- a/src/tile_map.cpp
+++ b/src/tile_map.cpp
@@ -18,7 +18,7 @@
* @param h If not \c NULL, pointer to storage of z height
* @return Slope of the tile, except for the HALFTILE part
*/
-Slope GetTileSlope(TileIndex tile, uint *h)
+Slope GetTileSlope(TileIndex tile, int *h)
{
assert(tile < MapSize());
@@ -28,13 +28,13 @@ Slope GetTileSlope(TileIndex tile, uint *h)
return SLOPE_FLAT;
}
- uint a = TileHeight(tile); // Height of the N corner
- uint min = a; // Minimal height of all corners examined so far
- uint b = TileHeight(tile + TileDiffXY(1, 0)); // Height of the W corner
+ int a = TileHeight(tile); // Height of the N corner
+ int min = a; // Minimal height of all corners examined so far
+ int b = TileHeight(tile + TileDiffXY(1, 0)); // Height of the W corner
if (min > b) min = b;
- uint c = TileHeight(tile + TileDiffXY(0, 1)); // Height of the E corner
+ int c = TileHeight(tile + TileDiffXY(0, 1)); // Height of the E corner
if (min > c) min = c;
- uint d = TileHeight(tile + TileDiffXY(1, 1)); // Height of the S corner
+ int d = TileHeight(tile + TileDiffXY(1, 1)); // Height of the S corner
if (min > d) min = d;
/* Due to the fact that tiles must connect with each other without leaving gaps, the
@@ -64,11 +64,11 @@ Slope GetTileSlope(TileIndex tile, uint *h)
* @param tile Tile to compute height of
* @return Minimum height of the tile
*/
-uint GetTileZ(TileIndex tile)
+int GetTileZ(TileIndex tile)
{
if (TileX(tile) == MapMaxX() || TileY(tile) == MapMaxY()) return 0;
- uint h = TileHeight(tile); // N corner
+ int h = TileHeight(tile); // N corner
h = min(h, TileHeight(tile + TileDiffXY(1, 0))); // W corner
h = min(h, TileHeight(tile + TileDiffXY(0, 1))); // E corner
h = min(h, TileHeight(tile + TileDiffXY(1, 1))); // S corner
@@ -81,14 +81,14 @@ uint GetTileZ(TileIndex tile)
* @param t Tile to compute height of
* @return Maximum height of the tile
*/
-uint GetTileMaxZ(TileIndex t)
+int GetTileMaxZ(TileIndex t)
{
if (TileX(t) == MapMaxX() || TileY(t) == MapMaxY()) return 0;
- uint h = TileHeight(t); // N corner
- h = max(h, TileHeight(t + TileDiffXY(1, 0))); // W corner
- h = max(h, TileHeight(t + TileDiffXY(0, 1))); // E corner
- h = max(h, TileHeight(t + TileDiffXY(1, 1))); // S corner
+ int h = TileHeight(t); // N corner
+ h = max<int>(h, TileHeight(t + TileDiffXY(1, 0))); // W corner
+ h = max<int>(h, TileHeight(t + TileDiffXY(0, 1))); // E corner
+ h = max<int>(h, TileHeight(t + TileDiffXY(1, 1))); // S corner
return h;
}