Changeset - r14571:be18f5f42fd4
[Not reviewed]
master
0 1 0
frosch - 15 years ago 2010-02-17 21:19:33
frosch@openttd.org
(svn r19154) -Fix: Invisible depots draw the track, so also draw the overlays.
1 file changed with 6 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/rail_cmd.cpp
Show inline comments
 
@@ -2173,46 +2173,52 @@ static void DrawTile_Track(TileInfo *ti)
 
				image += rti->snow_offset; // tile with tracks
 
			} else {
 
				image = SPR_FLAT_SNOW_DESERT_TILE; // flat ground
 
			}
 
		}
 

	
 
		DrawGroundSprite(image, GroundSpritePaletteTransform(image, pal, _drawtile_track_palette));
 

	
 
		if (rti->UsesOverlay()) {
 
			SpriteID ground = GetCustomRailSprite(rti, ti->tile, RTSG_GROUND);
 

	
 
			switch (GetRailDepotDirection(ti->tile)) {
 
				case DIAGDIR_NE: if (!IsInvisibilitySet(TO_BUILDINGS)) break; // else FALL THROUGH
 
				case DIAGDIR_SW: DrawGroundSprite(ground + RTO_X, PAL_NONE); break;
 
				case DIAGDIR_NW: if (!IsInvisibilitySet(TO_BUILDINGS)) break; // else FALL THROUGH
 
				case DIAGDIR_SE: DrawGroundSprite(ground + RTO_Y, PAL_NONE); break;
 
				default: break;
 
			}
 

	
 
			if (_settings_client.gui.show_track_reservation && HasDepotReservation(ti->tile)) {
 
				SpriteID overlay = GetCustomRailSprite(rti, ti->tile, RTSG_OVERLAY);
 

	
 
				switch (GetRailDepotDirection(ti->tile)) {
 
					case DIAGDIR_NE: if (!IsInvisibilitySet(TO_BUILDINGS)) break; // else FALL THROUGH
 
					case DIAGDIR_SW: DrawGroundSprite(overlay + RTO_X, PALETTE_CRASH); break;
 
					case DIAGDIR_NW: if (!IsInvisibilitySet(TO_BUILDINGS)) break; // else FALL THROUGH
 
					case DIAGDIR_SE: DrawGroundSprite(overlay + RTO_Y, PALETTE_CRASH); break;
 
					default: break;
 
				}
 
			}
 

	
 
			relocation  = GetCustomRailSprite(rti, ti->tile, RTSG_DEPOT);
 
			relocation -= SPR_RAIL_DEPOT_SE_1;
 
		} else {
 
			/* PBS debugging, draw reserved tracks darker */
 
			if (_game_mode != GM_MENU && _settings_client.gui.show_track_reservation && HasDepotReservation(ti->tile)) {
 
				switch (GetRailDepotDirection(ti->tile)) {
 
					case DIAGDIR_NE: if (!IsInvisibilitySet(TO_BUILDINGS)) break; // else FALL THROUGH
 
					case DIAGDIR_SW: DrawGroundSprite(rti->base_sprites.single_x, PALETTE_CRASH); break;
 
					case DIAGDIR_NW: if (!IsInvisibilitySet(TO_BUILDINGS)) break; // else FALL THROUGH
 
					case DIAGDIR_SE: DrawGroundSprite(rti->base_sprites.single_y, PALETTE_CRASH); break;
 
					default: break;
 
				}
 
			}
 

	
 
			relocation = rti->total_offset;
 
		}
 

	
 
		if (HasCatenaryDrawn(GetRailType(ti->tile))) DrawCatenary(ti);
 

	
 
		DrawRailTileSeq(ti, dts, TO_BUILDINGS, relocation, 0, _drawtile_track_palette);
 
	}
0 comments (0 inline, 0 general)