Pre-Flight — WP-107 — 2026-12-01
Filled-in copy of docs/reference/pre-flight for WP-107. Verdict at the bottom.
Pre-flighted and executed in one session, at Jeff’s “Yes, run it” (2026-12-01). EC-017 records each step’s outcome. The answers to “For the pre-flight” below were settled before the check’s first run and refined by it; each refinement is noted.
Header
- WP:
WP-107 - Title: Hotspot Magnet TerraGlyph provider: targets, points and the per-room check
- Pre-flight date:
2026-12-01 - Targets generation(s): Gen 1 (Showdown, Phantom)
- Targets disc(s): both, for the self-test runs
Dependency check
| Prereq | Status in WORK_INDEX |
Notes |
|---|---|---|
| WP-106 | ✅ Done (2026-12-01) | navigate(), isGeometricConnected(), geometricChoice() and readingOrder(), merged in fork #61 (837ca576da) |
| WP-089, WP-091 | ✅ Done | §4.3–4.6, §5.5, §5.8, §6.5, §12.7 and Appendix B are this packet’s specification |
| H1–H24 | Decided (2026-11-26 to 28) | The provider uses H2, H3, H7, H8, H11, H12, H13, H17, H20 and H22 |
Repo + disc state
- Nobody else holds WP-107. No PR in either repo names it but the merged draft (#271). No branch, worktree or running session works on it.
- The claim: docs branch
docs/wp-107-hotspot-magnet-provider, pushed with the claim commit, and draft PR #360, fromorigin/main @ c9521e0. - The fork worktree:
tools/New-ForkWorktree.ps1 -Branch wp-107-hotspot-magnet-provider, atC:\claude-worktrees\scummvm-wp-107-hotspot-magnet-provider, fromorigin/scooby-engine @ 837ca576da(the pin).C:\dev\scummvmis untouched. - The build: out of tree in the worktree’s
build-tg, from the MSYS2 UCRT64 shell,../configure --disable-all-engines --enable-engine=terraglyph(the script’s hint still saysscooby; open PR #211). A debug build. The pin’s build has the same two warnings as WP-106’s, both outsideengines/terraglyph. - The discs, mounted read-only, with the same SHA-256s as WP-106’s
pre-flight. They mounted at
G:andH:this time; the configs follow. - The baseline: the pin’s binary, kept as
scummvm-base.exe, run on both titles before any change. Showdown logs 2,220 check lines and no warning; Phantom 2,004 lines and the usual 18 warnings. A run stops on the last check’s line, not on a quiet log (WP-106’s fix).
What the code has today (fork 837ca576da)
- Hit testing and boxes.
Room::hitTest()walks the private draw list front to back (room.cpp). The polygon box is read only insidehitPolygon(), andgetFrameRect()gives the first cel only. So the packet addsRoom::getHitBox()andgetDrawOrder(). - The click gate.
handleMouse()drops a click while a scene runs or input is blocked, and turns it into a skip while the class is busy (terraglyph.cpp:400-406). - The toolbar.
Inventorykeeps each toolbar sprite’s role and click index privately (_roles,_indexes). The indexes are slots 0–3, the van 4, Scrappy 5, quit 6, the glass 7, the snack box 8 (its two digits too). The two hit blockers have none. So the packet addsInventory::getToolbarIndex().isEngineSprite()can’t serve: Maria’s items, the Options knobs and Sign In’s fields are engine sprites too. - The show-all API.
Engine::getHotspotPositions()andhotspotDirty()are virtual (engines/engine.h:555,:577).hotspotDirty()isconst, so TerraGlyph’s keeps its last signaturemutable. - The override recount.
bool click(int sprite) overrideappears 32 times in 28 headers, the same headers as at55c8b6b32ae3.
Drift since the draft’s pin (55c8b6b32ae3)
31 merges. The ones that bear on the provider:
- WP-133 (#60) plays Wizard’s Rule’s bottles through the event path. The
bottles are still plain sprites (
claim.build = kSprite), so the hook is still needed. - WP-117 (#42) is the drawbridge. Its four flags are plain sprites that
the flags’ own update reads after
click()(it returns false). The audit gives it a hook. - WP-106 (#61) is the core this packet calls.
The WP’s drift notes for WP-101–105 hold at the pin: the audit reads the wizard’s bedroom’s override and the maze centre’s.
For the pre-flight: settled
- Run state.
_checkingis set, soshowRoom()saves no profile. Each room starts fromnewGameForCheck(), with the room’s own class deleted so the factory builds it fresh (checkMenus()’s pattern). The check also clears the new-clue flag: refined after the first run, where the suspects’ book was still holding input for a clue an earlier check had left. It sets Showdown’s vault clock to 10:23, since at a new game’s 12:00 the hands start on the time and the vault opens on entry. Nothing is in hand. - Entry. From one fixed room,
getFirstGameRoom(), ascheckMenus()enters menus fromshowRoom(game). - Openings.
RoomScript::skip()straight after entry marks the opening played. The room is then ticked until input is free for two ticks running, at most 400. While it’s held, the class’s skip (or the script’s) is called and the sound stopped.- Stopping the sound is a refinement from the first run. The ticks run faster than the audio, and the Sheriff’s and Ewan’s pages, and Gummy’s whistle, wait on their clips.
- A room that enters itself again (the hotel room) is followed once.
- Any other room asked for ends the room with an empty list. The reason is logged: “leaves by itself” for the chases, the strong boxes and Artie, or “input held, and a skip leaves” for the title, Big Head, the credits and the ghost spot.
- Wizard’s Rule’s clock is held at 0 with
setClockForCheck(0), and released after. - The toolbar.
Inventory::click(getVanSprite()), then ticks untilgetState()is open, ascheckAllInventory()does.- Then two more ticks, a refinement from the first run. On the tick the
van stops,
updateToolbar()returns before it hides the moving hit blocker, which covers the whole toolbar for that one tick. - Then the same settle as at entry.
- Then two more ticks, a refinement from the first run. On the tick the
van stops,
- Runtime. Measured, not estimated: the whole check takes about 2.7 s for Showdown’s 69 rooms and 2.0 s for Phantom’s 53. The slowest single list takes 4 ms.
Scope lock
Fork, all in engines/terraglyph/, staged by name:
- new:
magnet_provider.cpp,magnet_room_check.cpp; - changed:
room.{h,cpp}(getHitBox(),getDrawOrder()),room_class.{h,cpp}(the hooks;ButtonRoom’s),inventory.{h,cpp}(getToolbarIndex()),wfr_rooms.{h,cpp},drawbridge_rooms.{h,cpp},terraglyph.{h,cpp}(the provider’s declarations, the cache reset inshowRoom(), the check’s call),module.mk.
This repo: this pre-flight, WP-107, EC-017, WORK_INDEX, the plan,
dashboard.json.
Forbidden: game data, logs and extracted data (they stay in the
scratchpad); anything outside engines/terraglyph/ in the fork;
docs/formats/**.
Risk review
| Risk | Likelihood | Impact | Mitigation |
|---|---|---|---|
| The check changes the game after it (state left in classes, the profile, the inventory) | med | med | newGameForCheck() before each room and after the last; _checking set; the check runs last, after the comparison’s lines |
| A change in play | low | high | Nothing calls the provider outside the check. getHotspotPositions() is called only by Engine::drawHotspots(), which nothing calls in TerraGlyph yet (packet 6). The point cache’s reset in showRoom() is read by nothing else |
| A thin or covered object gets no point | high | med | Every eligible target with no point whose box reaches the screen is logged with what its box’s centre hits |
| A room’s list is empty | high | med | Each is logged with its reason; the WP raises them to Jeff |
| The audit finds classes acting on kinds H7 leaves out | high | high | Raise them to Jeff, not decide in code (WP-107 Notes) |
| Self-test drift | low | med | Same pin and tree for the baseline; the comparison drops only the new magnet room lines |
Verdict
- READY TO EXECUTE. No blockers. The audit’s “Jeff decides” rows are the WP’s own path, not a blocker to the code.
Reviewer: Claude (session), at Jeff’s direction Date: 2026-12-01