checkpoint: preserve cathedral look-in investigation state

This commit is contained in:
Erik 2026-08-30 23:29:28 +02:00
parent c287db8651
commit 572de1ec30
11 changed files with 757 additions and 197 deletions

View file

@ -1,4 +1,5 @@
using System.Numerics;
using AcDream.App.Rendering.Scene;
using AcDream.App.Rendering.Walk;
using AcDream.Core.Vfx;
@ -151,6 +152,8 @@ internal sealed partial class RetailPViewPassExecutor
int count = Math.Min(vertices.Length, world.Length);
for (int vertex = 0; vertex < count; vertex++)
world[vertex] = vertices[vertex];
if (AcDream.Core.Rendering.RenderingDiagnostics.ProbeWalkRootEnabled)
WalkLookInPunchCountThisFrame++;
_portalDepthMask.DrawDepthFan(
world[..count],
frame.ViewProjection,
@ -201,6 +204,9 @@ internal sealed class WalkProductionLeafRenderer : IWalkFrameLeafRenderer
private readonly Action _drawExitSeals;
private readonly HashSet<uint> _singleCellScratch = new();
private readonly List<uint> _singleCellListScratch = new();
private readonly HashSet<uint> _lookInParticleOwnerScratch = new();
private RenderFrameView _entityFrame;
private bool _entityFrameBound;
internal WalkProductionLeafRenderer(
RetailPViewPassExecutor passes,
@ -242,6 +248,55 @@ internal sealed class WalkProductionLeafRenderer : IWalkFrameLeafRenderer
_passes.DrawLandscapeStaticParticles(
_frame, new RetailPViewLandscapeStaticParticleContext(ownerIds));
/// <summary>Binds the packed frame product built after the walk's Collect
/// pass and before Replay. The walk records route indices during Collect;
/// Replay consumes the matching product ranges through this exact view.</summary>
internal void BindEntityFrame(in RenderFrameView view)
{
_entityFrame = view;
_entityFrameBound = true;
}
public void DrawLookInDynamics(
uint cellId,
int routeIndex,
IReadOnlySet<uint> staticParticleOwnerIds)
{
if (!_entityFrameBound)
{
throw new InvalidOperationException(
"Walk look-in dynamics replayed before the packed entity frame was bound.");
}
_passes.UseIndoorMembershipOnlyRouting();
_passes.DrawEntityRoute(
_frame.Camera,
in _entityFrame,
RenderFrameCandidateRoute.LookInObject,
routeIndex,
cellId,
_frame.PlayerLandblockId ?? 0u);
_lookInParticleOwnerScratch.Clear();
_lookInParticleOwnerScratch.UnionWith(staticParticleOwnerIds);
RenderFrameRouteOwnerSelector.Union(
_lookInParticleOwnerScratch,
in _entityFrame,
RenderFrameCandidateRoute.LookInObject,
routeIndex,
cellId);
if (_lookInParticleOwnerScratch.Count > 0)
{
_passes.DrawCellParticles(
_frame,
new RetailPViewCellSliceContext(
cellId,
default,
_lookInParticleOwnerScratch));
}
}
public void DrawExitSeals() => _drawExitSeals();
public void DrawPunchFan(WalkPolygon worldPolygon, int activeViewIndex) =>