From a7399c5111cc7ebeea284498a1ee5ac7542bb96d Mon Sep 17 00:00:00 2001 From: Peter Kohaut Date: Sat, 31 Aug 2019 23:06:30 +0200 Subject: BLADERUNNER: Use best pixel format on every platform Updated all drawing routines to be pixel format agnostic. Might decrease performance. --- engines/bladerunner/shape.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/bladerunner/shape.cpp') diff --git a/engines/bladerunner/shape.cpp b/engines/bladerunner/shape.cpp index de7a572fa6..60fa869fc1 100644 --- a/engines/bladerunner/shape.cpp +++ b/engines/bladerunner/shape.cpp @@ -112,11 +112,11 @@ void Shape::draw(Graphics::Surface &surface, int x, int y) const { uint8 a, r, g, b; gameDataPixelFormat().colorToARGB(shpColor, a, r, g, b); - // Ignore the alpha in the output as it is inversed in the input - uint16 outColor = (uint16)surface.format.RGBToColor(r, g, b); if (!a) { - *(uint16 *)(surface.getBasePtr(CLIP(dst_x + xi, 0, surface.w - 1), CLIP(dst_y + yi, 0, surface.h - 1))) = outColor; + // Ignore the alpha in the output as it is inversed in the input + void *dstPtr = surface.getBasePtr(CLIP(dst_x + xi, 0, surface.w - 1), CLIP(dst_y + yi, 0, surface.h - 1)); + drawPixel(surface, dstPtr, surface.format.RGBToColor(r, g, b)); } } src_p += 2 * (_width - rect_w); -- cgit v1.2.3