From a8b9ce8a5460b9f7470c83084ceacd00d6b31506 Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Tue, 13 Aug 2024 19:19:15 +0100 Subject: [PATCH] Fix incorrect lightmap colors --- project/code/LGS/Database/Chunks/WorldRep.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/project/code/LGS/Database/Chunks/WorldRep.cs b/project/code/LGS/Database/Chunks/WorldRep.cs index a07a102..5ea36a7 100644 --- a/project/code/LGS/Database/Chunks/WorldRep.cs +++ b/project/code/LGS/Database/Chunks/WorldRep.cs @@ -134,7 +134,8 @@ public class WorldRep : IChunk var raw2 = Pixels[layer, y, x, 0] + (Pixels[layer, y, x, 1] << 8); return new Vector4(raw2 & 31, (raw2 >> 5) & 31, (raw2 >> 10) & 31, 31) / 31.0f; case 4: - return new Vector4(Pixels[layer, y, x, 0], Pixels[layer, y, x, 1], Pixels[layer, y, x, 2], Pixels[layer, y, x, 3]) / 255.0f; + // 4bpp stored as BGRA + return new Vector4(Pixels[layer, y, x, 2], Pixels[layer, y, x, 1], Pixels[layer, y, x, 0], Pixels[layer, y, x, 3]) / 255.0f; default: return Vector4.Zero; }