summaryrefslogtreecommitdiff
path: root/clear_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-04-23 13:48:16 +0000
committertron <tron@openttd.org>2006-04-23 13:48:16 +0000
commitdd180a1e1883336a1edc3b4d6eac440f06e3685b (patch)
tree3f0769bd955cefba7ab80063e64546c1874e0a62 /clear_cmd.c
parentfa213c686ee1d348d1eb167f2423261d8040205e (diff)
downloadopenttd-dd180a1e1883336a1edc3b4d6eac440f06e3685b.tar.xz
(svn r4541) Add a type for slopes and replace many magic numbers by the appropriate enums
Diffstat (limited to 'clear_cmd.c')
-rw-r--r--clear_cmd.c10
1 files changed, 5 insertions, 5 deletions
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;
}