From bb3e100c548a559caf97a4304c1c24744c892f37 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 8 Jun 2020 23:13:01 +0200 Subject: [PATCH] - fixed bad bit operations when calculating the base palette remap. The code assumed that the alpha channel is empty, but at this point it already contains the base palette's transparency info and needs to be masked out when using it differently. --- src/common/utility/palette.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/utility/palette.cpp b/src/common/utility/palette.cpp index f4876b4b9..f2a2987b3 100644 --- a/src/common/utility/palette.cpp +++ b/src/common/utility/palette.cpp @@ -444,7 +444,7 @@ void MakeGoodRemap(uint32_t* BaseColors, uint8_t* Remap) for (i = 0; i < 256; ++i) { - sortcopy[i] = BaseColors[i] | (i << 24); + sortcopy[i] = (BaseColors[i] & 0xffffff) | (i << 24); } qsort(sortcopy, 256, 4, sortforremap); for (i = 255; i > 0; --i)