Change various asserts to not be included in release builds
This commit is contained in:
@@ -54,7 +54,7 @@ static inline bool MayHaveRoad(TileIndex t)
|
||||
*/
|
||||
static inline RoadTileType GetRoadTileType(TileIndex t)
|
||||
{
|
||||
assert_tile(IsTileType(t, MP_ROAD), t);
|
||||
dbg_assert_tile(IsTileType(t, MP_ROAD), t);
|
||||
return (RoadTileType)GB(_m[t].m5, 6, 2);
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ static inline bool IsRoadDepotTile(TileIndex t)
|
||||
*/
|
||||
static inline RoadBits GetRoadBits(TileIndex t, RoadTramType rtt)
|
||||
{
|
||||
assert_tile(IsNormalRoad(t), t);
|
||||
dbg_assert_tile(IsNormalRoad(t), t);
|
||||
if (rtt == RTT_TRAM) return (RoadBits)GB(_m[t].m3, 0, 4);
|
||||
return (RoadBits)GB(_m[t].m5, 0, 4);
|
||||
}
|
||||
@@ -165,13 +165,13 @@ static inline void SetRoadBits(TileIndex t, RoadBits r, RoadTramType rtt)
|
||||
|
||||
static inline RoadType GetRoadTypeRoad(TileIndex t)
|
||||
{
|
||||
assert(MayHaveRoad(t));
|
||||
dbg_assert(MayHaveRoad(t));
|
||||
return (RoadType)GB(_m[t].m4, 0, 6);
|
||||
}
|
||||
|
||||
static inline RoadType GetRoadTypeTram(TileIndex t)
|
||||
{
|
||||
assert(MayHaveRoad(t));
|
||||
dbg_assert(MayHaveRoad(t));
|
||||
return (RoadType)GB(_me[t].m8, 6, 6);
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ static inline bool HasTileAnyRoadType(TileIndex t, RoadTypes rts)
|
||||
*/
|
||||
static inline Owner GetRoadOwner(TileIndex t, RoadTramType rtt)
|
||||
{
|
||||
assert(MayHaveRoad(t));
|
||||
dbg_assert(MayHaveRoad(t));
|
||||
if (rtt == RTT_ROAD) return (Owner)GB(IsNormalRoadTile(t) ? _m[t].m1 : _me[t].m7, 0, 5);
|
||||
|
||||
/* Trams don't need OWNER_TOWN, and remapping OWNER_NONE
|
||||
@@ -285,7 +285,7 @@ static inline void SetRoadOwner(TileIndex t, RoadTramType rtt, Owner o)
|
||||
*/
|
||||
static inline bool IsRoadOwner(TileIndex t, RoadTramType rtt, Owner o)
|
||||
{
|
||||
assert_tile(HasTileRoadType(t, rtt), t);
|
||||
dbg_assert_tile(HasTileRoadType(t, rtt), t);
|
||||
return (GetRoadOwner(t, rtt) == o);
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ template <> struct EnumPropsT<DisallowedRoadDirections> : MakeEnumPropsT<Disallo
|
||||
*/
|
||||
static inline DisallowedRoadDirections GetDisallowedRoadDirections(TileIndex t)
|
||||
{
|
||||
assert_tile(IsNormalRoad(t), t);
|
||||
dbg_assert_tile(IsNormalRoad(t), t);
|
||||
return (DisallowedRoadDirections)GB(_m[t].m5, 4, 2);
|
||||
}
|
||||
|
||||
@@ -352,7 +352,7 @@ enum RoadCachedOneWayState {
|
||||
*/
|
||||
static inline RoadCachedOneWayState GetRoadCachedOneWayState(TileIndex t)
|
||||
{
|
||||
assert(MayHaveRoad(t));
|
||||
dbg_assert(MayHaveRoad(t));
|
||||
return (RoadCachedOneWayState)GB(_me[t].m8, 12, 3);
|
||||
}
|
||||
|
||||
@@ -376,7 +376,7 @@ static inline void SetRoadCachedOneWayState(TileIndex t, RoadCachedOneWayState r
|
||||
*/
|
||||
static inline Axis GetCrossingRoadAxis(TileIndex t)
|
||||
{
|
||||
assert_tile(IsLevelCrossing(t), t);
|
||||
dbg_assert_tile(IsLevelCrossing(t), t);
|
||||
return (Axis)GB(_m[t].m5, 0, 1);
|
||||
}
|
||||
|
||||
@@ -388,7 +388,7 @@ static inline Axis GetCrossingRoadAxis(TileIndex t)
|
||||
*/
|
||||
static inline Axis GetCrossingRailAxis(TileIndex t)
|
||||
{
|
||||
assert_tile(IsLevelCrossing(t), t);
|
||||
dbg_assert_tile(IsLevelCrossing(t), t);
|
||||
return OtherAxis((Axis)GetCrossingRoadAxis(t));
|
||||
}
|
||||
|
||||
@@ -431,7 +431,7 @@ static inline TrackBits GetCrossingRailBits(TileIndex tile)
|
||||
*/
|
||||
static inline bool HasCrossingReservation(TileIndex t)
|
||||
{
|
||||
assert_tile(IsLevelCrossingTile(t), t);
|
||||
dbg_assert_tile(IsLevelCrossingTile(t), t);
|
||||
return HasBit(_m[t].m5, 4);
|
||||
}
|
||||
|
||||
@@ -467,7 +467,7 @@ static inline TrackBits GetCrossingReservationTrackBits(TileIndex t)
|
||||
*/
|
||||
static inline bool IsCrossingBarred(TileIndex t)
|
||||
{
|
||||
assert_tile(IsLevelCrossing(t), t);
|
||||
dbg_assert_tile(IsLevelCrossing(t), t);
|
||||
return HasBit(_m[t].m5, 5);
|
||||
}
|
||||
|
||||
@@ -491,7 +491,7 @@ static inline void SetCrossingBarred(TileIndex t, bool barred)
|
||||
*/
|
||||
static inline bool IsCrossingPossiblyOccupiedByRoadVehicle(TileIndex t)
|
||||
{
|
||||
assert_tile(IsLevelCrossing(t), t);
|
||||
dbg_assert_tile(IsLevelCrossing(t), t);
|
||||
return HasBit(_m[t].m5, 1);
|
||||
}
|
||||
|
||||
@@ -622,7 +622,7 @@ static inline void TerminateRoadWorks(TileIndex t)
|
||||
*/
|
||||
static inline DiagDirection GetRoadDepotDirection(TileIndex t)
|
||||
{
|
||||
assert_tile(IsRoadDepot(t), t);
|
||||
dbg_assert_tile(IsRoadDepot(t), t);
|
||||
return (DiagDirection)GB(_m[t].m5, 0, 2);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user