summaryrefslogtreecommitdiff
path: root/src/LivingVillage.Desktop.Tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/LivingVillage.Desktop.Tests')
-rw-r--r--src/LivingVillage.Desktop.Tests/DesktopTests.fs17
-rw-r--r--src/LivingVillage.Desktop.Tests/PrototypeTests.fs12
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)