diff options
author | frosch <frosch@openttd.org> | 2010-05-18 20:49:53 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2010-05-18 20:49:53 +0000 |
commit | 354645cd0af62605030514c66bfa59795fe999b9 (patch) | |
tree | 3364abc6778297bd566a606f0346ee51cc79933c | |
parent | c80c5464ae4a9c161cc11c1c507f2a99382f23c2 (diff) | |
download | openttd-354645cd0af62605030514c66bfa59795fe999b9.tar.xz |
(svn r19852) -Fix [FS#TT-MS]: Drawing fallback sprites for unavailable NewGRF waypoints failed.
-rw-r--r-- | src/station_cmd.cpp | 4 | ||||
-rw-r--r-- | src/table/station_land.h | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 0b928cfbe..114eca1f2 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -2580,7 +2580,7 @@ static void DrawTile_Station(TileInfo *ti) 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 @@ void StationPickerDrawSprite(int x, int y, StationType st, RailType railtype, Ro { 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) { diff --git a/src/table/station_land.h b/src/table/station_land.h index 3eac6b31e..6668ce6b0 100644 --- a/src/table/station_land.h +++ b/src/table/station_land.h @@ -954,11 +954,21 @@ static const DrawTileSprites _station_display_datas_buoy[] = { 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, |