changeset 5963:9d9c1c80f583 draft

(svn r8635) -Fix: draw canal edges under buoys that are in a canal.
author rubidium <rubidium@openttd.org>
date Thu, 08 Feb 2007 14:04:02 +0000
parents 03c6a810c69b
children 9838a620e114
files src/station_cmd.cpp src/table/station_land.h
diffstat 2 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -1977,6 +1977,9 @@
 	return &_station_display_datas[gfx];
 }
 
+/* For drawing canal edges on buoys */
+extern void DrawCanalWater(TileIndex tile);
+
 static void DrawTile_Station(TileInfo *ti)
 {
 	const DrawTileSeqStruct *dtss;
@@ -2041,6 +2044,8 @@
 
 	if (GetRailType(ti->tile) == RAILTYPE_ELECTRIC && IsStationTileElectrifiable(ti->tile)) DrawCatenary(ti);
 
+	if (IsBuoyTile(ti->tile) && (ti->z != 0 || !IsTileOwner(ti->tile, OWNER_WATER))) DrawCanalWater(ti->tile);
+
 	foreach_draw_tile_seq(dtss, t->seq) {
 		SpriteID pal;
 
--- a/src/table/station_land.h
+++ b/src/table/station_land.h
@@ -384,6 +384,12 @@
 	TILE_SEQ_END()
 };
 
+/* Buoy, which will _always_ drown under the ship */
+static const DrawTileSeqStruct _station_display_datas_82[] = {
+	{  4,  -1,  0,  0,  0,  0, SPR_IMG_BOUY, PAL_NONE },
+	TILE_SEQ_END()
+};
+
 // control tower with concrete underground and no fence
 // concrete underground
 static const DrawTileSeqStruct _station_display_datas_085[] = {
@@ -1036,7 +1042,7 @@
 	{ SPR_SHORE_TILEH_6,              PAL_NONE, _station_display_datas_79 },
 	{ SPR_FLAT_WATER_TILE,            PAL_NONE, _station_display_datas_80 },
 	{ SPR_FLAT_WATER_TILE,            PAL_NONE, _station_display_datas_81 },
-	{ SPR_BUOY,                       PAL_NONE, _station_display_nothing },
+	{ SPR_FLAT_WATER_TILE,            PAL_NONE, _station_display_datas_82 },
 	{ SPR_AIRPORT_RUNWAY_END,         PAL_NONE, _station_display_nothing },
 	{ SPR_AIRPORT_RUNWAY_EXIT_B,      PAL_NONE, _station_display_nothing },
 	{ SPR_AIRPORT_APRON,              PAL_NONE, _station_display_datas_085 },