Changeset - r16730:6bbafbca017d
[Not reviewed]
master
0 1 0
rubidium - 14 years ago 2010-12-11 23:14:35
rubidium@openttd.org
(svn r21473) -Feature [FS#4279]: [NewGRF] Use the station graphics property to determine a fallback for the depot sprites
1 file changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/rail_cmd.cpp
Show inline comments
 
@@ -2271,26 +2271,26 @@ static void DrawTile_Track(TileInfo *ti)
 
			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;
 
			int depot_sprite = GetCustomRailSprite(rti, ti->tile, RTSG_DEPOT);
 
			relocation = depot_sprite != 0 ? depot_sprite - SPR_RAIL_DEPOT_SE_1 : rti->total_offset;
 
		} 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;
 
				}
 
			}
 

	
 
@@ -2319,26 +2319,26 @@ void DrawTrainDepotSprite(int x, int y, 
 

	
 
	DrawSprite(image, PAL_NONE, x, y);
 

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

	
 
		switch (dir) {
 
			case DIAGDIR_SW: DrawSprite(ground + RTO_X, PAL_NONE, x, y); break;
 
			case DIAGDIR_SE: DrawSprite(ground + RTO_Y, PAL_NONE, x, y); break;
 
			default: break;
 
		}
 

	
 
		offset  = GetCustomRailSprite(rti, INVALID_TILE, RTSG_DEPOT);
 
		offset -= SPR_RAIL_DEPOT_SE_1;
 
		int depot_sprite = GetCustomRailSprite(rti, INVALID_TILE, RTSG_DEPOT);
 
		if (depot_sprite != 0) offset = depot_sprite - SPR_RAIL_DEPOT_SE_1;
 
	}
 

	
 
	DrawRailTileSeqInGUI(x, y, dts, offset, 0, palette);
 
}
 

	
 
static uint GetSlopeZ_Track(TileIndex tile, uint x, uint y)
 
{
 
	uint z;
 
	Slope tileh = GetTileSlope(tile, &z);
 

	
 
	if (tileh == SLOPE_FLAT) return z;
 
	if (IsPlainRail(tile)) {
0 comments (0 inline, 0 general)