(svn r8636) [0.5] -Backport from trunk (8634, 8635): 0.5
authorrubidium
Thu, 08 Feb 2007 14:10:14 +0000
branch0.5
changeset 5433 c136db538201
parent 5432 f0e7a0b90048
child 5434 a3d7ea66ba2a
(svn r8636) [0.5] -Backport from trunk (8634, 8635):
-Fix: draw canal edges under buoys that are in a canal
-Codechange: replace missing sprites with a red question mark
spritecache.c
station_cmd.c
table/station_land.h
--- a/spritecache.c	Thu Feb 08 11:26:09 2007 +0000
+++ b/spritecache.c	Thu Feb 08 14:10:14 2007 +0000
@@ -92,11 +92,10 @@
 	DEBUG(spritecache, 9) ("load sprite %d", id);
 
 	if (!SpriteExists(id)) {
-		error(
-			"Tried to load non-existing sprite #%d.\n"
-			"Probable cause: Wrong/missing NewGRFs",
-			id
-		);
+		DEBUG(spritecache, 1) ("Tried to load non-existing sprite #%d. Probable cause: Wrong/missing NewGRFs", id);
+
+		/* SPR_IMG_QUERY is a BIG FAT RED ? */
+		id = SPR_IMG_QUERY;
 	}
 
 	FioSeekToFile(_sprite_file_pos[id]);
--- a/station_cmd.c	Thu Feb 08 11:26:09 2007 +0000
+++ b/station_cmd.c	Thu Feb 08 14:10:14 2007 +0000
@@ -2070,6 +2070,9 @@
 	return &_station_display_datas[gfx];
 }
 
+/* For drawing canal edges on buoys */
+extern void DrawCanalWater(TileIndex tile);
+
 static void DrawTile_Station(TileInfo *ti)
 {
 	uint32 image;
@@ -2136,6 +2139,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) {
 		image = dtss->image;
 		if (relocation == 0 || HASBIT(image, 30)) {
--- a/table/station_land.h	Thu Feb 08 11:26:09 2007 +0000
+++ b/table/station_land.h	Thu Feb 08 14:10:14 2007 +0000
@@ -448,7 +448,9 @@
 	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 },
 	TILE_SEQ_END()
 };