diff options
| author | Somhairle H. Marisol <[email protected]> | 2026-09-22 02:17:11 +0800 |
|---|---|---|
| committer | Somhairle H. Marisol <[email protected]> | 2026-09-22 02:17:11 +0800 |
| commit | 5e036da9dfb1fe7f9e4f5e48414a8a1176292655 (patch) | |
| tree | 9bb3fd59cab5310aaf162a1f6a12c5c7d2129ff6 /src/LivingVillage.Desktop.Tests | |
| parent | cc8dff4d567e8257b3cef66df804fbddb8ee3463 (diff) | |
| parent | 5a908a17335ff291e2d8f2fb3a1ff0ab57770c80 (diff) | |
| download | living-village-5e036da9dfb1fe7f9e4f5e48414a8a1176292655.tar.gz | |
merge: P19 白天色调去偏黄(独立复验全绿 Desktop 109/Kernel 89)
Diffstat (limited to 'src/LivingVillage.Desktop.Tests')
| -rw-r--r-- | src/LivingVillage.Desktop.Tests/DesktopTests.fs | 17 | ||||
| -rw-r--r-- | src/LivingVillage.Desktop.Tests/PrototypeTests.fs | 12 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/LivingVillage.Desktop.Tests/DesktopTests.fs b/src/LivingVillage.Desktop.Tests/DesktopTests.fs index 00e445b..b78f4e0 100644 --- a/src/LivingVillage.Desktop.Tests/DesktopTests.fs +++ b/src/LivingVillage.Desktop.Tests/DesktopTests.fs @@ -143,6 +143,23 @@ type DesktopTests () = Assert.IsTrue(day.WorldTint.G > day.WorldTint.B) [<TestMethod>] + member _.NoonLightingIsWarmthFreeWithNeutralWhiteBalance () = + let noonTick = 12L * Sim.ticksPerDay / 24L + let noon = M6Presentation.profileAtTick noonTick + + Assert.AreEqual<M6DayNight>(Day, noon.Mode) + Assert.AreEqual<float32>(0.0f, noon.SkyWarmth) + Assert.AreEqual<float32>(0.0f, noon.LanternGlow) + Assert.AreEqual<int>(0, M6Presentation.goldenVeilAlpha noonTick) + // P19 offender was the day world tint attenuating blue (255/248/224); it is neutral now. + Assert.AreEqual<int>(255, int noon.WorldTint.R) + Assert.AreEqual<int>(int noon.WorldTint.R, int noon.WorldTint.G) + Assert.AreEqual<int>(int noon.WorldTint.G, int noon.WorldTint.B) + // The sky stays a plain blue, never warm. + Assert.IsTrue(noon.Background.B > noon.Background.G) + Assert.IsTrue(noon.Background.B > noon.Background.R) + + [<TestMethod>] member _.DaylightAutoplayBootstrapStartsAtDawnAndPreservesDefaultStart () = let dawnTick = 6L * Sim.ticksPerDay / 24L let daylightWorld = WorldBootstrap.initialWorldForDaylight true 42UL Sim.npcCount diff --git a/src/LivingVillage.Desktop.Tests/PrototypeTests.fs b/src/LivingVillage.Desktop.Tests/PrototypeTests.fs index 895dff8..e58139c 100644 --- a/src/LivingVillage.Desktop.Tests/PrototypeTests.fs +++ b/src/LivingVillage.Desktop.Tests/PrototypeTests.fs @@ -897,6 +897,18 @@ type PrototypeTests () = Assert.IsTrue(warmDusk.Background.B < (M6Presentation.backgroundAtBlend warmDusk.Blend).B) Assert.IsTrue(warmDusk.WorldTint.R > (M6Presentation.worldTintAtBlend warmDusk.Blend).R) Assert.IsTrue(warmDusk.WorldTint.B < (M6Presentation.worldTintAtBlend warmDusk.Blend).B) + + // P19: no daylight warm cast. Noon (and the whole 10:00-15:00 plateau) must be warmth-free + // and channel-neutral, so the world renders at a true white balance instead of yellow. + for hour in 10 .. 15 do + let daylight = atHour hour + Assert.IsTrue(abs (daylight.SkyWarmth) < 1e-6f, sprintf "hour %d must carry no warmth" hour) + Assert.IsTrue((int daylight.WorldTint.R) = (int daylight.WorldTint.G), sprintf "hour %d world tint must be neutral" hour) + Assert.IsTrue((int daylight.WorldTint.G) = (int daylight.WorldTint.B), sprintf "hour %d world tint must be neutral" hour) + Assert.IsTrue((M6Presentation.goldenVeilAlpha (int64 hour * ticksPerHour)) = 0, sprintf "hour %d must have no golden veil" hour) + Assert.IsTrue(abs (daylight.LanternGlow) < 1e-6f, sprintf "hour %d must have no lantern glow" hour) + let noon = atHour 12 + Assert.IsTrue((int noon.WorldTint.R) = 255, "neutral day tint should be full white (no attenuation)") // Additive veil: positive and strongest at the golden peaks, zero at noon/midnight. Assert.AreEqual<int>(0, M6Presentation.goldenVeilAlpha (int64 12 * ticksPerHour)) Assert.AreEqual<int>(0, M6Presentation.goldenVeilAlpha 0L) |
