From e0902c93a4bf122b4dfa2486f2de7ea6469d3a2e Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sat, 18 Apr 2020 23:06:38 +0100 Subject: [PATCH] Revert "Viewport: Trim parent sprites to redraw area before sorting" This reverts commit f563dfe194769bca14e615d8c2a623aacfd8fd0e. This caused rendering issues with vehicles passing under bridges at the very edge of the drawing area. --- src/viewport.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/viewport.cpp b/src/viewport.cpp index f8d78f5c64..d08c87c32b 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -3097,18 +3097,8 @@ void ViewportDoDraw(ViewPort *vp, int left, int top, int right, int bottom) if (_vd.tile_sprites_to_draw.size() != 0) ViewportDrawTileSprites(&_vd.tile_sprites_to_draw); - { - const int vd_left = _vd.dpi.left; - const int vd_top = _vd.dpi.top; - const int vd_right = _vd.dpi.left + _vd.dpi.width; - const int vd_bottom = _vd.dpi.top + _vd.dpi.height; - for (auto &psd : _vd.parent_sprites_to_draw) { - if (psd.left >= vd_right) continue; - if (psd.top >= vd_bottom) continue; - if (psd.left + psd.width <= vd_left) continue; - if (psd.top + psd.height <= vd_top) continue; - _vd.parent_sprites_to_sort.push_back(&psd); - } + for (auto &psd : _vd.parent_sprites_to_draw) { + _vd.parent_sprites_to_sort.push_back(&psd); } ViewportProcessParentSprites();