mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-10 08:17:05 +00:00
(svn r24067) -Change/fix: do not redraw up to 25% of the map when making a new vehicle visible for the first time
This commit is contained in:
parent
6db0753a46
commit
180e4e4c66
@ -1416,6 +1416,9 @@ void VehicleUpdateViewport(Vehicle *v, bool dirty)
|
|||||||
v->coord.bottom = pt.y + spr->height + 2 * ZOOM_LVL_BASE;
|
v->coord.bottom = pt.y + spr->height + 2 * ZOOM_LVL_BASE;
|
||||||
|
|
||||||
if (dirty) {
|
if (dirty) {
|
||||||
|
if (old_coord.left == INVALID_COORD) {
|
||||||
|
MarkSingleVehicleDirty(v);
|
||||||
|
} else {
|
||||||
MarkAllViewportsDirty(
|
MarkAllViewportsDirty(
|
||||||
min(old_coord.left, v->coord.left),
|
min(old_coord.left, v->coord.left),
|
||||||
min(old_coord.top, v->coord.top),
|
min(old_coord.top, v->coord.top),
|
||||||
@ -1423,6 +1426,7 @@ void VehicleUpdateViewport(Vehicle *v, bool dirty)
|
|||||||
max(old_coord.bottom, v->coord.bottom) + 1 * ZOOM_LVL_BASE
|
max(old_coord.bottom, v->coord.bottom) + 1 * ZOOM_LVL_BASE
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user