summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-03-22 19:16:58 +0000
committertron <tron@openttd.org>2006-03-22 19:16:58 +0000
commit337cdcc31fca98adcdcc21b729deb44c6974ed05 (patch)
tree588d8c9de3c80157dc2df25dbd792b9ee05bdaae
parente8f5d89712143b437ec03932283a3b6dec0fdb04 (diff)
downloadopenttd-337cdcc31fca98adcdcc21b729deb44c6974ed05.tar.xz
(svn r4028) The last external user of FindLandscapeHeightByTile() is gone (r4027).
Move its implementation into its only caller - FindLandscapeHeight() - and remove it
-rw-r--r--functions.h1
-rw-r--r--landscape.c20
2 files changed, 7 insertions, 14 deletions
diff --git a/functions.h b/functions.h
index f5ba1b6ba..2f325d911 100644
--- a/functions.h
+++ b/functions.h
@@ -5,7 +5,6 @@
/* landscape.c */
void FindLandscapeHeight(TileInfo *ti, uint x, uint y);
-void FindLandscapeHeightByTile(TileInfo *ti, TileIndex tile);
void DoClearSquare(TileIndex tile);
void CDECL ModifyTile(TileIndex tile, uint flags, ...);
diff --git a/landscape.c b/landscape.c
index a63c4b866..85aa36665 100644
--- a/landscape.c
+++ b/landscape.c
@@ -55,16 +55,6 @@ const byte _inclined_tileh[] = {
};
-void FindLandscapeHeightByTile(TileInfo *ti, TileIndex tile)
-{
- assert(tile < MapSize());
-
- ti->tile = tile;
- ti->map5 = _m[tile].m5;
- ti->type = GetTileType(tile);
- ti->tileh = GetTileSlope(tile, &ti->z);
-}
-
/* find the landscape height for the coordinates x y */
void FindLandscapeHeight(TileInfo *ti, uint x, uint y)
{
@@ -77,10 +67,14 @@ void FindLandscapeHeight(TileInfo *ti, uint x, uint y)
ti->tile = 0;
ti->map5 = 0;
ti->z = 0;
- return;
- }
+ } else {
+ TileIndex tile = TileVirtXY(x, y);
- FindLandscapeHeightByTile(ti, TileVirtXY(x, y));
+ ti->tile = tile;
+ ti->type = GetTileType(tile);
+ ti->map5 = _m[tile].m5;
+ ti->tileh = GetTileSlope(tile, &ti->z);
+ }
}
uint GetPartialZ(int x, int y, int corners)