From 180e4e4c66659e3fb06cdb9dfad51f5d6ef2736a Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 25 Mar 2012 19:24:32 +0000 Subject: (svn r24067) -Change/fix: do not redraw up to 25% of the map when making a new vehicle visible for the first time --- src/vehicle.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/vehicle.cpp b/src/vehicle.cpp index c6abc3f25..4851a4529 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -1416,12 +1416,16 @@ void VehicleUpdateViewport(Vehicle *v, bool dirty) v->coord.bottom = pt.y + spr->height + 2 * ZOOM_LVL_BASE; if (dirty) { - MarkAllViewportsDirty( - min(old_coord.left, v->coord.left), - min(old_coord.top, v->coord.top), - max(old_coord.right, v->coord.right) + 1 * ZOOM_LVL_BASE, - max(old_coord.bottom, v->coord.bottom) + 1 * ZOOM_LVL_BASE - ); + if (old_coord.left == INVALID_COORD) { + MarkSingleVehicleDirty(v); + } else { + MarkAllViewportsDirty( + min(old_coord.left, v->coord.left), + min(old_coord.top, v->coord.top), + max(old_coord.right, v->coord.right) + 1 * ZOOM_LVL_BASE, + max(old_coord.bottom, v->coord.bottom) + 1 * ZOOM_LVL_BASE + ); + } } } -- cgit v1.2.3-70-g09d2