summaryrefslogtreecommitdiff
path: root/src/landscape.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2008-06-12 21:36:56 +0000
committerfrosch <frosch@openttd.org>2008-06-12 21:36:56 +0000
commit79ad51867aa9551a8e9a85bdc3eff5ff760837b2 (patch)
treea1c6142c85a2edeaeb243c5a5f20cc704bf643ed /src/landscape.cpp
parent7dcc69e617ef3630f12371af5bf3d148928ca9b1 (diff)
downloadopenttd-79ad51867aa9551a8e9a85bdc3eff5ff760837b2.tar.xz
(svn r13499) -Codechange: Allow drawing (ugly) leveled foundations on steep slopes, just in case someone needs them for fallback.
Diffstat (limited to 'src/landscape.cpp')
-rw-r--r--src/landscape.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/landscape.cpp b/src/landscape.cpp
index 2216a3831..982f02ab8 100644
--- a/src/landscape.cpp
+++ b/src/landscape.cpp
@@ -79,8 +79,9 @@ uint ApplyFoundationToSlope(Foundation f, Slope *s)
if (!IsFoundation(f)) return 0;
if (IsLeveledFoundation(f)) {
+ uint dz = TILE_HEIGHT + (IsSteepSlope(*s) ? TILE_HEIGHT : 0);
*s = SLOPE_FLAT;
- return TILE_HEIGHT;
+ return dz;
}
if (f != FOUNDATION_STEEP_BOTH && IsNonContinuousFoundation(f)) {
@@ -402,6 +403,9 @@ void DrawFoundation(TileInfo *ti, Foundation f)
AddSortableSpriteToDraw(inclined_base + inclined, PAL_NONE, ti->x, ti->y, 16, 16, 1, ti->z);
OffsetGroundSprite(31, 9);
+ } else if (IsLeveledFoundation(f)) {
+ AddSortableSpriteToDraw(leveled_base + SlopeWithOneCornerRaised(highest_corner), PAL_NONE, ti->x, ti->y, 16, 16, 7, ti->z - TILE_HEIGHT);
+ OffsetGroundSprite(31, 1);
} else if (f == FOUNDATION_STEEP_LOWER) {
/* one corner raised */
OffsetGroundSprite(31, 1);