summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-06-30 16:08:12 +0000
committerrubidium <rubidium@openttd.org>2010-06-30 16:08:12 +0000
commitb1d60d66cf16e5450676354974751a51aff7c1cb (patch)
tree42efcaf15aa61837eb4a9c4b648d58ed11960834 /src
parented35d62e70367df2b0da59922e3fee230fdffe3f (diff)
downloadopenttd-b1d60d66cf16e5450676354974751a51aff7c1cb.tar.xz
(svn r20036) -Fix [FS#3911]: tram tracks didn't show at level crossing with the new railtypes
Diffstat (limited to 'src')
-rw-r--r--src/road_cmd.cpp42
1 files changed, 19 insertions, 23 deletions
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index ab5a5df5c..772887e90 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -1196,12 +1196,12 @@ static void DrawTile_Road(TileInfo *ti)
case ROAD_TILE_CROSSING: {
if (ti->tileh != SLOPE_FLAT) DrawFoundation(ti, FOUNDATION_LEVELED);
+ PaletteID pal = PAL_NONE;
const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(ti->tile));
if (rti->UsesOverlay()) {
Axis axis = GetCrossingRailAxis(ti->tile);
SpriteID road = SPR_ROAD_Y + axis;
- PaletteID pal = PAL_NONE;
Roadside roadside = GetRoadside(ti->tile);
@@ -1220,34 +1220,30 @@ static void DrawTile_Road(TileInfo *ti)
SpriteID rail = GetCustomRailSprite(rti, ti->tile, RTSG_CROSSING) + axis;
DrawGroundSprite(rail, PAL_NONE);
DrawRailTileSeq(ti, &_crossing_layout, TO_CATENARY, rail, 0, PAL_NONE);
+ } else {
+ SpriteID image = rti->base_sprites.crossing;
- if (HasCatenaryDrawn(GetRailType(ti->tile))) DrawCatenary(ti);
- break;
- }
-
- SpriteID image = rti->base_sprites.crossing;
- PaletteID pal = PAL_NONE;
-
- if (GetCrossingRoadAxis(ti->tile) == AXIS_X) image++;
- if (IsCrossingBarred(ti->tile)) image += 2;
+ if (GetCrossingRoadAxis(ti->tile) == AXIS_X) image++;
+ if (IsCrossingBarred(ti->tile)) image += 2;
- Roadside roadside = GetRoadside(ti->tile);
+ Roadside roadside = GetRoadside(ti->tile);
- if (AlwaysDrawUnpavedRoads(ti->tile, roadside)) {
- image += 8;
- } else {
- switch (roadside) {
- case ROADSIDE_BARREN: pal = PALETTE_TO_BARE_LAND; break;
- case ROADSIDE_GRASS: break;
- default: image += 4; break; // Paved
+ if (AlwaysDrawUnpavedRoads(ti->tile, roadside)) {
+ image += 8;
+ } else {
+ switch (roadside) {
+ case ROADSIDE_BARREN: pal = PALETTE_TO_BARE_LAND; break;
+ case ROADSIDE_GRASS: break;
+ default: image += 4; break; // Paved
+ }
}
- }
- DrawGroundSprite(image, pal);
+ DrawGroundSprite(image, pal);
- /* PBS debugging, draw reserved tracks darker */
- if (_game_mode != GM_MENU && _settings_client.gui.show_track_reservation && HasCrossingReservation(ti->tile)) {
- DrawGroundSprite(GetCrossingRoadAxis(ti->tile) == AXIS_Y ? GetRailTypeInfo(GetRailType(ti->tile))->base_sprites.single_x : GetRailTypeInfo(GetRailType(ti->tile))->base_sprites.single_y, PALETTE_CRASH);
+ /* PBS debugging, draw reserved tracks darker */
+ if (_game_mode != GM_MENU && _settings_client.gui.show_track_reservation && HasCrossingReservation(ti->tile)) {
+ DrawGroundSprite(GetCrossingRoadAxis(ti->tile) == AXIS_Y ? GetRailTypeInfo(GetRailType(ti->tile))->base_sprites.single_x : GetRailTypeInfo(GetRailType(ti->tile))->base_sprites.single_y, PALETTE_CRASH);
+ }
}
if (HasTileRoadType(ti->tile, ROADTYPE_TRAM)) {