From 8c9da63aa597ecc508c8b13e991ef28bb8e44306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Thu, 20 Jul 2017 19:09:22 +0200 Subject: [PATCH] Make drawing loop only depend on loop counter (#5954) --- src/openrct2/drawing/X8DrawingEngine.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/openrct2/drawing/X8DrawingEngine.cpp b/src/openrct2/drawing/X8DrawingEngine.cpp index 699a6f715d..bf167c8ce7 100644 --- a/src/openrct2/drawing/X8DrawingEngine.cpp +++ b/src/openrct2/drawing/X8DrawingEngine.cpp @@ -713,13 +713,11 @@ void X8DrawingContext::FilterRect(FILTER_PALETTE_ID palette, sint32 left, sint32 // Fill the rectangle with the colours from the colour table for (sint32 i = 0; i < height >> dpi->zoom_level; i++) { - uint8 * nextdst = dst + (dpi->width >> dpi->zoom_level) + dpi->pitch; + uint8 * nextdst = dst + ((dpi->width >> dpi->zoom_level) + dpi->pitch) * i; for (sint32 j = 0; j < (width >> dpi->zoom_level); j++) { - *dst = g1Bits[*dst]; - dst++; + *(nextdst + j) = g1Bits[*(nextdst + j)]; } - dst = nextdst; } }