summaryrefslogtreecommitdiff
path: root/src/LivingVillage.Desktop/VillageArt.fs
diff options
context:
space:
mode:
authorSomhairle H. Marisol <[email protected]>2026-09-22 09:24:28 +0800
committerSomhairle H. Marisol <[email protected]>2026-09-22 09:24:28 +0800
commitdbce686019230c7a1105f5cc4b7b258698201128 (patch)
tree95eb229fad32d862d1093f1a569054fe8cf5e571 /src/LivingVillage.Desktop/VillageArt.fs
parent590f3d8d5cc031c0909241b329ad7f7f18035991 (diff)
downloadliving-village-dbce686019230c7a1105f5cc4b7b258698201128.tar.gz
feat(mapgen): P26 512 大图河岸装饰(护岸石垒/芦苇/垂柳)仅视觉层,不挡通行
Diffstat (limited to 'src/LivingVillage.Desktop/VillageArt.fs')
-rw-r--r--src/LivingVillage.Desktop/VillageArt.fs16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/LivingVillage.Desktop/VillageArt.fs b/src/LivingVillage.Desktop/VillageArt.fs
index f303620..d2fcc1a 100644
--- a/src/LivingVillage.Desktop/VillageArt.fs
+++ b/src/LivingVillage.Desktop/VillageArt.fs
@@ -157,6 +157,7 @@ module VillageArt =
| RoofEaveOverhangSprite
| WallLatticeSprite
| CourtyardDoorSprite
+ | RevetmentStoneSprite
type private XnaColor = Microsoft.Xna.Framework.Color
type private XnaRectangle = Microsoft.Xna.Framework.Rectangle
@@ -499,7 +500,7 @@ module VillageArt =
let characterAtlasRelativePath = "Assets/jiangnan-characters.png"
let interiorAtlasRelativePath = "Assets/jiangnan-interior.png"
- let worldTileCount = 31
+ let worldTileCount = 32
let worldAtlasWidth = Sim.tilePixels * worldTileCount
let worldAtlasHeight = Sim.tilePixels
let characterAtlasWidth = 32 * 5 * 4 * 6
@@ -576,6 +577,7 @@ module VillageArt =
| RoofEaveOverhangSprite -> 28
| WallLatticeSprite -> 29
| CourtyardDoorSprite -> 30
+ | RevetmentStoneSprite -> 31
XnaRectangle(index * Sim.tilePixels, 0, Sim.tilePixels, Sim.tilePixels)
let private tilePosition x y : TilePosition =
@@ -626,13 +628,13 @@ module VillageArt =
(cell: int)
(map: MapGen.Result) =
let bridgeSource = tileSourceRectangle BridgeSprite
+ let drawCell sprite x y =
+ spriteBatch.Draw(textures.TileAtlas, XnaRectangle(tileX x, tileY y, cell, cell), tileSourceRectangle sprite, XnaColor.White)
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
let left = building.Left
let right = building.Left + building.Width - 1
- let drawCell sprite x y =
- spriteBatch.Draw(textures.TileAtlas, XnaRectangle(tileX x, tileY y, cell, cell), tileSourceRectangle sprite, XnaColor.White)
match houseFacadeVariant building with
| 0 ->
// 变体 A(P24):黛瓦(脊/檐)+ 木墙/窗 + 门。
@@ -656,6 +658,14 @@ module VillageArt =
elif (x - left) % 2 = 0 then WallLatticeSprite
else WallWoodSprite
drawCell wallSprite x building.DoorY
+ // P26 河岸装饰:护岸石垒 / 芦苇 / 垂柳(垂柳占上下两格),只在大图生成。
+ for decoration in map.Decorations do
+ match decoration.Kind with
+ | MapGen.RiverDecorationKind.RevetmentStone -> drawCell RevetmentStoneSprite decoration.X decoration.Y
+ | MapGen.RiverDecorationKind.Reeds -> drawCell ReedSprite decoration.X decoration.Y
+ | MapGen.RiverDecorationKind.Willow ->
+ drawCell WillowTopSprite decoration.X decoration.Y
+ drawCell WillowBaseSprite decoration.X (decoration.Y + 1)
/// 桥头灯笼瓦片:每座桥每列的最上/最下一格(桥两端),用于挂灯笼与夜间暖光。
let bridgeLanternTiles (map: MapGen.Result) : (int * int) list =