summaryrefslogtreecommitdiff
path: root/src/station_map.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2007-02-21 19:46:37 +0000
committertron <tron@openttd.org>2007-02-21 19:46:37 +0000
commitf716c0b30ffb5db1ad81a9015f03cb07fb4c9351 (patch)
tree327b9afd9d4879eddc62a6cecd008a805989849d /src/station_map.h
parent45b662c679e0f443883e2408b9db4614e95fc3e4 (diff)
downloadopenttd-f716c0b30ffb5db1ad81a9015f03cb07fb4c9351.tar.xz
(svn r8833) -Fix
-Codechange: Split MakeRoadStop() into MakeRoadStop() and MakeDriveThroughRoadStop() for more clarity and less possibilities to use it incorrect
Diffstat (limited to 'src/station_map.h')
-rw-r--r--src/station_map.h19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/station_map.h b/src/station_map.h
index 49f759118..f71fd217a 100644
--- a/src/station_map.h
+++ b/src/station_map.h
@@ -169,11 +169,6 @@ static inline bool GetStopBuiltOnTownRoad(TileIndex t)
return HASBIT(_m[t].m6, 3);
}
-static inline void SetStopBuiltOnTownRoad(TileIndex t)
-{
- assert(IsDriveThroughStopTile(t));
- SETBIT(_m[t].m6, 3);
-}
/**
* Gets the direction the road stop entrance points towards.
@@ -312,13 +307,15 @@ static inline void MakeRailStation(TileIndex t, Owner o, StationID sid, Axis a,
SetRailType(t, rt);
}
-static inline void MakeRoadStop(TileIndex t, Owner o, StationID sid, RoadStop::Type rst, bool is_drive_through, DiagDirection d)
+static inline void MakeRoadStop(TileIndex t, Owner o, StationID sid, RoadStop::Type rst, DiagDirection d)
{
- if (is_drive_through) {
- MakeStation(t, o, sid, (rst == RoadStop::BUS ? GFX_BUS_BASE_EXT : GFX_TRUCK_BASE_EXT) + d);
- } else {
- MakeStation(t, o, sid, (rst == RoadStop::BUS ? GFX_BUS_BASE : GFX_TRUCK_BASE) + d);
- }
+ MakeStation(t, o, sid, (rst == RoadStop::BUS ? GFX_BUS_BASE : GFX_TRUCK_BASE) + d);
+}
+
+static inline void MakeDriveThroughRoadStop(TileIndex t, Owner o, StationID sid, RoadStop::Type rst, Axis a, bool on_town_road)
+{
+ MakeStation(t, o, sid, (rst == RoadStop::BUS ? GFX_BUS_BASE_EXT : GFX_TRUCK_BASE_EXT) + a);
+ SB(_m[t].m6, 3, 1, on_town_road);
}
static inline void MakeAirport(TileIndex t, Owner o, StationID sid, byte section)