Add fast path to ViewportMapDrawVehicles horizontal hash bit check

This commit is contained in:
Jonathan G Rennison
2020-10-06 18:15:56 +01:00
parent cbbea0c8f4
commit e684135e4a

View File

@@ -1619,6 +1619,7 @@ void ViewportMapDrawVehicles(DrawPixelInfo *dpi, Viewport *vp)
Blitter *blitter = BlitterFactory::GetCurrentBlitter();
for (int y = vhb.yl;; y = (y + (1 << 6)) & (0x3F << 6)) {
if (vp->map_draw_vehicles_cache.done_hash_bits[y >> 6] != UINT64_MAX) {
for (int x = vhb.xl;; x = (x + 1) & 0x3F) {
if (!HasBit(vp->map_draw_vehicles_cache.done_hash_bits[y >> 6], x)) {
SetBit(vp->map_draw_vehicles_cache.done_hash_bits[y >> 6], x);
@@ -1639,6 +1640,7 @@ void ViewportMapDrawVehicles(DrawPixelInfo *dpi, Viewport *vp)
if (x == vhb.xu) break;
}
}
if (y == vhb.yu) break;
}