summaryrefslogtreecommitdiff
path: root/viewport.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-08-07 17:32:29 +0000
committertron <tron@openttd.org>2006-08-07 17:32:29 +0000
commit82ccd019140190ce1f6bc0fb1179598be65b0116 (patch)
tree0b0bb34300c1cdebbcd9dc9c32903f328b4a19b9 /viewport.c
parent33697a9aef83787ba259d40a926cd4f892159f51 (diff)
downloadopenttd-82ccd019140190ce1f6bc0fb1179598be65b0116.tar.xz
(svn r5806) Inline FindLandscapeHeight() into its only remaining caller and remove the attribute "type" from struct TileInfo
Diffstat (limited to 'viewport.c')
-rw-r--r--viewport.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/viewport.c b/viewport.c
index 200098188..ed22304ce 100644
--- a/viewport.c
+++ b/viewport.c
@@ -707,7 +707,24 @@ static void ViewportAddLandscape(void)
int y_cur = y;
do {
- FindLandscapeHeight(&ti, x_cur, y_cur);
+ TileType tt;
+
+ ti.x = x_cur;
+ ti.y = y_cur;
+ if (0 <= x_cur && x_cur < (int)MapMaxX() * TILE_SIZE &&
+ 0 <= y_cur && y_cur < (int)MapMaxY() * TILE_SIZE) {
+ TileIndex tile = TileVirtXY(x_cur, y_cur);
+
+ ti.tile = tile;
+ ti.tileh = GetTileSlope(tile, &ti.z);
+ tt = GetTileType(tile);
+ } else {
+ ti.tileh = SLOPE_FLAT;
+ ti.tile = 0;
+ ti.z = 0;
+ tt = MP_VOID;
+ }
+
#if !defined(NEW_ROTATION)
y_cur += 0x10;
x_cur -= 0x10;
@@ -718,7 +735,7 @@ static void ViewportAddLandscape(void)
_added_tile_sprite = false;
_offset_ground_sprites = false;
- DrawTile(&ti);
+ _tile_type_procs[tt]->draw_tile_proc(&ti);
DrawTileSelection(&ti);
} while (--width_cur);