summaryrefslogtreecommitdiff
path: root/landscape.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-08-10 14:44:32 +0000
committertron <tron@openttd.org>2006-08-10 14:44:32 +0000
commit5f943a4ba7a754dfd1136b232608b0a31e443ceb (patch)
treef0019d1ff7a97f3f447d9e52ade98bd94a777737 /landscape.c
parent4ccdb04cd3470b4823e1ca66ceb9dd4271a08641 (diff)
downloadopenttd-5f943a4ba7a754dfd1136b232608b0a31e443ceb.tar.xz
(svn r5833) -Feature: Allow building of (certain) rails, roads and bridge ramps on steep sloped tiles
Diffstat (limited to 'landscape.c')
-rw-r--r--landscape.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/landscape.c b/landscape.c
index 46fc11bcd..8f6289888 100644
--- a/landscape.c
+++ b/landscape.c
@@ -214,6 +214,17 @@ void DrawFoundation(TileInfo *ti, uint f)
OffsetGroundSprite(31, 1);
} else {
// inclined foundation
+ if (IsSteepSlope(ti->tileh)) {
+ uint32 lower_base;
+
+ // Lower part of foundation
+ lower_base = sprite_base;
+ if (lower_base == SPR_SLOPES_BASE - 15) lower_base = SPR_FOUNDATION_BASE;
+ AddSortableSpriteToDraw(
+ lower_base + (ti->tileh & ~SLOPE_STEEP), ti->x, ti->y, 16, 16, 7, ti->z
+ );
+ ti->z += TILE_HEIGHT;
+ }
AddSortableSpriteToDraw(sprite_base + f, ti->x, ti->y, 16, 16, 1, ti->z);
ti->tileh = _inclined_tileh[f - 15];
OffsetGroundSprite(31, 9);