diff options
| author | Somhairle H. Marisol <[email protected]> | 2026-09-28 08:33:20 +0800 |
|---|---|---|
| committer | Somhairle H. Marisol <[email protected]> | 2026-09-28 08:33:20 +0800 |
| commit | 0e9948b7067e07875a9fe81879be0ae46664a785 (patch) | |
| tree | 4c0decedfb6826d7fb26248a4dea25e41a60ffcc /scripts/make-cc0-art.py | |
| parent | d92afbcb787eb91c4e6d001b1f0de04f0fc5813d (diff) | |
| download | living-village-0e9948b7067e07875a9fe81879be0ae46664a785.tar.gz | |
feat(art): P33 接入 CC0 真实像素素材样板(地面+角色竖直切片)
- 修复 make-cc0-art.py 地块取样间距:packed sheet 无间距(16px pitch),旧 17px 误采错格
- 重选草地/石板格 (9,8)/(10,8)/(4,8)/(4,9),整数 2x NEAREST 重建 cc0-tiles.png
- VillageArt 暴露 selectedGround/CharacterAtlasRelativePath 纯函数,保留 LV_ASSET_PACK=cc0
开关与程序绘制江南图集 fallback
- 新增 AssetPackTests:图集加载尺寸、整数倍缩放、开关/回退断言
- docs/素材来源.md 记录来源/许可/sha256/构建/开关;同步 assets-and-licenses 与维护说明 P33 小节
- docs/evidence/p33-atlas-*.png 昼/夜/2x 特写/程序绘制对照(check-no-white-blocks 0 命中)
Diffstat (limited to 'scripts/make-cc0-art.py')
| -rw-r--r-- | scripts/make-cc0-art.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/make-cc0-art.py b/scripts/make-cc0-art.py index f5c97ee..b26cba1 100644 --- a/scripts/make-cc0-art.py +++ b/scripts/make-cc0-art.py @@ -98,16 +98,19 @@ def verify_png(path, expected_w, expected_h): def build_cc0_tile_atlas(): """Four 32x32 ground tiles from Kenney Tiny Farm, upscaled 2x. - Tile selection is fixed by grid coordinates chosen from the pack's - tilemap_packed.png (grass: two greens; stone path: pale slab; dirt: apricot). + Source is the *packed* sheet (tilemap_packed.png) which has NO spacing between + tiles: 192x176 = 12x11 tiles at a 16px pitch (the spaced tilemap.png is 203x186 + at 17px pitch; mixing the two misaligns every non-zero cell). Tile selection is + fixed by grid coordinates: two full grass shades (9,8)/(10,8) for the checker + ground, then two grey stone slabs (4,8)/(4,9) for the paved path. """ c = Canvas(128, 32) packed = Image.open(THIRD / "kenney_tiny-farm" / "Tilemap" / "tilemap_packed.png").convert("RGBA") def tile(grid_x, grid_y): - return packed.crop((grid_x * 17, grid_y * 17, grid_x * 17 + 16, grid_y * 17 + 16)) + return packed.crop((grid_x * 16, grid_y * 16, grid_x * 16 + 16, grid_y * 16 + 16)) - choices = [(10, 9), (9, 7), (6, 7), (6, 9)] + choices = [(9, 8), (10, 8), (4, 8), (4, 9)] for index, (gx, gy) in enumerate(choices): t = tile(gx, gy) c.blit(t, index * 32, 0, scale=2) |
