feat(world): Phase A8 R1 — tag WorldEntity.IsBuildingShell at LandblockLoader
Adds a bool flag at the WorldEntity data layer set by LandblockLoader from the source dat array: LandBlockInfo.Buildings → true (cottage walls, inn walls, smithy walls); LandBlockInfo.Objects → false (trees, lampposts, rocks, hitching posts). Retail anchor: CLandBlock::init_buildings reads a separate BuildInfo** array from objects (acclient.h:31893 num_buildings / buildings field; acclient_2013_pseudo_c.txt:313854 init_buildings entry). WorldBuilder preserves the same distinction via SceneryInstance.IsBuilding (StaticObjectRenderManager.cs:334). Today acdream's loader reads both arrays into the same WorldEntity pool with no tag, destroying the distinction (the comment at GameWindow.cs:5175 already acknowledges this gap for scenery suppression). This commit closes the gap. Render-time consumption arrives in R2 (EntitySet partition refactor). Two new LandblockLoader tests lock the tagging behavior. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
d2db8d5b22
commit
ed72704f7b
4 changed files with 71 additions and 0 deletions
|
|
@ -162,4 +162,54 @@ public class LandblockLoaderTests
|
|||
Assert.Single(entities);
|
||||
Assert.Equal(1u, entities[0].Id);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BuildEntitiesFromInfo_TagsBuildingsWithIsBuildingShellTrue()
|
||||
{
|
||||
var info = new LandBlockInfo
|
||||
{
|
||||
Buildings =
|
||||
{
|
||||
new BuildingInfo
|
||||
{
|
||||
ModelId = 0x02000123u, // Setup id
|
||||
Frame = new Frame
|
||||
{
|
||||
Origin = new Vector3(10f, 20f, 30f),
|
||||
Orientation = Quaternion.Identity,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
var entities = LandblockLoader.BuildEntitiesFromInfo(info);
|
||||
|
||||
Assert.Single(entities);
|
||||
Assert.True(entities[0].IsBuildingShell);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BuildEntitiesFromInfo_TagsObjectsWithIsBuildingShellFalse()
|
||||
{
|
||||
var info = new LandBlockInfo
|
||||
{
|
||||
Objects =
|
||||
{
|
||||
new Stab
|
||||
{
|
||||
Id = 0x01000123u, // GfxObj id
|
||||
Frame = new Frame
|
||||
{
|
||||
Origin = new Vector3(10f, 20f, 30f),
|
||||
Orientation = Quaternion.Identity,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
var entities = LandblockLoader.BuildEntitiesFromInfo(info);
|
||||
|
||||
Assert.Single(entities);
|
||||
Assert.False(entities[0].IsBuildingShell);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue