From 96d1db97e0bbc689ef9d5d48ee2514bec7c5c7f8 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sun, 6 Sep 2020 22:22:49 +0200 Subject: [PATCH] Fix: Unused variable warning because of if constexpr (#12871) This moves the variable in question to the scope where it gets used. Since it's a reference, this shouldn't be a performance hit. --- src/openrct2/drawing/Drawing.Sprite.RLE.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/drawing/Drawing.Sprite.RLE.cpp b/src/openrct2/drawing/Drawing.Sprite.RLE.cpp index db718df048..1e5d49a712 100644 --- a/src/openrct2/drawing/Drawing.Sprite.RLE.cpp +++ b/src/openrct2/drawing/Drawing.Sprite.RLE.cpp @@ -92,7 +92,6 @@ template static void FASTCALL DrawRLESpriteM auto srcY = args.SrcY; auto width = args.Width; auto height = args.Height; - auto& paletteMap = args.PalMap; auto zoom = 1 << TZoom; auto dstLineWidth = (static_cast(dpi->width) >> TZoom) + dpi->pitch; @@ -166,6 +165,7 @@ template static void FASTCALL DrawRLESpriteM } else { + auto& paletteMap = args.PalMap; while (numPixels > 0) { BlitPixel(src, dst, paletteMap);