Changeset - r16613:fd8496524ff6
[Not reviewed]
master
0 1 0
frosch - 14 years ago 2010-11-29 17:26:47
frosch@openttd.org
(svn r21353) -Fix (r19056)[FS#4277]: New railtypes with overlays did not use the shore sprites as groundtiles for three-corner-raised slopes (at shore).
1 file changed with 4 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/rail_cmd.cpp
Show inline comments
 
@@ -1869,28 +1869,30 @@ static void DrawTrackBitsOverlay(TileInf
 
	if (IsNonContinuousFoundation(f)) {
 
		/* Save halftile corner */
 
		halftile_corner = (f == FOUNDATION_STEEP_BOTH ? GetHighestSlopeCorner(ti->tileh) : GetHalftileFoundationCorner(f));
 
		/* Draw lower part first */
 
		track &= ~CornerToTrackBits(halftile_corner);
 
		f = (f == FOUNDATION_STEEP_BOTH ? FOUNDATION_STEEP_LOWER : FOUNDATION_NONE);
 
	}
 

	
 
	DrawFoundation(ti, f);
 
	/* DrawFoundation modifies ti */
 

	
 
	/* Draw ground */
 
	if (track == TRACK_BIT_NONE && rgt == RAIL_GROUND_WATER) {
 
		if (IsSteepSlope(ti->tileh)) {
 
	if (rgt == RAIL_GROUND_WATER) {
 
		if (track != TRACK_BIT_NONE || IsSteepSlope(ti->tileh)) {
 
			/* three-corner-raised slope or steep slope with track on upper part */
 
			DrawShoreTile(ti->tileh);
 
		} else {
 
			/* single-corner-raised slope with track on upper part */
 
			DrawGroundSprite(SPR_FLAT_WATER_TILE, PAL_NONE);
 
		}
 
	} else {
 
		SpriteID image;
 

	
 
		switch (rgt) {
 
			case RAIL_GROUND_BARREN:     image = SPR_FLAT_BARE_LAND;  break;
 
			case RAIL_GROUND_ICE_DESERT: image = SPR_FLAT_SNOW_DESERT_TILE; break;
 
			default:                     image = SPR_FLAT_GRASS_TILE; break;
 
		}
 

	
 
		image += SlopeToSpriteOffset(ti->tileh);
0 comments (0 inline, 0 general)