Clear cell anim light palette

This commit is contained in:
Jarrod Doyle 2024-10-05 16:27:35 +01:00
parent 0bcf24f640
commit 0a4dcc6de0
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
2 changed files with 6 additions and 4 deletions

View File

@ -323,7 +323,7 @@ public class WorldRep : IChunk
public uint IndexCount { get; set; } public uint IndexCount { get; set; }
public byte[] Indices { get; set; } public byte[] Indices { get; set; }
public Plane[] Planes { get; set; } public Plane[] Planes { get; set; }
public ushort[] AnimLights { get; set; } public List<ushort> AnimLights { get; set; }
public LightmapInfo[] LightList { get; set; } public LightmapInfo[] LightList { get; set; }
public Lightmap[] Lightmaps { get; set; } public Lightmap[] Lightmaps { get; set; }
public int LightIndexCount { get; set; } public int LightIndexCount { get; set; }
@ -370,10 +370,10 @@ public class WorldRep : IChunk
{ {
Planes[i] = new Plane(reader.ReadVec3(), reader.ReadSingle()); Planes[i] = new Plane(reader.ReadVec3(), reader.ReadSingle());
} }
AnimLights = new ushort[AnimLightCount]; AnimLights = new List<ushort>(AnimLightCount);
for (var i = 0; i < AnimLightCount; i++) for (var i = 0; i < AnimLightCount; i++)
{ {
AnimLights[i] = reader.ReadUInt16(); AnimLights.Add(reader.ReadUInt16());
} }
LightList = new LightmapInfo[RenderPolyCount]; LightList = new LightmapInfo[RenderPolyCount];
for (var i = 0; i < RenderPolyCount; i++) for (var i = 0; i < RenderPolyCount; i++)

View File

@ -352,7 +352,9 @@ class Program
Parallel.ForEach(wr.Cells, cell => Parallel.ForEach(wr.Cells, cell =>
{ {
// TODO: Reset cell anim light count and palette // Reset cell AnimLight palette
cell.AnimLightCount = 0;
cell.AnimLights.Clear();
var numPolys = cell.PolyCount; var numPolys = cell.PolyCount;
var numRenderPolys = cell.RenderPolyCount; var numRenderPolys = cell.RenderPolyCount;