diff options
| author | Somhairle H. Marisol <[email protected]> | 2026-09-28 08:42:59 +0800 |
|---|---|---|
| committer | Somhairle H. Marisol <[email protected]> | 2026-09-28 08:42:59 +0800 |
| commit | fd429fffb9328515beb120da2807faf5305a6e0c (patch) | |
| tree | 3af2346a538fc4a4c05afce602c2030615b88e6c /src/LivingVillage.Desktop.Tests | |
| parent | 39f5c7d9951fb4c3ab8cb151665233ac1b6df76a (diff) | |
| download | living-village-fd429fffb9328515beb120da2807faf5305a6e0c.tar.gz | |
feat(art): P34 素材扩展切片(水面/屋顶/墙体/栏杆)
- cc0-tiles.png 由 4 格扩到 12 格:0-3 仍 Kenney 地面,4-11 为自绘构件
(4 水A/5 水B/6 屋脊/7 屋檐/8 木构墙/9 木格窗/10 栏杆/11 门)
- 自绘 2 相位水面 cc0WaterTileIndexAt=(tick/32+x+2y)%2,单帧覆盖双相位;
河道与水田/水网共用;江南 fallback 不变
- drawWorld 接入:cc0 模式下民居屋顶/墙/窗/门、桥栏杆、水面走真素材,其余道具仍江南
- AssetPackTests 更新图集尺寸(12 格)+整数缩放,新增构件索引与双水相位用例
- docs/素材来源.md 记录自绘清单;同步 assets-and-licenses 与维护说明 P34 小节
- docs/evidence/p34-*.png 昼/夜/2x 特写/水波/对照(check-no-white-blocks 0 命中)
Diffstat (limited to 'src/LivingVillage.Desktop.Tests')
| -rw-r--r-- | src/LivingVillage.Desktop.Tests/AssetPackTests.fs | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/LivingVillage.Desktop.Tests/AssetPackTests.fs b/src/LivingVillage.Desktop.Tests/AssetPackTests.fs index fc235d0..46513f9 100644 --- a/src/LivingVillage.Desktop.Tests/AssetPackTests.fs +++ b/src/LivingVillage.Desktop.Tests/AssetPackTests.fs @@ -36,11 +36,41 @@ type AssetPackTests () = Assert.AreEqual<int>(cc0TileAtlasHeight, height) Assert.AreEqual<int>(0, width % Sim.tilePixels) Assert.AreEqual<int>(0, height % Sim.tilePixels) - Assert.AreEqual<int>(4, width / Sim.tilePixels) + Assert.AreEqual<int>(cc0TileCount, width / Sim.tilePixels) + Assert.AreEqual<int>(cc0TileAtlasWidth, width) Assert.AreEqual<int>(2, Sim.tilePixels / cc0TileSourcePixels) Assert.AreEqual<int>(0, Sim.tilePixels % cc0TileSourcePixels) [<TestMethod>] + member _.Cc0StructureTileIndicesFitTheAtlasAndWaterHasTwoPhases () = + // Every P34 self-drawn structure cell must sit inside the 12-tile atlas band. + let indices = + [ cc0TileIndexWaterA + cc0TileIndexWaterB + cc0TileIndexRoofRidge + cc0TileIndexRoofEave + cc0TileIndexWallWood + cc0TileIndexWallWindow + cc0TileIndexRailing + cc0TileIndexDoor ] + for index in indices do + Assert.IsTrue(index >= 0 && index < cc0TileCount, sprintf "cc0 tile index %d out of atlas" index) + let width, _ = pngDimensions (assetPath cc0TileAtlasRelativePath) + Assert.IsTrue(width >= (List.max indices + 1) * Sim.tilePixels, "atlas must cover every structure index") + // Two-phase water: phase depends only on tick/tile, always in {A, B}, and both + // phases appear across a row of tiles in one frame. + Assert.AreEqual<int>(2, cc0WaterFrameCount) + let phases = + [ for tileX in 0 .. 15 -> cc0WaterTileIndexAt 0L tileX 0 ] + |> Set.ofList + Assert.IsTrue((phases = Set.ofList [ cc0TileIndexWaterA; cc0TileIndexWaterB ]), + "one frame must show both water phases across the river") + for tileX in 0 .. 15 do + for tileY in 0 .. 15 do + let index = cc0WaterTileIndexAt 12345L tileX tileY + Assert.IsTrue(index = cc0TileIndexWaterA || index = cc0TileIndexWaterB) + + [<TestMethod>] member _.Cc0CharacterAtlasIsIntegerMultipleOfTheCellGrid () = let width, height = pngDimensions (assetPath cc0CharacterAtlasRelativePath) Assert.AreEqual<int>(cc0CharacterAtlasWidth, width) |
