From f8b2fb44844686c24ed408cb94fa5c0d85312a73 Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 8 Feb 2007 14:10:14 +0000 Subject: [PATCH] (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 | 9 ++++----- station_cmd.c | 5 +++++ table/station_land.h | 2 ++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/spritecache.c b/spritecache.c index f754a1ec1a..83ce23cea4 100644 --- a/spritecache.c +++ b/spritecache.c @@ -92,11 +92,10 @@ static void* ReadSprite(SpriteID id) 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]); diff --git a/station_cmd.c b/station_cmd.c index e1304a86c5..4186d30bf4 100644 --- a/station_cmd.c +++ b/station_cmd.c @@ -2070,6 +2070,9 @@ const DrawTileSprites *GetStationTileLayout(byte gfx) 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 @@ static void DrawTile_Station(TileInfo *ti) 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)) { diff --git a/table/station_land.h b/table/station_land.h index 1c5864c2a5..f6abce8e8c 100644 --- a/table/station_land.h +++ b/table/station_land.h @@ -448,7 +448,9 @@ static const DrawTileSeqStruct _station_display_datas_81[] = { 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() };