diff --git a/KeepersCompound.LGS/Database/Chunks/WorldRep.cs b/KeepersCompound.LGS/Database/Chunks/WorldRep.cs index a5a69fd..97f4481 100644 --- a/KeepersCompound.LGS/Database/Chunks/WorldRep.cs +++ b/KeepersCompound.LGS/Database/Chunks/WorldRep.cs @@ -323,7 +323,7 @@ public class WorldRep : IChunk public uint IndexCount { get; set; } public byte[] Indices { get; set; } public Plane[] Planes { get; set; } - public ushort[] AnimLights { get; set; } + public List AnimLights { get; set; } public LightmapInfo[] LightList { get; set; } public Lightmap[] Lightmaps { get; set; } public int LightIndexCount { get; set; } @@ -370,10 +370,10 @@ public class WorldRep : IChunk { Planes[i] = new Plane(reader.ReadVec3(), reader.ReadSingle()); } - AnimLights = new ushort[AnimLightCount]; + AnimLights = new List(AnimLightCount); for (var i = 0; i < AnimLightCount; i++) { - AnimLights[i] = reader.ReadUInt16(); + AnimLights.Add(reader.ReadUInt16()); } LightList = new LightmapInfo[RenderPolyCount]; for (var i = 0; i < RenderPolyCount; i++) diff --git a/KeepersCompound.Lightmapper/Program.cs b/KeepersCompound.Lightmapper/Program.cs index b321e38..1c55e47 100644 --- a/KeepersCompound.Lightmapper/Program.cs +++ b/KeepersCompound.Lightmapper/Program.cs @@ -352,7 +352,9 @@ class Program 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 numRenderPolys = cell.RenderPolyCount;