Fix viewport signs and text effects marking viewports dirty unnecessarily

* When at high zoom levels where the signs are not shown
* Where the sign type is disabled in the display options
This commit is contained in:
Jonathan G Rennison
2020-02-17 23:23:15 +00:00
parent 57f490db2b
commit c42ce832ae
10 changed files with 33 additions and 17 deletions

View File

@@ -42,7 +42,8 @@ void Waypoint::UpdateVirtCoord()
if (_viewport_sign_kdtree_valid && this->sign.kdtree_valid) _viewport_sign_kdtree.Remove(ViewportSignKdtreeItem::MakeWaypoint(this->index));
SetDParam(0, this->index);
this->sign.UpdatePosition(pt.x, pt.y - 32 * ZOOM_LVL_BASE, STR_VIEWPORT_WAYPOINT);
bool shown = HasBit(_display_opt, DO_SHOW_WAYPOINT_NAMES) && !(_local_company != this->owner && this->owner != OWNER_NONE && !HasBit(_display_opt, DO_SHOW_COMPETITOR_SIGNS));
this->sign.UpdatePosition(shown ? ZOOM_LVL_DRAW_SPR : ZOOM_LVL_END, pt.x, pt.y - 32 * ZOOM_LVL_BASE, STR_VIEWPORT_WAYPOINT);
if (_viewport_sign_kdtree_valid) _viewport_sign_kdtree.Insert(ViewportSignKdtreeItem::MakeWaypoint(this->index));