From c59da29bba304152e3826ab869a421c7c75f780d Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Mon, 28 Sep 2026 18:04:40 +0800 Subject: feat(p40): 乌篷船证据收口(相机遮挡与取景修复) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - CenterCameraOnTile 让相机直对船瓦片,avatar 挪到岸上非水瓦片,消除遮挡 - day/night/boat 三个证据镜头统一以船为中心;boat 帧整条船(234-235,50)完整入框 - 夜光晕后重绘船体(drawCc0BoatOverlay),修复桥头灯把船洗白 - make-p40-closeups.py 裁剪框对准船真实包围盒,closeup 不再裁切船 - 相机遮挡修复含 leader 外科修复(CenterCameraOnTile) - 重出 docs/evidence/p40-day/night/boat 及 closeup 2x --- src/LivingVillage.Desktop/Game.fs | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'src/LivingVillage.Desktop/Game.fs') diff --git a/src/LivingVillage.Desktop/Game.fs b/src/LivingVillage.Desktop/Game.fs index 8c0b8a1..94cc451 100644 --- a/src/LivingVillage.Desktop/Game.fs +++ b/src/LivingVillage.Desktop/Game.fs @@ -413,6 +413,17 @@ type LivingVillageGame() as this = let y = MathHelper.Clamp(world.Avatar.Pos.Y + half - vh / 2.0f, 0.0f, max 0.0f (worldH - vh)) camera <- Vector2(x, y) + member private this.CenterCameraOnTile (tileX: int) (tileY: int) = + let viewport = this.GraphicsDevice.Viewport + let vw = float32 viewport.Width + let vh = float32 viewport.Height + let worldW = float32 (Sim.mapWidthTiles * Sim.tilePixels) + let worldH = float32 (Sim.mapHeightTiles * Sim.tilePixels) + let half = float32 Sim.tilePixels / 2.0f + let x = MathHelper.Clamp(float32 (tileX * Sim.tilePixels) + half - vw / 2.0f, 0.0f, max 0.0f (worldW - vw)) + let y = MathHelper.Clamp(float32 (tileY * Sim.tilePixels) + half - vh / 2.0f, 0.0f, max 0.0f (worldH - vh)) + camera <- Vector2(x, y) + member private this.ResetWorldView() = relationView <- false relationSnapshot <- None @@ -700,8 +711,10 @@ type LivingVillageGame() as this = /// P40 证据:真实生成器世界里拍昼 / 夜整帧与乌篷船近景。位置取自确定性摆放纯函数, /// 含真实 tint 与 P14 光晕;相机贴近船体便于 2x NEAREST 特写。 member private this.PrepareP40Shot () = - let placeCameraOn (tileX: int) (tileY: int) = + let placeAvatarOnLand (tileX: int) (tileY: int) = world <- { world with Avatar = { world.Avatar with Pos = { X = float32 (tileX * Sim.tilePixels); Y = float32 (tileY * Sim.tilePixels) } } } + let placeCameraOn (tileX: int) (tileY: int) = + placeAvatarOnLand tileX tileY this.CenterCamera() let setHour (hour: float) = let tick = M6Presentation.resolveStartTick (Some hour) false @@ -719,21 +732,23 @@ type LivingVillageGame() as this = match map.Bridges |> List.sortBy (fun (x, y) -> (x, y)) |> List.tryHead with | Some (bx, by) -> (bx, by) | None -> (map.Core.MinX, map.Core.MinY) - let boatShot = (fst boat + 1, snd boat) match p40Step with | 0 -> setHour dayHour - placeCameraOn (fst boat) (snd boat) + placeAvatarOnLand 232 51 + this.CenterCameraOnTile (fst boat) (snd boat) p40PendingName <- "p40-day" p40Pending <- true | 1 -> setHour nightHour - placeCameraOn (fst boat) (snd boat) + placeAvatarOnLand 232 51 + this.CenterCameraOnTile (fst boat) (snd boat) p40PendingName <- "p40-night" p40Pending <- true | 2 -> setHour dayHour - placeCameraOn (fst boatShot) (snd boatShot) + placeAvatarOnLand 240 51 + this.CenterCameraOnTile (fst boat + 1) (snd boat) p40PendingName <- "p40-boat" p40Pending <- true | _ -> @@ -1684,6 +1699,11 @@ type LivingVillageGame() as this = spriteBatch.Draw(pixel, rect, color) | _ -> () + match riverscapeMap, profile.LanternGlow > 0.3f with + | Some map, true -> + VillageArt.drawCc0BoatOverlay spriteBatch artTextures camera map profile.WorldTint + | _ -> () + VillageArt.drawGroundShadow spriteBatch pixel camera world.Avatar.Pos let avatarSpec = VillageArt.avatarSpriteSpec avatarFacing avatarMoving world.Tick VillageArt.drawCharacter spriteBatch artTextures camera world.Avatar.Pos avatarSpec profile.WorldTint -- cgit v1.2.3