Rescale the custom palette from 0-128.

This commit is contained in:
Paul Chote
2013-10-26 19:15:05 +13:00
parent ff21ec1605
commit 536013f2d2

View File

@@ -42,8 +42,10 @@ namespace OpenRA.Mods.RA
for (var i = 0; i < 256; i++) for (var i = 0; i < 256; i++)
{ {
// The custom palette is scaled into the range 0-128.
// This makes the move-flash match the original game, but may not be correct in other cases.
var packed = s.ReadUInt16(); var packed = s.ReadUInt16();
colors[i] = (uint)((255 << 24) | ((packed & 0xF800) << 8) | ((packed & 0x7E0) << 5) | ((packed & 0x1f) << 3)); colors[i] = (uint)((255 << 24) | ((packed & 0xF800) << 7) | ((packed & 0x7E0) << 4) | ((packed & 0x1f) << 2));
} }
} }