diff options
Diffstat (limited to 'src/LivingVillage.Desktop/VillageArt.fs')
| -rw-r--r-- | src/LivingVillage.Desktop/VillageArt.fs | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/LivingVillage.Desktop/VillageArt.fs b/src/LivingVillage.Desktop/VillageArt.fs index d2fcc1a..9a56de4 100644 --- a/src/LivingVillage.Desktop/VillageArt.fs +++ b/src/LivingVillage.Desktop/VillageArt.fs @@ -612,7 +612,8 @@ module VillageArt = spriteBatch.Draw(pixel, XnaRectangle(x, y, max 1 w, max 1 h), color) /// P26 民居立面变体:按位置确定性交替两种立面(沿河沿路分布)。 - /// 0 = 黛瓦脊 + 木墙/窗 + 门(P24 原样);1 = 挑檐挑出 + 木格栅窗 + 院门。 + /// 0 = 黛瓦脊 + 木墙/窗 + 门(P24 原样);1 = 亮青灰挑檐(多叠一层、向两侧各出一格)+ + /// 竖长木格栅窗 + 绿院门(P28 强化配色与轮廓,保证 512 整图 ~2px/tile 下两变体可分)。 /// 纯函数、不改变任何瓦片/可达性语义;64x48 与 256x192 的 tiles checksum 不受影响。 let houseFacadeVariant (building: MapGen.Building) : int = let remainder = (building.Left + building.Top) % 2 @@ -649,14 +650,22 @@ module VillageArt = else WallWoodSprite drawCell wallSprite x building.DoorY | _ -> - // 变体 B(P26):挑檐向两侧各出一格 + 木格栅窗 + 院门。 - for x in (left - 1) .. (right + 1) do - drawCell RoofEaveOverhangSprite x building.Top + // 变体 B(P26/P28):亮青灰挑檐向两侧各出一格 + 竖长木格栅窗 + 绿院门。 + // P28 再向上叠一层挑檐,使 B 的轮廓比 A 高一格;水面之上不叠,避免屋顶压水。 + let isWater x y = + x >= 0 && x < map.Width && y >= 0 && y < map.Height + && map.Tiles.[y * map.Width + x] = int MapGen.GroundTile.Water + for row in building.Top .. building.DoorY - 1 do + for x in (left - 1) .. (right + 1) do + drawCell RoofEaveOverhangSprite x row + let upper = building.Top - 1 + if upper >= 0 then + for x in (left - 1) .. (right + 1) do + if not (isWater x upper) then + drawCell RoofEaveOverhangSprite x upper for x in left .. right do let wallSprite = - if x = building.DoorX then CourtyardDoorSprite - elif (x - left) % 2 = 0 then WallLatticeSprite - else WallWoodSprite + if x = building.DoorX then CourtyardDoorSprite else WallLatticeSprite drawCell wallSprite x building.DoorY // P26 河岸装饰:护岸石垒 / 芦苇 / 垂柳(垂柳占上下两格),只在大图生成。 for decoration in map.Decorations do |
