From dbce686019230c7a1105f5cc4b7b258698201128 Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Tue, 22 Sep 2026 09:24:28 +0800 Subject: feat(mapgen): P26 512 大图河岸装饰(护岸石垒/芦苇/垂柳)仅视觉层,不挡通行 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/LivingVillage.Desktop/VillageArt.fs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/LivingVillage.Desktop/VillageArt.fs') 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 = -- cgit v1.2.3