refactor: #100 — remove hiddenTerrainCells / BuildingTerrainCells plumbing

Retired in favour of Task 1's retail-faithful terrain shader Z nudge.
Pure removal — ~50 LOC of dead surface area across:

  - src/AcDream.Core/Terrain/LandblockMesh.cs (drop parameter +
    cell-collapse block)
  - src/AcDream.Core/World/LoadedLandblock.cs (drop field)
  - src/AcDream.Core/World/LandblockLoader.cs (drop method + call)
  - src/AcDream.App/Rendering/GameWindow.cs (3 sites)
  - src/AcDream.App/Streaming/GpuWorldState.cs (6 ctor sites)
  - src/AcDream.App/Streaming/LandblockStreamer.cs (1 ctor site)
  - tests/AcDream.Core.Tests/World/LandblockLoaderTests.cs (drop test)
  - tests/AcDream.Core.Tests/Terrain/LandblockMeshTests.cs (drop test)

No retail anchor — the deleted mechanism never had one; this commit
rolls our code back to the actual retail behaviour established in
the prior commit's shader nudge.

ISSUES.md #100 moved to Recently closed.

Cross-ref:
  docs/research/2026-05-25-issue-100-terrain-cutout-handoff.md
  docs/superpowers/plans/2026-05-25-issue-100-terrain-cutout.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-05-25 21:34:06 +02:00
parent f48c74aa8b
commit a64e6f20da
9 changed files with 52 additions and 165 deletions

View file

@ -54,35 +54,6 @@ public class LandblockMeshTests
Assert.Equal(128 * 3, mesh.Indices.Length);
}
[Fact]
public void Build_HiddenTerrainCell_PreservesCountsAndDegeneratesOnlyThatCell()
{
var block = BuildFlatLandBlock();
var cache = new Dictionary<uint, SurfaceInfo>();
int hiddenCell = (3 * LandblockMesh.CellsPerSide) + 5;
var mesh = LandblockMesh.Build(
block,
0,
0,
IdentityHeightTable,
MakeContext(),
cache,
new HashSet<int> { hiddenCell });
Assert.Equal(LandblockMesh.VerticesPerLandblock, mesh.Vertices.Length);
Assert.Equal(LandblockMesh.VerticesPerLandblock, mesh.Indices.Length);
int hiddenBase = hiddenCell * LandblockMesh.VerticesPerCell;
for (int i = 0; i < LandblockMesh.VerticesPerCell; i++)
Assert.Equal((uint)hiddenBase, mesh.Indices[hiddenBase + i]);
int visibleCell = hiddenCell + 1;
int visibleBase = visibleCell * LandblockMesh.VerticesPerCell;
for (int i = 0; i < LandblockMesh.VerticesPerCell; i++)
Assert.Equal((uint)(visibleBase + i), mesh.Indices[visibleBase + i]);
}
[Fact]
public void Build_Vertices_CoverExactly192x192WorldUnits()
{

View file

@ -117,35 +117,6 @@ public class LandblockLoaderTests
Assert.Empty(entities);
}
[Fact]
public void BuildBuildingTerrainCells_UsesBuildingsOnlyAndMapsToMeshCellIndex()
{
var info = new LandBlockInfo
{
Objects =
{
new Stab
{
Id = 0x02000001u,
Frame = new Frame { Origin = new Vector3(120, 72, 0) },
},
},
Buildings =
{
new BuildingInfo
{
ModelId = 0x020000AAu,
Frame = new Frame { Origin = new Vector3(141.5f, 7.2f, 94f) },
},
},
};
var cells = LandblockLoader.BuildBuildingTerrainCells(info);
Assert.Single(cells);
Assert.Contains(5, cells); // cy=0, cx=5 => mesh index cy * 8 + cx.
}
[Fact]
public void BuildEntitiesFromInfo_WithLandblockId_NamespacesIdsForGlobalUniqueness()
{