From fd429fffb9328515beb120da2807faf5305a6e0c Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Mon, 28 Sep 2026 08:42:59 +0800 Subject: feat(art): P34 素材扩展切片(水面/屋顶/墙体/栏杆) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 命中) --- src/LivingVillage.Desktop.Tests/AssetPackTests.fs | 32 ++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'src/LivingVillage.Desktop.Tests') 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,10 +36,40 @@ type AssetPackTests () = Assert.AreEqual(cc0TileAtlasHeight, height) Assert.AreEqual(0, width % Sim.tilePixels) Assert.AreEqual(0, height % Sim.tilePixels) - Assert.AreEqual(4, width / Sim.tilePixels) + Assert.AreEqual(cc0TileCount, width / Sim.tilePixels) + Assert.AreEqual(cc0TileAtlasWidth, width) Assert.AreEqual(2, Sim.tilePixels / cc0TileSourcePixels) Assert.AreEqual(0, Sim.tilePixels % cc0TileSourcePixels) + [] + 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(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) + [] member _.Cc0CharacterAtlasIsIntegerMultipleOfTheCellGrid () = let width, height = pngDimensions (assetPath cc0CharacterAtlasRelativePath) -- cgit v1.2.3