acdream/src/AcDream.Core/World
Erik dbe6690a4e fix(time): retail-canonical month enum + absolute Portal Year + title-bar calendar
Two bugs in calendar display (the CLOCK ITSELF was already correct):

1. **Month enum had wrong order + non-retail names.** Old enum:
   Snowreap=0, ColdMeet, Leafdawning, Seedsow, Rosetide, Solclaim, ...
   At day-of-year 83 this gave month index 2 = Leafdawning. Retail's
   @timestamp at the same moment shows "Seedsow 24". Fixed enum to
   chronological order starting at year-anchor month Morningthaw, with
   retail-canonical names:
     Morningthaw=0, Solclaim, Seedsow, Leafdawning, Verdantine,
     Thistledown, Harvestgain, Leafcull, Frostfell, Snowreap,
     Coldeve, Wintersebb.
   At day-of-year 83 → month 2 = Seedsow ✓

2. **ToCalendar returned relative year, not absolute Portal Year.**
   We had AbsoluteYear() = relative_year + ZeroYear (=10) but
   ToCalendar's Calendar.Year was the relative one. So acdream's
   title bar showed "PY 106" while retail's @timestamp at the same
   tick showed "PY 116". Fixed ToCalendar to add ZeroYear so the
   exposed Calendar.Year matches retail's display.

3. **GameWindow title bar now shows the calendar.** Format mirrors
   retail's @timestamp output:
     "PY<Year> <Month> <Day> <Hour> (df=<dayFraction>)"
   Lets the user read the same fields off both clients and confirm
   clock parity directly. Drift > 1 hour = real bug.

Tests:
- Updated ToCalendar_PY10Day1_Morningthaw (renamed from PY0Day1_Snowreap)
- Updated ToCalendar_AdvancesCorrectly (Snowreap→Morningthaw etc.)
- Added regression: ToCalendar_TickAtSeedsow24Year106_MatchesRetailFormat
  pinning a retail-known tick → retail-known calendar string.

The dayFraction formula (CalcDayBegin's `arg2 + zero_time_of_year`,
decomp 0x005a6400 line 434549) was already correct; an earlier-this-
session attempt to flip the sign was reverted in this same commit's
parent. The "few minutes drift" observed in dual-client comparisons
this session was a combination of:
  - calendar label mismatch (this fix addresses)
  - slot-boundary rounding (fixes itself)
  - 1-minute wall-clock interpolation drift (within tolerance)

NOT a clock-formula bug. ISSUE #3 in docs/ISSUES.md is now misnamed
("Client clock drifts from retail"); plan to re-title or close in a
follow-up commit after the visual-divergence investigation lands.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 14:43:49 +02:00
..
DerethDateTime.cs fix(time): retail-canonical month enum + absolute Portal Year + title-bar calendar 2026-04-27 14:43:49 +02:00
LandblockLoader.cs feat(core): add LandblockLoader with Stab+Building → WorldEntity mapping 2026-04-10 17:58:30 +02:00
LoadedLandblock.cs feat(core): add LandblockLoader with Stab+Building → WorldEntity mapping 2026-04-10 17:58:30 +02:00
MeshRef.cs feat(net+app): TextureChanges applied via Surface→OrigTex resolution (Phase 5a) 2026-04-11 16:22:23 +02:00
PaletteOverride.cs feat(net+app): SubPalette overlays applied to palette-indexed textures (Phase 5b) 2026-04-11 16:30:08 +02:00
SceneryGenerator.cs feat(ui): debug overlay + refined input controls 2026-04-17 18:45:38 +02:00
SkyDescLoader.cs feat(sky): split SkyRenderer into pre-/post-scene passes + retail -120m weather Z offset 2026-04-27 08:49:42 +02:00
SkyState.cs sky(phase-3a): per-Dereth-day weather roll + ACDREAM_DAY_GROUP override 2026-04-24 08:27:37 +02:00
WeatherState.cs weather(phase-7): gut WeatherSystem.Snapshot — passthrough keyframe fog 2026-04-24 12:55:19 +02:00
WorldEntity.cs feat(ui): debug overlay + refined input controls 2026-04-17 18:45:38 +02:00
WorldView.cs feat(core): add WorldView with 3x3 neighbor landblock computation 2026-04-10 18:02:41 +02:00