From 0347fb2ab67e942826523424c35ede66d27339fe Mon Sep 17 00:00:00 2001 From: tron Date: Sun, 23 Apr 2006 13:48:16 +0000 Subject: (svn r4541) Add a type for slopes and replace many magic numbers by the appropriate enums --- clear_cmd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'clear_cmd.c') diff --git a/clear_cmd.c b/clear_cmd.c index 074cb28c4..a680f398a 100644 --- a/clear_cmd.c +++ b/clear_cmd.c @@ -252,7 +252,7 @@ int32 CmdTerraformLand(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) r = GetTileh(a, b, c, d, &min); if (IsTileType(tile, MP_RAILWAY)) { - if (IsSteepTileh(r)) return_cmd_error(STR_1008_MUST_REMOVE_RAILROAD_TRACK); + if (IsSteepSlope(r)) return_cmd_error(STR_1008_MUST_REMOVE_RAILROAD_TRACK); if (IsPlainRailTile(tile)) { extern const TrackBits _valid_tileh_slopes[2][15]; @@ -448,7 +448,7 @@ void DrawClearLandTile(const TileInfo *ti, byte set) void DrawHillyLandTile(const TileInfo *ti) { - if (ti->tileh != 0) { + if (ti->tileh != SLOPE_FLAT) { DrawGroundSprite(SPR_FLAT_ROUGH_LAND + _tileh_to_sprite[ti->tileh]); } else { DrawGroundSprite(_landscape_clear_sprites[GB(ti->x ^ ti->y, 4, 3)]); @@ -459,9 +459,9 @@ void DrawClearLandFence(const TileInfo *ti) { byte z = ti->z; - if (ti->tileh & 2) { + if (ti->tileh & SLOPE_S) { z += 8; - if (ti->tileh == 0x17) z += 8; + if (ti->tileh == SLOPE_STEEP_S) z += 8; } if (GetFenceSW(ti->tile) != 0) { @@ -509,7 +509,7 @@ static uint GetSlopeZ_Clear(const TileInfo* ti) return GetPartialZ(ti->x & 0xF, ti->y & 0xF, ti->tileh) + ti->z; } -static uint GetSlopeTileh_Clear(TileIndex tile, uint tileh) +static Slope GetSlopeTileh_Clear(TileIndex tile, Slope tileh) { return tileh; } -- cgit v1.2.3-54-g00ecf