* Return the colour a tile would be displayed with in the small map in mode "Routes". * * @param tile The tile of which we would like to get the colour. * @param t Effective tile type of the tile (see #SmallMapWindow::GetTileColours). * @return The colour of tile in the small map in mode "Routes" */
| 466 | * @return The colour of tile in the small map in mode "Routes" |
| 467 | */ |
| 468 | static inline uint32_t GetSmallMapRoutesPixels(TileIndex tile, TileType t) |
| 469 | { |
| 470 | switch (t) { |
| 471 | case MP_STATION: |
| 472 | switch (GetStationType(tile)) { |
| 473 | case StationType::Rail: return MKCOLOUR_XXXX(PC_VERY_DARK_BROWN); |
| 474 | case StationType::Airport: return MKCOLOUR_XXXX(PC_RED); |
| 475 | case StationType::Truck: return MKCOLOUR_XXXX(PC_ORANGE); |
| 476 | case StationType::Bus: return MKCOLOUR_XXXX(PC_YELLOW); |
| 477 | case StationType::Dock: return MKCOLOUR_XXXX(PC_LIGHT_BLUE); |
| 478 | default: return MKCOLOUR_FFFF; |
| 479 | } |
| 480 | |
| 481 | case MP_RAILWAY: { |
| 482 | AndOr andor = { |
| 483 | MKCOLOUR_0XX0(GetRailTypeInfo(GetRailType(tile))->map_colour), |
| 484 | _smallmap_contours_andor[t].mand |
| 485 | }; |
| 486 | |
| 487 | const SmallMapColourScheme *cs = &_heightmap_schemes[_settings_client.gui.smallmap_land_colour]; |
| 488 | return ApplyMask(cs->default_colour, &andor); |
| 489 | } |
| 490 | |
| 491 | case MP_ROAD: { |
| 492 | const RoadTypeInfo *rti = nullptr; |
| 493 | if (GetRoadTypeRoad(tile) != INVALID_ROADTYPE) { |
| 494 | rti = GetRoadTypeInfo(GetRoadTypeRoad(tile)); |
| 495 | } else { |
| 496 | rti = GetRoadTypeInfo(GetRoadTypeTram(tile)); |
| 497 | } |
| 498 | if (rti != nullptr) { |
| 499 | AndOr andor = { |
| 500 | MKCOLOUR_0XX0(rti->map_colour), |
| 501 | _smallmap_contours_andor[t].mand |
| 502 | }; |
| 503 | |
| 504 | const SmallMapColourScheme *cs = &_heightmap_schemes[_settings_client.gui.smallmap_land_colour]; |
| 505 | return ApplyMask(cs->default_colour, &andor); |
| 506 | } |
| 507 | [[fallthrough]]; |
| 508 | } |
| 509 | |
| 510 | default: |
| 511 | /* Ground colour */ |
| 512 | const SmallMapColourScheme *cs = &_heightmap_schemes[_settings_client.gui.smallmap_land_colour]; |
| 513 | return ApplyMask(cs->default_colour, &_smallmap_contours_andor[t]); |
| 514 | } |
| 515 | } |
| 516 | |
| 517 | /** |
| 518 | * Return the colour a tile would be displayed with in the small map in mode "link stats". |
no test coverage detected