From b41d73c0e3df2fb45cef6405b26994e28b44bb83 Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Thu, 26 Dec 2024 17:39:24 +0000 Subject: [PATCH] Fix #9: Blocks vision polys always cast shadows --- KeepersCompound.LGS/Database/Chunks/WorldRep.cs | 2 +- KeepersCompound.Lightmapper/MeshBuilder.cs | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/KeepersCompound.LGS/Database/Chunks/WorldRep.cs b/KeepersCompound.LGS/Database/Chunks/WorldRep.cs index 2c1ee05..917d88d 100644 --- a/KeepersCompound.LGS/Database/Chunks/WorldRep.cs +++ b/KeepersCompound.LGS/Database/Chunks/WorldRep.cs @@ -333,7 +333,7 @@ public class WorldRep : IChunk public byte PortalPolyCount { get; set; } public byte PlaneCount { get; set; } public byte Medium { get; set; } - public byte Flags { get; set; } + public byte Flags { get; set; } // TODO: Make these a [Flags] enum public int PortalVertices { get; set; } public ushort NumVList { get; set; } public byte AnimLightCount { get; set; } diff --git a/KeepersCompound.Lightmapper/MeshBuilder.cs b/KeepersCompound.Lightmapper/MeshBuilder.cs index 0424820..ee081ce 100644 --- a/KeepersCompound.Lightmapper/MeshBuilder.cs +++ b/KeepersCompound.Lightmapper/MeshBuilder.cs @@ -47,8 +47,7 @@ public class MeshBuilder // - Water surfaces // - Door vision blockers // - // Door vision blockers are the interesting one. They're not RenderPolys at all, and we only include - // them in the mesh if the cell only has two of them (otherwise the door is in the middle of the air) + // Door vision blockers are the interesting one. They're not RenderPolys at all, just flagged Polys. SurfaceType primType; if (polyIdx < solidPolys) { @@ -58,7 +57,7 @@ public class MeshBuilder { primType = SurfaceType.Water; } - else if (cell is { Flags: 24, PortalPolyCount: 2 }) // TODO: Work out what these flags are!! + else if ((cell.Flags & 8) != 0) { primType = SurfaceType.Solid; }