summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/evidence/p40-boat-closeup-2x.pngbin5343 -> 4944 bytes
-rw-r--r--docs/evidence/p40-boat.pngbin86001 -> 85633 bytes
-rw-r--r--docs/evidence/p40-day.pngbin85437 -> 85208 bytes
-rw-r--r--docs/evidence/p40-night.pngbin163315 -> 162005 bytes
-rw-r--r--scripts/make-p40-closeups.py2
-rw-r--r--src/LivingVillage.Desktop/Game.fs30
-rw-r--r--src/LivingVillage.Desktop/VillageArt.fs15
7 files changed, 41 insertions, 6 deletions
diff --git a/docs/evidence/p40-boat-closeup-2x.png b/docs/evidence/p40-boat-closeup-2x.png
index 2ed0c54..43612c1 100644
--- a/docs/evidence/p40-boat-closeup-2x.png
+++ b/docs/evidence/p40-boat-closeup-2x.png
Binary files differ
diff --git a/docs/evidence/p40-boat.png b/docs/evidence/p40-boat.png
index dd43e03..3ea886e 100644
--- a/docs/evidence/p40-boat.png
+++ b/docs/evidence/p40-boat.png
Binary files differ
diff --git a/docs/evidence/p40-day.png b/docs/evidence/p40-day.png
index d6e3d27..5262533 100644
--- a/docs/evidence/p40-day.png
+++ b/docs/evidence/p40-day.png
Binary files differ
diff --git a/docs/evidence/p40-night.png b/docs/evidence/p40-night.png
index 6f4dc8d..49be612 100644
--- a/docs/evidence/p40-night.png
+++ b/docs/evidence/p40-night.png
Binary files differ
diff --git a/scripts/make-p40-closeups.py b/scripts/make-p40-closeups.py
index 1add13e..b59fd0f 100644
--- a/scripts/make-p40-closeups.py
+++ b/scripts/make-p40-closeups.py
@@ -17,7 +17,7 @@ from PIL import Image
# (source frame, crop box x0,y0,x1,y1, output name)
CROPS = [
- ("p40-boat.png", (524, 288, 724, 408), "p40-boat-closeup-2x.png"),
+ ("p40-boat.png", (528, 288, 720, 432), "p40-boat-closeup-2x.png"),
]
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)