diff options
author | rubidium <rubidium@openttd.org> | 2007-05-20 19:14:08 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-05-20 19:14:08 +0000 |
commit | d86b5e5e9328e85faa1bf97615b8c796fc874863 (patch) | |
tree | 040143187639f8855d9618bfc8f784f4a42bbaeb /src/bridge_map.h | |
parent | c685a7179f58e8df5e64b424d4f320723e07b65c (diff) | |
download | openttd-d86b5e5e9328e85faa1bf97615b8c796fc874863.tar.xz |
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
Diffstat (limited to 'src/bridge_map.h')
-rw-r--r-- | src/bridge_map.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/bridge_map.h b/src/bridge_map.h index 5f270dc1a..062bfc0c8 100644 --- a/src/bridge_map.h +++ b/src/bridge_map.h @@ -211,7 +211,6 @@ static inline void SetBridgeMiddle(TileIndex t, Axis a) SETBIT(_m[t].m6, 6 + a); } - /** * Generic part to make a bridge ramp for both roads and rails. * @param t the tile to make a bridge ramp @@ -219,13 +218,15 @@ static inline void SetBridgeMiddle(TileIndex t, Axis a) * @param bridgetype the type of bridge this bridge ramp belongs to * @param d the direction this ramp must be facing * @param tt the transport type of the bridge + * @param rt the road or rail type * @note this function should not be called directly. */ -static inline void MakeBridgeRamp(TileIndex t, Owner o, uint bridgetype, DiagDirection d, TransportType tt) +static inline void MakeBridgeRamp(TileIndex t, Owner o, uint bridgetype, DiagDirection d, TransportType tt, uint rt) { SetTileType(t, MP_TUNNELBRIDGE); SetTileOwner(t, o); _m[t].m2 = bridgetype << 4; + _m[t].m3 = rt; _m[t].m4 = 0; _m[t].m5 = 1 << 7 | tt << 2 | d; } @@ -236,11 +237,11 @@ static inline void MakeBridgeRamp(TileIndex t, Owner o, uint bridgetype, DiagDir * @param o the new owner of the bridge ramp * @param bridgetype the type of bridge this bridge ramp belongs to * @param d the direction this ramp must be facing + * @param r the road type of the bridge */ -static inline void MakeRoadBridgeRamp(TileIndex t, Owner o, uint bridgetype, DiagDirection d) +static inline void MakeRoadBridgeRamp(TileIndex t, Owner o, uint bridgetype, DiagDirection d, RoadTypes r) { - MakeBridgeRamp(t, o, bridgetype, d, TRANSPORT_ROAD); - _m[t].m3 = 0; + MakeBridgeRamp(t, o, bridgetype, d, TRANSPORT_ROAD, r); } /** @@ -253,8 +254,7 @@ static inline void MakeRoadBridgeRamp(TileIndex t, Owner o, uint bridgetype, Dia */ static inline void MakeRailBridgeRamp(TileIndex t, Owner o, uint bridgetype, DiagDirection d, RailType r) { - MakeBridgeRamp(t, o, bridgetype, d, TRANSPORT_RAIL); - _m[t].m3 = r; + MakeBridgeRamp(t, o, bridgetype, d, TRANSPORT_RAIL, r); } |