rail_map.h
changeset 3933 231ae3c419f4
parent 3900 2c84ed52709d
child 3977 513433ebd092
equal deleted inserted replaced
3932:dfe10fa5ce4f 3933:231ae3c419f4
    79 static inline RailType GetRailTypeCrossing(TileIndex t)
    79 static inline RailType GetRailTypeCrossing(TileIndex t)
    80 {
    80 {
    81 	return (RailType)GB(_m[t].m4, 0, 4);
    81 	return (RailType)GB(_m[t].m4, 0, 4);
    82 }
    82 }
    83 
    83 
    84 static inline RailType GetRailTypeOnBridge(TileIndex t)
       
    85 {
       
    86 	return (RailType)GB(_m[t].m3, 4, 4);
       
    87 }
       
    88 
       
    89 static inline void SetRailType(TileIndex t, RailType r)
    84 static inline void SetRailType(TileIndex t, RailType r)
    90 {
    85 {
    91 	SB(_m[t].m3, 0, 4, r);
    86 	SB(_m[t].m3, 0, 4, r);
    92 }
    87 }
    93 
    88 
    94 // TODO remove this by moving to the same bits as SetRailType()
    89 // TODO remove this by moving to the same bits as SetRailType()
    95 static inline void SetRailTypeCrossing(TileIndex t, RailType r)
    90 static inline void SetRailTypeCrossing(TileIndex t, RailType r)
    96 {
    91 {
    97 	SB(_m[t].m4, 0, 4, r);
    92 	SB(_m[t].m4, 0, 4, r);
    98 }
       
    99 
       
   100 static inline void SetRailTypeOnBridge(TileIndex t, RailType r)
       
   101 {
       
   102 	SB(_m[t].m3, 4, 4, r);
       
   103 }
    93 }
   104 
    94 
   105 
    95 
   106 /** These are used to specify a single track.
    96 /** These are used to specify a single track.
   107  * Can be translated to a trackbit with TrackToTrackbit */
    97  * Can be translated to a trackbit with TrackToTrackbit */