diff options
author | rubidium <rubidium@openttd.org> | 2012-03-25 19:24:32 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2012-03-25 19:24:32 +0000 |
commit | 180e4e4c66659e3fb06cdb9dfad51f5d6ef2736a (patch) | |
tree | c542cea12ca35ae82d27a01bdd2d822cbd6306f8 | |
parent | 6db0753a46eea1d3af2a614811d37c9d804e59ac (diff) | |
download | openttd-180e4e4c66659e3fb06cdb9dfad51f5d6ef2736a.tar.xz |
(svn r24067) -Change/fix: do not redraw up to 25% of the map when making a new vehicle visible for the first time
-rw-r--r-- | src/vehicle.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
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 + ); + } } } |