summaryrefslogtreecommitdiff
path: root/src/tile_map.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-11-04 10:20:24 +0000
committerrubidium <rubidium@openttd.org>2011-11-04 10:20:24 +0000
commita36551dbb4a6aa8a10e99df8331ac4ecb8586270 (patch)
treef63714ceff46343e77309a9084758de39ca52b9b /src/tile_map.cpp
parent7757a2ed406996be35c7179185f2e4e7cba37e12 (diff)
downloadopenttd-a36551dbb4a6aa8a10e99df8331ac4ecb8586270.tar.xz
(svn r23092) -Codechange: create a non-pixel version of some of the Get*PixelZ functions, and let Get*PixelZ wrap around the new function (multiplying the Z by TILE_HEIGHT) just like TileHeight and TilePixelHeight
Diffstat (limited to 'src/tile_map.cpp')
-rw-r--r--src/tile_map.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/tile_map.cpp b/src/tile_map.cpp
index 9fbcfbb8a..6ac2db3dc 100644
--- a/src/tile_map.cpp
+++ b/src/tile_map.cpp
@@ -18,13 +18,13 @@
* @param h If not \c NULL, pointer to storage of z height
* @return Slope of the tile, except for the HALFTILE part
*/
-Slope GetTilePixelSlope(TileIndex tile, uint *h)
+Slope GetTileSlope(TileIndex tile, uint *h)
{
assert(tile < MapSize());
if (TileX(tile) == MapMaxX() || TileY(tile) == MapMaxY() ||
(_settings_game.construction.freeform_edges && (TileX(tile) == 0 || TileY(tile) == 0))) {
- if (h != NULL) *h = TileHeight(tile) * TILE_HEIGHT;
+ if (h != NULL) *h = TileHeight(tile);
return SLOPE_FLAT;
}
@@ -54,7 +54,7 @@ Slope GetTilePixelSlope(TileIndex tile, uint *h)
if ((d -= min) != 0) r += (--d << 4) + SLOPE_S;
if ((b -= min) != 0) r += (--b << 4) + SLOPE_W;
- if (h != NULL) *h = min * TILE_HEIGHT;
+ if (h != NULL) *h = min;
return (Slope)r;
}
@@ -64,7 +64,7 @@ Slope GetTilePixelSlope(TileIndex tile, uint *h)
* @param tile Tile to compute height of
* @return Minimum height of the tile
*/
-uint GetTilePixelZ(TileIndex tile)
+uint GetTileZ(TileIndex tile)
{
if (TileX(tile) == MapMaxX() || TileY(tile) == MapMaxY()) return 0;
@@ -73,7 +73,7 @@ uint GetTilePixelZ(TileIndex tile)
h = min(h, TileHeight(tile + TileDiffXY(0, 1))); // E corner
h = min(h, TileHeight(tile + TileDiffXY(1, 1))); // S corner
- return h * TILE_HEIGHT;
+ return h;
}
/**
@@ -81,7 +81,7 @@ uint GetTilePixelZ(TileIndex tile)
* @param t Tile to compute height of
* @return Maximum height of the tile
*/
-uint GetTileMaxPixelZ(TileIndex t)
+uint GetTileMaxZ(TileIndex t)
{
if (TileX(t) == MapMaxX() || TileY(t) == MapMaxY()) return 0;
@@ -90,5 +90,5 @@ uint GetTileMaxPixelZ(TileIndex t)
h = max(h, TileHeight(t + TileDiffXY(0, 1))); // E corner
h = max(h, TileHeight(t + TileDiffXY(1, 1))); // S corner
- return h * TILE_HEIGHT;
+ return h;
}