* Add sign strings to a viewport. * @param dpi Current viewport area. * @param signs List of signs to add. * @param small Add small versions of strings. */
| 1399 | * @param small Add small versions of strings. |
| 1400 | */ |
| 1401 | static void ViewportAddSignStrings(DrawPixelInfo *dpi, const std::vector<const Sign *> &signs, bool small) |
| 1402 | { |
| 1403 | ViewportStringFlags flags{}; |
| 1404 | if (small) flags.Set(ViewportStringFlag::Small); |
| 1405 | |
| 1406 | /* Signs placed by a game script don't have a frame. */ |
| 1407 | ViewportStringFlags deity_flags{flags}; |
| 1408 | flags.Set(IsTransparencySet(TO_SIGNS) ? ViewportStringFlag::TransparentRect : ViewportStringFlag::ColourRect); |
| 1409 | |
| 1410 | for (const Sign *si : signs) { |
| 1411 | std::string *str = ViewportAddString(dpi, &si->sign, (si->owner == OWNER_DEITY) ? deity_flags : flags, |
| 1412 | (si->owner == OWNER_NONE) ? COLOUR_GREY : (si->owner == OWNER_DEITY ? INVALID_COLOUR : _company_colours[si->owner])); |
| 1413 | if (str == nullptr) continue; |
| 1414 | |
| 1415 | *str = GetString(STR_SIGN_NAME, si->index); |
| 1416 | } |
| 1417 | } |
| 1418 | |
| 1419 | /** |
| 1420 | * Add station strings to a viewport. |
no test coverage detected