Mercurial > hg > openttd
changeset 15223:809a403417d6 draft
(svn r19852) -Fix [FS#TT-MS]: Drawing fallback sprites for unavailable NewGRF waypoints failed.
author | frosch <frosch@openttd.org> |
---|---|
date | Tue, 18 May 2010 20:49:53 +0000 |
parents | 8cbbf8ae37e9 |
children | 2592b701a4f2 |
files | src/station_cmd.cpp src/table/station_land.h |
diffstat | 2 files changed, 12 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -2580,7 +2580,7 @@ palette = PALETTE_TO_GREY; } - if (t == NULL || t->seq == NULL) t = &_station_display_datas[GetStationType(ti->tile)][GetStationGfx(ti->tile)]; + if (t == NULL || t->seq == NULL) t = GetStationTileLayout(GetStationType(ti->tile), GetStationGfx(ti->tile)); /* don't show foundation for docks */ if (ti->tileh != SLOPE_FLAT && !IsDock(ti->tile)) { @@ -2702,7 +2702,7 @@ { int32 total_offset = 0; PaletteID pal = COMPANY_SPRITE_COLOUR(_local_company); - const DrawTileSprites *t = &_station_display_datas[st][image]; + const DrawTileSprites *t = GetStationTileLayout(st, image); const RailtypeInfo *rti = NULL; if (railtype != INVALID_RAILTYPE) {
--- a/src/table/station_land.h +++ b/src/table/station_land.h @@ -954,11 +954,21 @@ static const DrawTileSprites _station_display_datas_waypoint[] = { TILE_SPRITE_LINE(SPR_RAIL_TRACK_X, _station_display_datas_waypoint_X) TILE_SPRITE_LINE(SPR_RAIL_TRACK_Y, _station_display_datas_waypoint_Y) + TILE_SPRITE_LINE(SPR_RAIL_TRACK_X, _station_display_datas_waypoint_X) + TILE_SPRITE_LINE(SPR_RAIL_TRACK_Y, _station_display_datas_waypoint_Y) + TILE_SPRITE_LINE(SPR_RAIL_TRACK_X, _station_display_datas_waypoint_X) + TILE_SPRITE_LINE(SPR_RAIL_TRACK_Y, _station_display_datas_waypoint_Y) + TILE_SPRITE_LINE(SPR_RAIL_TRACK_X, _station_display_datas_waypoint_X) + TILE_SPRITE_LINE(SPR_RAIL_TRACK_Y, _station_display_datas_waypoint_Y) }; #undef TILE_SPRITE_LINE #undef TILE_SPRITE_NULL +/* Default waypoint is also drawn as fallback for NewGRF waypoints. + * As these are drawn/build like stations, they may use the same number of layouts. */ +assert_compile(lengthof(_station_display_datas_rail) == lengthof(_station_display_datas_waypoint)); + static const DrawTileSprites * const _station_display_datas[] = { _station_display_datas_rail, _station_display_datas_airport,