(svn r4386) -Codechange: Add and make use of IsCustomWaypoint

This commit is contained in:
celestar 2006-04-12 13:25:32 +00:00
parent 5d94951496
commit b03bd97b47
2 changed files with 6 additions and 1 deletions

View File

@ -1308,7 +1308,7 @@ static void DrawTile_Track(TileInfo *ti)
if (ti->tileh != 0) DrawFoundation(ti, ti->tileh); if (ti->tileh != 0) DrawFoundation(ti, ti->tileh);
if (IsRailWaypoint(ti->tile) && HASBIT(_m[ti->tile].m3, 4)) { if (IsRailWaypoint(ti->tile) && IsCustomWaypoint(ti->tile)) {
// look for customization // look for customization
byte stat_id = GetWaypointByTile(ti->tile)->stat_id; byte stat_id = GetWaypointByTile(ti->tile)->stat_id;
const StationSpec *stat = GetCustomStation(STAT_CLASS_WAYP, stat_id); const StationSpec *stat = GetCustomStation(STAT_CLASS_WAYP, stat_id);

View File

@ -144,6 +144,11 @@ static inline void ClearCustomWaypointSprite(TileIndex t)
CLRBIT(_m[t].m3, 4); CLRBIT(_m[t].m3, 4);
} }
static inline bool IsCustomWaypoint(TileIndex t)
{
return HASBIT(_m[t].m3, 4);
}
static inline Axis GetWaypointAxis(TileIndex t) static inline Axis GetWaypointAxis(TileIndex t)
{ {
return HASBIT(_m[t].m5, 0) ? AXIS_Y : AXIS_X; return HASBIT(_m[t].m5, 0) ? AXIS_Y : AXIS_X;