mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-10-31 15:20:10 +00:00
Avoid window iterations when marking viewports dirty
This commit is contained in:
parent
b93503bb21
commit
68c0fd63dd
@ -4266,9 +4266,8 @@ void ViewportRouteOverlay::MarkAllRouteStepsDirty(const Vehicle *veh)
|
||||
*/
|
||||
void MarkAllViewportMapsDirty(int left, int top, int right, int bottom)
|
||||
{
|
||||
for (Window *w : Window::Iterate()) {
|
||||
Viewport *vp = w->viewport;
|
||||
if (vp != nullptr && vp->zoom >= ZOOM_LVL_DRAW_MAP) {
|
||||
for (Viewport *vp : _viewport_window_cache) {
|
||||
if (vp->zoom >= ZOOM_LVL_DRAW_MAP) {
|
||||
MarkViewportDirty(vp, left, top, right, bottom, VMDF_NOT_LANDSCAPE);
|
||||
}
|
||||
}
|
||||
@ -4302,9 +4301,8 @@ void MarkWholeNonMapViewportsDirty()
|
||||
*/
|
||||
void MarkAllViewportOverlayStationLinksDirty(const Station *st)
|
||||
{
|
||||
for (Window *w : Window::Iterate()) {
|
||||
Viewport *vp = w->viewport;
|
||||
if (vp != nullptr && vp->overlay != nullptr) {
|
||||
for (Viewport *vp : _viewport_window_cache) {
|
||||
if (vp->overlay != nullptr) {
|
||||
vp->overlay->MarkStationViewportLinksDirty(st);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user