summaryrefslogtreecommitdiff
path: root/src/tile.c
diff options
context:
space:
mode:
authorKUDr <kudr@openttd.org>2007-01-10 18:12:09 +0000
committerKUDr <kudr@openttd.org>2007-01-10 18:12:09 +0000
commite373ea7096c741a8189f7a480863fd21dd6f6be1 (patch)
treed9abc3d9810159441bed9f82a52bd1ee52d770dd /src/tile.c
parent001d858b528d78743deaf7dcea46ea8f0736bad9 (diff)
downloadopenttd-e373ea7096c741a8189f7a480863fd21dd6f6be1.tar.xz
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
Diffstat (limited to 'src/tile.c')
-rw-r--r--src/tile.c63
1 files changed, 0 insertions, 63 deletions
diff --git a/src/tile.c b/src/tile.c
deleted file mode 100644
index ba6900a36..000000000
--- a/src/tile.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/* $Id$ */
-
-#include "stdafx.h"
-#include "tile.h"
-
-Slope GetTileSlope(TileIndex tile, uint *h)
-{
- uint a;
- uint b;
- uint c;
- uint d;
- uint min;
- uint r;
-
- assert(tile < MapSize());
-
- if (TileX(tile) == MapMaxX() || TileY(tile) == MapMaxY()) {
- if (h != NULL) *h = 0;
- return 0;
- }
-
- min = a = TileHeight(tile);
- b = TileHeight(tile + TileDiffXY(1, 0));
- if (min >= b) min = b;
- c = TileHeight(tile + TileDiffXY(0, 1));
- if (min >= c) min = c;
- d = TileHeight(tile + TileDiffXY(1, 1));
- if (min >= d) min = d;
-
- r = SLOPE_FLAT;
- if ((a -= min) != 0) r += (--a << 4) + SLOPE_N;
- if ((c -= min) != 0) r += (--c << 4) + SLOPE_E;
- 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;
-
- return r;
-}
-
-uint GetTileZ(TileIndex tile)
-{
- uint h;
- GetTileSlope(tile, &h);
- return h;
-}
-
-
-uint GetTileMaxZ(TileIndex t)
-{
- uint max;
- uint h;
-
- h = TileHeight(t);
- max = h;
- h = TileHeight(t + TileDiffXY(1, 0));
- if (h > max) max = h;
- h = TileHeight(t + TileDiffXY(0, 1));
- if (h > max) max = h;
- h = TileHeight(t + TileDiffXY(1, 1));
- if (h > max) max = h;
- return max * 8;
-}