summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSomhairle H. Marisol <[email protected]>2026-09-28 18:04:40 +0800
committerSomhairle H. Marisol <[email protected]>2026-09-28 18:04:40 +0800
commitc59da29bba304152e3826ab869a421c7c75f780d (patch)
treedd78a3597cd679eb6db4dfb0511498b5b6a7d356 /src
parent86bd8f90e4e0e2c5e545d5231b97114f588b9be7 (diff)
downloadliving-village-c59da29bba304152e3826ab869a421c7c75f780d.tar.gz
feat(p40): 乌篷船证据收口(相机遮挡与取景修复)
- 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
Diffstat (limited to 'src')
-rw-r--r--src/LivingVillage.Desktop/Game.fs30
-rw-r--r--src/LivingVillage.Desktop/VillageArt.fs15
2 files changed, 40 insertions, 5 deletions
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
diff --git a/src/LivingVillage.Desktop/VillageArt.fs b/src/LivingVillage.Desktop/VillageArt.fs
index 0427dea..2b2b0e7 100644
--- a/src/LivingVillage.Desktop/VillageArt.fs
+++ b/src/LivingVillage.Desktop/VillageArt.fs
@@ -970,6 +970,21 @@ module VillageArt =
for (rect, color) in lanternGlowLayers centerX centerY radiusPixels 8 255 214 150 peakAlpha do
spriteBatch.Draw(pixel, rect, color)
+ let drawCc0BoatOverlay
+ (spriteBatch: SpriteBatch)
+ (textures: ArtTextures)
+ (camera: XnaVector2)
+ (map: MapGen.Result)
+ (tint: XnaColor) =
+ match textures.Cc0TileAtlas with
+ | Some cc0 ->
+ match cc0BoatTile map with
+ | Some (boatX, boatY) ->
+ drawCc0Tile spriteBatch cc0 tint (cc0TileRect cc0TileIndexBoatLeft) (boatX * Sim.tilePixels - int camera.X) (boatY * Sim.tilePixels - int camera.Y)
+ drawCc0Tile spriteBatch cc0 tint (cc0TileRect cc0TileIndexBoatRight) ((boatX + 1) * Sim.tilePixels - int camera.X) (boatY * Sim.tilePixels - int camera.Y)
+ | None -> ()
+ | None -> ()
+
let drawWorld
(spriteBatch: SpriteBatch)
(textures: ArtTextures)