feat(render): Phase U.4c — LoadedCell carries stab_list PVS + seen_outside

VisibleCells (full ids) + SeenOutside, populated at the EnvCell-build site from
envCell.VisibleCells + envCell.Flags. Mirrors retail CEnvCell.stab_list /
seen_outside (acclient.h ~30925). Data already in-process; render path no longer
drops it. Consumed by the builder in U.4c-3.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-05-31 10:01:11 +02:00
parent cd3ffe3b02
commit 639f20fa8a
2 changed files with 31 additions and 0 deletions

View file

@ -5693,6 +5693,16 @@ public sealed class GameWindow : IDisposable
portalPolygons.Add(polyVerts);
}
// Phase U.4c: surface the stable PVS + seen-outside flag onto the render cell.
// Both come straight off the dat EnvCell — no new parsing (PhysicsDataCache
// already reads VisibleCells the same way; A8CellAudit reads the flag).
uint lbPrefix = envCellId & 0xFFFF0000u;
var visibleCells = new List<uint>();
if (envCell.VisibleCells is not null)
foreach (var lowId in envCell.VisibleCells)
visibleCells.Add(lbPrefix | lowId);
bool seenOutside = envCell.Flags.HasFlag(DatReaderWriter.Enums.EnvCellFlags.SeenOutside);
var loaded = new LoadedCell
{
CellId = envCellId,
@ -5704,6 +5714,8 @@ public sealed class GameWindow : IDisposable
Portals = portals,
ClipPlanes = clipPlanes,
PortalPolygons = portalPolygons, // Phase A8
VisibleCells = visibleCells, // Phase U.4c
SeenOutside = seenOutside, // Phase U.4c
};
_pendingCells.Add(loaded);
}