From e373ea7096c741a8189f7a480863fd21dd6f6be1 Mon Sep 17 00:00:00 2001 From: KUDr Date: Wed, 10 Jan 2007 18:12:09 +0000 Subject: (svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp) --- src/tile.c | 63 -------------------------------------------------------------- 1 file changed, 63 deletions(-) delete mode 100644 src/tile.c (limited to 'src/tile.c') 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; -} -- cgit v1.2.3-70-g09d2