(svn r11983) -Codechange: Add some helper functions for slopes and use them.

This commit is contained in:
frosch
2008-01-25 15:47:58 +00:00
parent d11aeb118c
commit 6f6708e844
11 changed files with 150 additions and 107 deletions

View File

@@ -909,7 +909,7 @@ static void DrawAutorailSelection(const TileInfo *ti, uint autorail_type)
int offset;
FoundationPart foundation_part = FOUNDATION_PART_NORMAL;
Slope autorail_tileh = (Slope)(ti->tileh & ~SLOPE_HALFTILE_MASK);
Slope autorail_tileh = RemoveHalftileSlope(ti->tileh);
if (IsHalftileSlope(ti->tileh)) {
static const uint _lower_rail[4] = { 5U, 2U, 4U, 3U };
Corner halftile_corner = GetHalftileSlopeCorner(ti->tileh);
@@ -958,7 +958,7 @@ static void DrawTileSelection(const TileInfo *ti)
FoundationPart foundation_part = FOUNDATION_PART_NORMAL;
if (ti->tileh & SLOPE_N) {
z += TILE_HEIGHT;
if ((ti->tileh & ~SLOPE_HALFTILE_MASK) == SLOPE_STEEP_N) z += TILE_HEIGHT;
if (RemoveHalftileSlope(ti->tileh) == SLOPE_STEEP_N) z += TILE_HEIGHT;
}
if (IsHalftileSlope(ti->tileh)) {
Corner halftile_corner = GetHalftileSlopeCorner(ti->tileh);