refactor(streaming): extract landblock physics publisher
Move streamed terrain/cell/building and static collision publication behind a focused update-thread owner. Preserve retail publication order while making replacement and retirement exact by logical landblock ownership, including current-cell rebasing and adjacent-seam isolation. Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
parent
acb6b34d01
commit
3613d393e6
7 changed files with 1538 additions and 546 deletions
|
|
@ -58,6 +58,11 @@ public sealed class CellGraph
|
|||
public void RemoveLandblock(uint landblockPrefix)
|
||||
{
|
||||
uint lb = landblockPrefix & 0xFFFF0000u;
|
||||
if (CurrCell is { } current
|
||||
&& (current.Id & 0xFFFF0000u) == lb)
|
||||
{
|
||||
CurrCell = null;
|
||||
}
|
||||
_terrain.TryRemove(lb, out _);
|
||||
foreach (var id in new List<uint>(_envCells.Keys))
|
||||
if ((id & 0xFFFF0000u) == lb) _envCells.TryRemove(id, out _);
|
||||
|
|
@ -70,6 +75,12 @@ public sealed class CellGraph
|
|||
public void RemoveEnvCellsForLandblock(uint landblockPrefix)
|
||||
{
|
||||
uint lb = landblockPrefix & 0xFFFF0000u;
|
||||
if (CurrCell is { } current
|
||||
&& (current.Id & 0xFFFF0000u) == lb
|
||||
&& (current.Id & 0xFFFFu) >= 0x0100u)
|
||||
{
|
||||
CurrCell = null;
|
||||
}
|
||||
foreach (var id in new List<uint>(_envCells.Keys))
|
||||
if ((id & 0xFFFF0000u) == lb) _envCells.TryRemove(id, out _);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue