Viewport: Cache landscape pixels in map mode

Avoid invalidating landscape pixels for non-landscape updates
(vehicles, overlays, etc.)
This commit is contained in:
Jonathan G Rennison
2020-10-01 23:11:15 +01:00
parent 8071976b0e
commit a474e71243
23 changed files with 268 additions and 143 deletions

View File

@@ -410,7 +410,7 @@ void ZoningMarkDirtyStationCoverageArea(const Station *st, ZoningModeMask mask)
Rect rect = st->GetCatchmentRectUsingRadius(radius);
for (int y = rect.top; y <= rect.bottom; y++) {
for (int x = rect.left; x <= rect.right; x++) {
MarkTileDirtyByTile(TileXY(x, y));
MarkTileDirtyByTile(TileXY(x, y), VMDF_NOT_MAP_MODE);
}
}
auto invalidate_cache_rect = [&](btree::btree_set<uint32> &cache) {
@@ -441,7 +441,7 @@ void ZoningTownAuthorityRatingChange()
if (_zoning.inner == ZEM_AUTHORITY) mask |= ZMM_INNER;
if (_zoning.outer == ZEM_AUTHORITY) mask |= ZMM_OUTER;
if (mask != ZMM_NOTHING) {
MarkWholeScreenDirty();
MarkWholeNonMapViewportsDirty();
}
}
@@ -460,5 +460,5 @@ void SetZoningMode(bool inner, ZoningEvaluationMode mode)
current_mode = mode;
cache.clear();
MarkWholeScreenDirty();
MarkWholeNonMapViewportsDirty();
}