* Draws the catenary for the given tile * @param ti information about the tile (slopes, height etc) */
| 1439 | * @param ti information about the tile (slopes, height etc) |
| 1440 | */ |
| 1441 | void DrawRoadCatenary(const TileInfo *ti) |
| 1442 | { |
| 1443 | RoadBits road = ROAD_NONE; |
| 1444 | RoadBits tram = ROAD_NONE; |
| 1445 | |
| 1446 | if (IsTileType(ti->tile, MP_ROAD)) { |
| 1447 | if (IsNormalRoad(ti->tile)) { |
| 1448 | road = GetRoadBits(ti->tile, RTT_ROAD); |
| 1449 | tram = GetRoadBits(ti->tile, RTT_TRAM); |
| 1450 | } else if (IsLevelCrossing(ti->tile)) { |
| 1451 | tram = road = (GetCrossingRailAxis(ti->tile) == AXIS_Y ? ROAD_X : ROAD_Y); |
| 1452 | } |
| 1453 | } else if (IsTileType(ti->tile, MP_STATION)) { |
| 1454 | if (IsAnyRoadStop(ti->tile)) { |
| 1455 | if (IsDriveThroughStopTile(ti->tile)) { |
| 1456 | Axis axis = GetDriveThroughStopAxis(ti->tile); |
| 1457 | tram = road = (axis == AXIS_X ? ROAD_X : ROAD_Y); |
| 1458 | } else { |
| 1459 | tram = road = DiagDirToRoadBits(GetBayRoadStopDir(ti->tile)); |
| 1460 | } |
| 1461 | } |
| 1462 | } else { |
| 1463 | /* No road here, no catenary to draw */ |
| 1464 | return; |
| 1465 | } |
| 1466 | |
| 1467 | RoadType rt = GetRoadTypeRoad(ti->tile); |
| 1468 | if (rt != INVALID_ROADTYPE && HasRoadCatenaryDrawn(rt)) { |
| 1469 | DrawRoadTypeCatenary(ti, rt, road); |
| 1470 | } |
| 1471 | |
| 1472 | rt = GetRoadTypeTram(ti->tile); |
| 1473 | if (rt != INVALID_ROADTYPE && HasRoadCatenaryDrawn(rt)) { |
| 1474 | DrawRoadTypeCatenary(ti, rt, tram); |
| 1475 | } |
| 1476 | } |
| 1477 | |
| 1478 | /** |
| 1479 | * Draws details on/around the road |
no test coverage detected