summaryrefslogtreecommitdiff
path: root/src/newgrf_industrytiles.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2008-07-26 16:14:10 +0000
committerfrosch <frosch@openttd.org>2008-07-26 16:14:10 +0000
commit6684bc12d575265d5db59387cdc33dffb602303b (patch)
tree3a62ec9adb234e8726387b1573747436f7d43e9f /src/newgrf_industrytiles.cpp
parentc64e3b488273010ace06cebb2d4b55b03735eb1c (diff)
downloadopenttd-6684bc12d575265d5db59387cdc33dffb602303b.tar.xz
(svn r13838) -Codechange: Make industry tiles aware of WaterClasses.
Diffstat (limited to 'src/newgrf_industrytiles.cpp')
-rw-r--r--src/newgrf_industrytiles.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/newgrf_industrytiles.cpp b/src/newgrf_industrytiles.cpp
index 7f0aa2b8b..63c7cbf34 100644
--- a/src/newgrf_industrytiles.cpp
+++ b/src/newgrf_industrytiles.cpp
@@ -25,6 +25,7 @@
#include "town.h"
#include "command_func.h"
#include "animated_tile_func.h"
+#include "water.h"
#include "table/sprites.h"
#include "table/strings.h"
@@ -185,7 +186,15 @@ void IndustryDrawTileLayout(const TileInfo *ti, const SpriteGroup *group, byte r
if (IS_CUSTOM_SPRITE(image)) image += stage;
- if (GB(image, 0, SPRITE_WIDTH) != 0) DrawGroundSprite(image, pal);
+ if (GB(image, 0, SPRITE_WIDTH) != 0) {
+ /* If the ground sprite is the default flat water sprite, draw also canal/river borders
+ * Do not do this if the tile's WaterClass is 'land'. */
+ if (image == SPR_FLAT_WATER_TILE && IsIndustryTileOnWater(ti->tile)) {
+ DrawWaterClassGround(ti);
+ } else {
+ DrawGroundSprite(image, pal);
+ }
+ }
foreach_draw_tile_seq(dtss, dts->seq) {
if (GB(dtss->image.sprite, 0, SPRITE_WIDTH) == 0) continue;