* Select or deselect waypoint for rectangle area highlight. * Selecting a waypoint will deselect a town. * @param *wp Waypoint in question * @param sel Select or deselect given waypoint */
| 3780 | * @param sel Select or deselect given waypoint |
| 3781 | */ |
| 3782 | void SetViewportWaypointRect(const Waypoint *wp, bool sel) |
| 3783 | { |
| 3784 | SetWindowDirtyForViewportCatchment(); |
| 3785 | /* Mark tiles dirty for redrawing and update selected waypoint if a different waypoint is already highlighted. */ |
| 3786 | if (sel && _viewport_highlight_waypoint_rect != wp) { |
| 3787 | ClearViewportCatchment(); |
| 3788 | _viewport_highlight_waypoint_rect = wp; |
| 3789 | MarkCatchmentTilesDirty(); |
| 3790 | /* Mark tiles dirty for redrawing and clear waypoint selection if deselecting highlight. */ |
| 3791 | } else if (!sel && _viewport_highlight_waypoint_rect == wp) { |
| 3792 | MarkCatchmentTilesDirty(); |
| 3793 | _viewport_highlight_waypoint_rect = nullptr; |
| 3794 | } |
| 3795 | /* Redraw the currently selected waypoint window */ |
| 3796 | if (_viewport_highlight_waypoint_rect != nullptr) SetWindowDirty(WC_WAYPOINT_VIEW, _viewport_highlight_waypoint_rect->index); |
| 3797 | } |
| 3798 | |
| 3799 | /** |
| 3800 | * Select or deselect town for coverage area highlight. |
no test coverage detected