src/road_map.h
changeset 8744 099f75f4b51f
parent 8734 cf2c240d2e1b
child 9111 48ce04029fe4
equal deleted inserted replaced
8743:83eeb388f213 8744:099f75f4b51f
    61 		default: NOT_REACHED();
    61 		default: NOT_REACHED();
    62 		case ROADTYPE_ROAD: return (RoadBits)GB(_m[t].m4, 0, 4);
    62 		case ROADTYPE_ROAD: return (RoadBits)GB(_m[t].m4, 0, 4);
    63 		case ROADTYPE_TRAM: return (RoadBits)GB(_m[t].m4, 4, 4);
    63 		case ROADTYPE_TRAM: return (RoadBits)GB(_m[t].m4, 4, 4);
    64 		case ROADTYPE_HWAY: return (RoadBits)GB(_m[t].m6, 2, 4);
    64 		case ROADTYPE_HWAY: return (RoadBits)GB(_m[t].m6, 2, 4);
    65 	}
    65 	}
       
    66 }
       
    67 
       
    68 /**
       
    69  * Get all RoadBits set on a tile except from the given RoadType
       
    70  *
       
    71  * @param t The tile from which we want to get the RoadBits
       
    72  * @param rt The RoadType which we exclude from the querry
       
    73  * @return all set RoadBits of the tile which are not from the given RoadType
       
    74  */
       
    75 static inline RoadBits GetOtherRoadBits(TileIndex t, RoadType rt)
       
    76 {
       
    77 	return ((rt == ROADTYPE_ROAD) ? ROAD_NONE : GetRoadBits(t, ROADTYPE_ROAD)) |
       
    78 		((rt == ROADTYPE_TRAM) ? ROAD_NONE : GetRoadBits(t, ROADTYPE_TRAM)) |
       
    79 		((rt == ROADTYPE_HWAY) ? ROAD_NONE : GetRoadBits(t, ROADTYPE_HWAY));
    66 }
    80 }
    67 
    81 
    68 /**
    82 /**
    69  * Get all set RoadBits on the given tile
    83  * Get all set RoadBits on the given tile
    70  *
    84  *