mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-10 08:00:05 +00:00
Codechange: move sign invisibility check out of loop
This commit is contained in:
parent
9016d4a5b5
commit
f48baa7d00
@ -1417,6 +1417,9 @@ static void ViewportAddKdtreeSigns(DrawPixelInfo *dpi)
|
|||||||
t->index, t->cache.population);
|
t->index, t->cache.population);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Do not draw signs nor station names if they are set invisible */
|
||||||
|
if (IsInvisibilitySet(TO_SIGNS)) return;
|
||||||
|
|
||||||
for (const auto *si : signs) {
|
for (const auto *si : signs) {
|
||||||
ViewportAddString(dpi, ZOOM_LVL_OUT_16X, &si->sign,
|
ViewportAddString(dpi, ZOOM_LVL_OUT_16X, &si->sign,
|
||||||
STR_WHITE_SIGN,
|
STR_WHITE_SIGN,
|
||||||
@ -1701,9 +1704,6 @@ static void ViewportDrawStrings(ZoomLevel zoom, const StringSpriteToDrawVector *
|
|||||||
SetDParam(1, ss.params[1]);
|
SetDParam(1, ss.params[1]);
|
||||||
|
|
||||||
if (ss.colour != INVALID_COLOUR) {
|
if (ss.colour != INVALID_COLOUR) {
|
||||||
/* Do not draw signs nor station names if they are set invisible */
|
|
||||||
if (IsInvisibilitySet(TO_SIGNS) && ss.string != STR_WHITE_SIGN) continue;
|
|
||||||
|
|
||||||
if (IsTransparencySet(TO_SIGNS) && ss.string != STR_WHITE_SIGN) {
|
if (IsTransparencySet(TO_SIGNS) && ss.string != STR_WHITE_SIGN) {
|
||||||
/* Don't draw the rectangle.
|
/* Don't draw the rectangle.
|
||||||
* Real colours need the TC_IS_PALETTE_COLOUR flag.
|
* Real colours need the TC_IS_PALETTE_COLOUR flag.
|
||||||
|
Loading…
Reference in New Issue
Block a user