summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rail_cmd.c10
-rw-r--r--rail_map.h5
2 files changed, 4 insertions, 11 deletions
diff --git a/rail_cmd.c b/rail_cmd.c
index fe12c6590..6e8ca0c16 100644
--- a/rail_cmd.c
+++ b/rail_cmd.c
@@ -1210,8 +1210,6 @@ static void DrawTrackBits(TileInfo* ti, TrackBits track)
const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(ti->tile));
PalSpriteID image;
bool junction = false;
- bool earth = IsBarrenRailGround(ti->tile);
- bool snow = IsSnowRailGround(ti->tile);
// Select the sprite to use.
(image = rti->base_sprites.track_y, track == TRACK_BIT_Y) ||
@@ -1243,10 +1241,10 @@ static void DrawTrackBits(TileInfo* ti, TrackBits track)
image = _track_sloped_sprites[ti->tileh - 1] + rti->base_sprites.track_y;
}
- if (earth) {
- image = (image & SPRITE_MASK) | PALETTE_TO_BARE_LAND; // Use brown palette
- } else if (snow) {
- image += rti->snow_offset;
+ switch (GetRailGroundType(ti->tile)) {
+ case RAIL_GROUND_BARREN: image |= PALETTE_TO_BARE_LAND; break;
+ case RAIL_GROUND_ICE_DESERT: image += rti->snow_offset; break;
+ default: break;
}
DrawGroundSprite(image);
diff --git a/rail_map.h b/rail_map.h
index d4f0a0386..4d609fc37 100644
--- a/rail_map.h
+++ b/rail_map.h
@@ -311,11 +311,6 @@ static inline RailGroundType GetRailGroundType(TileIndex t)
return (RailGroundType)GB(_m[t].m2, 0, 4);
}
-static inline bool IsBarrenRailGround(TileIndex t)
-{
- return GetRailGroundType(t) == RAIL_GROUND_BARREN;
-}
-
static inline bool IsSnowRailGround(TileIndex t)
{
return GetRailGroundType(t) == RAIL_GROUND_ICE_DESERT;