Only compute mightsee for edges of cells with lights in

This commit is contained in:
Jarrod Doyle 2025-01-28 17:33:25 +00:00
parent 3040914afb
commit 77f69be219
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
1 changed files with 2 additions and 1 deletions

View File

@ -151,7 +151,7 @@ public class PotentiallyVisibleSet
_graph[i] = new Node(edgeIndices); _graph[i] = new Node(edgeIndices);
} }
Parallel.ForEach(_edges, ComputeEdgeMightSee); // Parallel.ForEach(_edges, ComputeEdgeMightSee);
} }
public int[] GetVisible(int cellIdx) public int[] GetVisible(int cellIdx)
@ -253,6 +253,7 @@ public class PotentiallyVisibleSet
foreach (var edgeIdx in _graph[cellIdx].EdgeIndices) foreach (var edgeIdx in _graph[cellIdx].EdgeIndices)
{ {
var edge = _edges[edgeIdx]; var edge = _edges[edgeIdx];
ComputeEdgeMightSee(edge);
for (var i = 0; i < edge.MightSee.Length; i++) for (var i = 0; i < edge.MightSee.Length; i++)
{ {
if (edge.MightSee[i]) if (edge.MightSee[i])