summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2008-01-28 15:19:35 +0000
committerfrosch <frosch@openttd.org>2008-01-28 15:19:35 +0000
commitabc6e70447a17b59ce19978dcedc56d53d00789d (patch)
tree3cd0e1d7718c0fb94eb97604ddcb872646798974 /src
parenta1b98cda59eb9c38e30bfe936679e9f029a099da (diff)
downloadopenttd-abc6e70447a17b59ce19978dcedc56d53d00789d.tar.xz
(svn r12000) -Fix (r11926): If no river NewGRF is loaded, use sloped water from locks.
Diffstat (limited to 'src')
-rw-r--r--src/water_cmd.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp
index 34c7098d8..ad4716dc2 100644
--- a/src/water_cmd.cpp
+++ b/src/water_cmd.cpp
@@ -532,7 +532,13 @@ static void DrawRiverWater(const TileInfo *ti)
if (ti->tileh != SLOPE_FLAT) {
image = GetCanalSprite(CF_RIVER_SLOPE, ti->tile);
if (image == 0) {
- image = SPR_FLAT_WATER_TILE;
+ switch (ti->tileh) {
+ case SLOPE_NW: image = SPR_WATER_SLOPE_Y_DOWN; break;
+ case SLOPE_SW: image = SPR_WATER_SLOPE_X_UP; break;
+ case SLOPE_SE: image = SPR_WATER_SLOPE_Y_UP; break;
+ case SLOPE_NE: image = SPR_WATER_SLOPE_X_DOWN; break;
+ default: image = SPR_FLAT_WATER_TILE; break;
+ }
} else {
switch (ti->tileh) {
default: NOT_REACHED();
@@ -546,9 +552,8 @@ static void DrawRiverWater(const TileInfo *ti)
DrawGroundSprite(image, PAL_NONE);
- /* Draw canal dikes if there are no river edges to draw. */
- if (edges_base <= 48) edges_base = SPR_CANAL_DIKES_BASE;
- DrawWaterEdges(edges_base, ti->tile);
+ /* Draw river edges if available. */
+ if (edges_base > 48) DrawWaterEdges(edges_base, ti->tile);
}
void DrawShoreTile(Slope tileh)