using AcDream.Core.Meshing; using DatReaderWriter.Enums; namespace AcDream.Core.Tests.Meshing; /// /// #426 (2026-08-23, the Holtburg windmill axle 0x010010CE): pins the two /// predicates that replaced the buggy isSolid = NoPos || Base1Solid /// extraction rule and the "retail never draws untextured subsets" #119 /// misconception. See RetailUntexturedSurfacePolicy.cs for the full retail /// citations (D3DPolyRender::DrawMesh / DrawBuilding / DrawEnvCell). /// public sealed class RetailUntexturedSurfacePolicyTests { [Theory] [InlineData(SurfaceType.Base1Solid, true)] // solid-colour — untextured [InlineData((SurfaceType)0, true)] // neither bit set — untextured [InlineData(SurfaceType.Base1Image, false)] // BASE1_IMAGE (0x2) — textured [InlineData(SurfaceType.Base1ClipMap, false)] // BASE1_CLIPMAP (0x4) — textured [InlineData(SurfaceType.Base1Image | SurfaceType.Base1Solid, false)] // both bits — retail's literal (type & 6) != 0 still calls this textured [InlineData(SurfaceType.Base1Image | SurfaceType.Additive, false)] // unrelated flags alongside a textured bit stay textured public void IsUntextured_MatchesRetailBitmask(SurfaceType type, bool expected) { Assert.Equal(expected, RetailUntexturedSurfacePolicy.IsUntextured(type)); } [Theory] // (isBuildingShell, isUntextured) -> draws [InlineData(false, true, true)] // ordinary object, solid subset — retail draws it (#426's own bug) [InlineData(true, true, false)] // building shell, solid subset — retail's DrawBuilding skips it [InlineData(false, false, true)] // ordinary object, textured subset — always drawn [InlineData(true, false, true)] // building shell, textured subset — the shell gate only touches untextured subsets public void Draws_MatchesRetailBuildingShellGate( bool isBuildingShell, bool isUntextured, bool expectedDraws) { Assert.Equal( expectedDraws, RetailUntexturedSubsetPolicy.Draws(isBuildingShell, isUntextured)); } }