From a9caeaa7f1f730cb0c63cea22b30aae8d7f1b3f9 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Thu, 19 May 2022 00:09:14 +0100 Subject: [PATCH] Fix viewport map scrolling box blend on emscripten --- src/viewport.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/viewport.cpp b/src/viewport.cpp index 3dbf20e542..8eb6345d1d 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -3127,6 +3127,10 @@ uint32 ViewportMapGetColour(const Viewport * const vp, int x, int y, const uint /* Taken from http://stereopsis.com/doubleblend.html, PixelBlend() is faster than ComposeColourRGBANoCheck() */ static inline void PixelBlend(uint32 * const d, const uint32 s) { +#if defined(__EMSCRIPTEN__) + *d = Blitter_32bppBase::ComposeColourRGBANoCheck(s & 0xFF, (s >> 8) & 0xFF, (s >> 16) & 0xFF, (s >> 24) & 0xFF, Colour(*d)).data; + return; +#endif const uint32 a = (s >> 24) + 1; const uint32 dstrb = *d & 0xFF00FF; const uint32 dstg = *d & 0xFF00;