src/bridge_map.h
changeset 5847 9ce114e1d90d
parent 5726 8f399788f6c9
child 6268 4b5241e5dd10
equal deleted inserted replaced
5846:55f4c68b7616 5847:9ce114e1d90d
    39 
    39 
    40 
    40 
    41 static inline bool IsBridgeAbove(TileIndex t)
    41 static inline bool IsBridgeAbove(TileIndex t)
    42 {
    42 {
    43 	assert(MayHaveBridgeAbove(t));
    43 	assert(MayHaveBridgeAbove(t));
    44 	return GB(_m[t].extra, 6, 2) != 0;
    44 	return GB(_m[t].m6, 6, 2) != 0;
    45 }
    45 }
    46 
    46 
    47 
    47 
    48 /**
    48 /**
    49  * Determines the type of bridge on a tile
    49  * Determines the type of bridge on a tile
    68 
    68 
    69 
    69 
    70 static inline Axis GetBridgeAxis(TileIndex t)
    70 static inline Axis GetBridgeAxis(TileIndex t)
    71 {
    71 {
    72 	assert(IsBridgeAbove(t));
    72 	assert(IsBridgeAbove(t));
    73 	return (Axis)(GB(_m[t].extra, 6, 2) - 1);
    73 	return (Axis)(GB(_m[t].m6, 6, 2) - 1);
    74 }
    74 }
    75 
    75 
    76 
    76 
    77 static inline TransportType GetBridgeTransportType(TileIndex t)
    77 static inline TransportType GetBridgeTransportType(TileIndex t)
    78 {
    78 {
   119 uint GetBridgeFoundation(Slope tileh, Axis axis);
   119 uint GetBridgeFoundation(Slope tileh, Axis axis);
   120 
   120 
   121 static inline void ClearSingleBridgeMiddle(TileIndex t, Axis a)
   121 static inline void ClearSingleBridgeMiddle(TileIndex t, Axis a)
   122 {
   122 {
   123 	assert(MayHaveBridgeAbove(t));
   123 	assert(MayHaveBridgeAbove(t));
   124 	CLRBIT(_m[t].extra, 6 + a);
   124 	CLRBIT(_m[t].m6, 6 + a);
   125 }
   125 }
   126 
   126 
   127 
   127 
   128 static inline void ClearBridgeMiddle(TileIndex t)
   128 static inline void ClearBridgeMiddle(TileIndex t)
   129 {
   129 {
   132 }
   132 }
   133 
   133 
   134 static inline void SetBridgeMiddle(TileIndex t, Axis a)
   134 static inline void SetBridgeMiddle(TileIndex t, Axis a)
   135 {
   135 {
   136 	assert(MayHaveBridgeAbove(t));
   136 	assert(MayHaveBridgeAbove(t));
   137 	SETBIT(_m[t].extra, 6 + a);
   137 	SETBIT(_m[t].m6, 6 + a);
   138 }
   138 }
   139 
   139 
   140 
   140 
   141 static inline void MakeBridgeRamp(TileIndex t, Owner o, uint bridgetype, DiagDirection d, TransportType tt)
   141 static inline void MakeBridgeRamp(TileIndex t, Owner o, uint bridgetype, DiagDirection d, TransportType tt)
   142 {
   142 {