summaryrefslogtreecommitdiff
path: root/road_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-08-06 16:32:49 +0000
committertron <tron@openttd.org>2006-08-06 16:32:49 +0000
commitd8b8035f9f17d7eadf6d40845d2afa60a16e92bb (patch)
treef588dd076c3c98d0c2983a7f5c9e5f5dcbc4447b /road_cmd.c
parentfb251d18e06591423739a2cac659a9f4511370b8 (diff)
downloadopenttd-d8b8035f9f17d7eadf6d40845d2afa60a16e92bb.tar.xz
(svn r5794) Pass the TileIndex plus x and y coordinates into GetSlopeZ_* instead of a TileInfo
Diffstat (limited to 'road_cmd.c')
-rw-r--r--road_cmd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/road_cmd.c b/road_cmd.c
index 4328aa277..e4a725711 100644
--- a/road_cmd.c
+++ b/road_cmd.c
@@ -833,20 +833,20 @@ void DrawRoadDepotSprite(int x, int y, DiagDirection dir)
}
}
-static uint GetSlopeZ_Road(const TileInfo* ti)
+static uint GetSlopeZ_Road(TileIndex tile, uint x, uint y)
{
- Slope tileh = ti->tileh;
- uint z = ti->z;
+ uint z;
+ Slope tileh = GetTileSlope(tile, &z);
if (tileh == SLOPE_FLAT) return z;
- if (GetRoadTileType(ti->tile) == ROAD_TILE_NORMAL) {
- uint f = GetRoadFoundation(tileh, GetRoadBits(ti->tile));
+ if (GetRoadTileType(tile) == ROAD_TILE_NORMAL) {
+ uint f = GetRoadFoundation(tileh, GetRoadBits(tile));
if (f != 0) {
if (f < 15) return z + TILE_HEIGHT; // leveled foundation
tileh = _inclined_tileh[f - 15]; // inclined foundation
}
- return z + GetPartialZ(ti->x & 0xF, ti->y & 0xF, tileh);
+ return z + GetPartialZ(x & 0xF, y & 0xF, tileh);
} else {
return z + TILE_HEIGHT;
}