From 12a0c87bfd80b179606d05ee377be7b75d6f4f12 Mon Sep 17 00:00:00 2001 From: Jeroen D Stout Date: Sat, 4 Jun 2016 16:22:14 +0200 Subject: [PATCH] Culling based on viewport for zoom levels --- src/drawing/lightfx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/drawing/lightfx.c b/src/drawing/lightfx.c index 43365ab49e..aca15052a6 100644 --- a/src/drawing/lightfx.c +++ b/src/drawing/lightfx.c @@ -171,6 +171,9 @@ void lightfx_prepare_light_list() sint32 posOnScreenX = entry->x - _current_view_x_front; sint32 posOnScreenY = entry->y - _current_view_y_front; + posOnScreenX >>= _current_view_zoom_front; + posOnScreenY >>= _current_view_zoom_front; + if ((posOnScreenX < -128) || (posOnScreenY < -128) || (posOnScreenX > _pixelInfo.width + 128) ||