summaryrefslogtreecommitdiff
path: root/src/slope_func.h
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2008-04-02 14:13:15 +0000
committerfrosch <frosch@openttd.org>2008-04-02 14:13:15 +0000
commitfa68e5f77026835b02e1dc3d8eef09b57aac8249 (patch)
tree1c88a7fa03add5b3c621da72df5f777b12fdd26c /src/slope_func.h
parent5e5e074a5dc68ed495de3234fda15989db34e23d (diff)
downloadopenttd-fa68e5f77026835b02e1dc3d8eef09b57aac8249.tar.xz
(svn r12541) -Codechange: Declare Slope enum as bit set, and remove some (then) unneeded casts.
Diffstat (limited to 'src/slope_func.h')
-rw-r--r--src/slope_func.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/slope_func.h b/src/slope_func.h
index 6185d44d7..7bfa5e52d 100644
--- a/src/slope_func.h
+++ b/src/slope_func.h
@@ -54,7 +54,7 @@ static inline bool IsHalftileSlope(Slope s)
*/
static inline Slope RemoveHalftileSlope(Slope s)
{
- return (Slope)(s & ~SLOPE_HALFTILE_MASK);
+ return s & ~SLOPE_HALFTILE_MASK;
}
/**
@@ -71,7 +71,7 @@ static inline Slope RemoveHalftileSlope(Slope s)
static inline Slope ComplementSlope(Slope s)
{
assert(!IsSteepSlope(s) && !IsHalftileSlope(s));
- return (Slope)(0xF ^ s);
+ return s ^ SLOPE_ELEVATED;
}
/**
@@ -200,7 +200,7 @@ static inline Slope SlopeWithThreeCornersRaised(Corner corner)
*/
static inline Slope SteepSlope(Corner corner)
{
- return (Slope)(SLOPE_STEEP | SlopeWithThreeCornersRaised(OppositeCorner(corner)));
+ return SLOPE_STEEP | SlopeWithThreeCornersRaised(OppositeCorner(corner));
}
/**