From d653614e7550564ca41ff94bbddf2bb29d85265d Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sat, 27 Oct 2018 15:04:23 -0700 Subject: [PATCH] Replicate palette high bits into the low bits Previously we didn't quite get the full range -- the most intense value we could produce was 0xfc. --- OpenRA.Game/Graphics/Palette.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OpenRA.Game/Graphics/Palette.cs b/OpenRA.Game/Graphics/Palette.cs index 7f1a38d47b..8d4eb6bc46 100644 --- a/OpenRA.Game/Graphics/Palette.cs +++ b/OpenRA.Game/Graphics/Palette.cs @@ -117,6 +117,12 @@ namespace OpenRA.Graphics var r = (byte)(reader.ReadByte() << 2); var g = (byte)(reader.ReadByte() << 2); var b = (byte)(reader.ReadByte() << 2); + + // Replicate high bits into the (currently zero) low bits. + r |= (byte)(r >> 6); + g |= (byte)(g >> 6); + b |= (byte)(b >> 6); + colors[i] = (uint)((255 << 24) | (r << 16) | (g << 8) | b); }