Fix bugged lightmaps

This commit is contained in:
Jarrod Doyle 2024-08-29 17:15:22 +01:00
parent e7e9c300fd
commit 0b347f7745
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
1 changed files with 4 additions and 4 deletions

View File

@ -154,10 +154,10 @@ public class WorldRep : IChunk
ArgumentOutOfRangeException.ThrowIfLessThan(layer, 0, nameof(layer)); ArgumentOutOfRangeException.ThrowIfLessThan(layer, 0, nameof(layer));
ArgumentOutOfRangeException.ThrowIfGreaterThan(layer, Layers, nameof(layer)); ArgumentOutOfRangeException.ThrowIfGreaterThan(layer, Layers, nameof(layer));
var pixelCount = Width * Height; var pIdx = layer * Bpp * Width * Height;
var pIdx = layer * Bpp * pixelCount; var length = 4 * Width * Height;
var bytes = new byte[pixelCount * 4]; var bytes = new byte[length];
for (var i = 0; i < pixelCount; i += 4, pIdx += Bpp) for (var i = 0; i < length; i += 4, pIdx += Bpp)
{ {
switch (Bpp) switch (Bpp)
{ {