summaryrefslogtreecommitdiff
path: root/src/LivingVillage.Desktop/VillageArt.fs
diff options
context:
space:
mode:
authorSomhairle H. Marisol <[email protected]>2026-09-22 08:35:16 +0800
committerSomhairle H. Marisol <[email protected]>2026-09-22 08:35:16 +0800
commit7e3df862a7d2d69e35eb94e3c006efef855f4faa (patch)
tree88c448c218e388f29e9d1fb78ccb3691707d8755 /src/LivingVillage.Desktop/VillageArt.fs
parent09310370365220bc9b9c560d8947cd7abc36d14f (diff)
downloadliving-village-7e3df862a7d2d69e35eb94e3c006efef855f4faa.tar.gz
feat(art): 生成器民居改用黛瓦/木墙/门窗部件 + 村民可见性日志钩子(P24)
- drawMapStructures 用 RoofRidge/RoofEave + WallWood/WallWindow + Door 精灵替换原矩形色块。 - LV_NPC_VISIBLE_LOG=1 每秒打印 visible-npcs=K of 30,作为大世界村民渲染证据。
Diffstat (limited to 'src/LivingVillage.Desktop/VillageArt.fs')
-rw-r--r--src/LivingVillage.Desktop/VillageArt.fs21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/LivingVillage.Desktop/VillageArt.fs b/src/LivingVillage.Desktop/VillageArt.fs
index 3ad5b19..12c17ba 100644
--- a/src/LivingVillage.Desktop/VillageArt.fs
+++ b/src/LivingVillage.Desktop/VillageArt.fs
@@ -616,13 +616,20 @@ module VillageArt =
for (x, y) in map.Bridges do
spriteBatch.Draw(textures.TileAtlas, XnaRectangle(tileX x, tileY y, cell, cell), bridgeSource, XnaColor.White)
for building in map.Buildings do
- for row in building.Top .. building.Top + building.Height - 1 do
- // 白墙朝向道路一行(门所在行),其余为黑瓦屋顶,两侧河岸朝向一致。
- let color =
- if row = building.DoorY then XnaColor(236, 232, 220)
- else XnaColor(48, 52, 60)
- fillRect spriteBatch pixel color (tileX building.Left) (tileY row) (building.Width * cell) (cell)
- fillRect spriteBatch pixel (XnaColor(96, 60, 42)) (tileX building.DoorX) (tileY building.DoorY) cell cell
+ let left = building.Left
+ let right = building.Left + building.Width - 1
+ // P24:改用 256x192 同款民宅部件——黛瓦(脊/檐)+ 木墙/窗 + 门。
+ for row in building.Top .. building.DoorY - 1 do
+ let roofSprite = if row = building.Top then RoofRidgeSprite else RoofEaveSprite
+ let source = tileSourceRectangle roofSprite
+ for x in left .. right do
+ spriteBatch.Draw(textures.TileAtlas, XnaRectangle(tileX x, tileY row, cell, cell), source, XnaColor.White)
+ for x in left .. right do
+ let wallSprite =
+ if x = building.DoorX then DoorSprite
+ elif (x - left) % 2 = 0 then WallWindowSprite
+ else WallWoodSprite
+ spriteBatch.Draw(textures.TileAtlas, XnaRectangle(tileX x, tileY building.DoorY, cell, cell), tileSourceRectangle wallSprite, XnaColor.White)
/// 桥头灯笼瓦片:每座桥每列的最上/最下一格(桥两端),用于挂灯笼与夜间暖光。
let bridgeLanternTiles (map: MapGen.Result) : (int * int) list =