summaryrefslogtreecommitdiff
path: root/src/bridge_map.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2014-09-21 11:20:11 +0000
committerrubidium <rubidium@openttd.org>2014-09-21 11:20:11 +0000
commit0ac2d3b3247041e0690e12ac7270dde5377390de (patch)
tree987d8921b28b3ef2c33daf71fa7db98322b4e52e /src/bridge_map.h
parent47852f119eebc2816bd829b85ee4d105d1520e21 (diff)
downloadopenttd-0ac2d3b3247041e0690e12ac7270dde5377390de.tar.xz
(svn r26876) -Codechange: move 'has bride above' data from m6 to type
Diffstat (limited to 'src/bridge_map.h')
-rw-r--r--src/bridge_map.h15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/bridge_map.h b/src/bridge_map.h
index 8ee658ce7..6ff78a7ec 100644
--- a/src/bridge_map.h
+++ b/src/bridge_map.h
@@ -52,13 +52,11 @@ static inline bool MayHaveBridgeAbove(TileIndex t)
/**
* checks if a bridge is set above the ground of this tile
* @param t The tile to analyze
- * @pre MayHaveBridgeAbove(t)
* @return true if a bridge is detected above
*/
static inline bool IsBridgeAbove(TileIndex t)
{
- assert(MayHaveBridgeAbove(t));
- return GB(_m[t].m6, 6, 2) != 0;
+ return GB(_m[t].type, 2, 2) != 0;
}
/**
@@ -82,7 +80,7 @@ static inline BridgeType GetBridgeType(TileIndex t)
static inline Axis GetBridgeAxis(TileIndex t)
{
assert(IsBridgeAbove(t));
- return (Axis)(GB(_m[t].m6, 6, 2) - 1);
+ return (Axis)(GB(_m[t].type, 2, 2) - 1);
}
TileIndex GetNorthernBridgeEnd(TileIndex t);
@@ -104,18 +102,15 @@ static inline int GetBridgePixelHeight(TileIndex tile)
* Remove the bridge over the given axis.
* @param t the tile to remove the bridge from
* @param a the axis of the bridge to remove
- * @pre MayHaveBridgeAbove(t)
*/
static inline void ClearSingleBridgeMiddle(TileIndex t, Axis a)
{
- assert(MayHaveBridgeAbove(t));
- ClrBit(_m[t].m6, 6 + a);
+ ClrBit(_m[t].type, 2 + a);
}
/**
* Removes bridges from the given, that is bridges along the X and Y axis.
* @param t the tile to remove the bridge from
- * @pre MayHaveBridgeAbove(t)
*/
static inline void ClearBridgeMiddle(TileIndex t)
{
@@ -127,12 +122,10 @@ static inline void ClearBridgeMiddle(TileIndex t)
* Set that there is a bridge over the given axis.
* @param t the tile to add the bridge to
* @param a the axis of the bridge to add
- * @pre MayHaveBridgeAbove(t)
*/
static inline void SetBridgeMiddle(TileIndex t, Axis a)
{
- assert(MayHaveBridgeAbove(t));
- SetBit(_m[t].m6, 6 + a);
+ SetBit(_m[t].type, 2 + a);
}
/**