WP-107: Hotspot Magnet TerraGlyph provider — targets, points and the per-room check (Gen 1)
Status: ✅ Done (2026-12-04). The provider is in the fork (#62,
dcf2630b21), and so are the character targets of Jeff’s H25 (#66,
37b75bf77e). Every check passes. Jeff accepted the covered targets and
empty rooms as listed (§Result).
Phase: 5 (polish and accessibility).
Depends on:
- WP-106 ✅: the core’s
navigate(),isGeometricConnected()andgeometricChoice(), which the per-room check calls; - WP-089 ✅ and WP-091 ✅: the provider’s design in the plan’s §4.3–4.6 and §5.5, and the checks in §5.8 and §12.7;
- Jeff’s decisions H1–H24 ✅.
Unblocks:
- packet 6, the input integration, which moves the cursor to and clicks the targets this packet lists;
- packet 7, the selection’s lifetime;
- packet 16, the room assists, which builds on the room-class target hooks added here.
Companion EC: EC-017.
Pre-flight: required. The packet changes engines/terraglyph/**. The
pre-flight is written at the start of execution, as
docs/reference/pre-flight-WP-107-<date>.md.
Targets generation(s): Gen 1 (Showdown, Phantom).
Estimated effort: two to three days. The checks cover 122 rooms, and the
click audit covers 32 overrides.
Goal
Write packet 5 of the plan’s sequence: component A, TerraGlyph’s hotspot provider. For the room the player is in, it lists the eligible targets:
- each with an identity;
- each with an interaction point that hit-tests to it;
- no two sharing a point.
It also decides what current is for a press or an OK (plan §5.5: the hover
and cursor-at-point rules).
Two self-test checks come with it:
- the listing hook (§12.7), which lists every room’s targets;
- the per-room reachability check (§5.8), which proves every target in every room of both titles is reachable, and names each room that needs the reading-order fallback.
Nothing in play moves or clicks yet; packet 6 does that. With or without Hotspot Assist, a player sees no change.
Background
- What the provider must give (plan §4.3–4.6, §5.5; H2, H3, H7, H12, H13,
H17, H22):
- The list. One
Graphics::HotspotInfoper target. Each target’s identity (MagnetTarget: room or room class, and an index) is kept in a second array beside it, andHotspotInfois unchanged. - The filter (§4.6 rules 1–5):
- the eligible kinds (exits, clickables, requires and inventory objects, toolbar sprites), plus targets the room class adds;
- not hidden or detached;
- with an item in hand, exits and clickables left out;
- an empty list while a scene runs, input is blocked or the class is busy;
- a point on screen.
“Toolbar sprite” means a toolbar sprite with a click index, so the toolbar’s hit-blocker sprites are left out (
inventory.cpp:241-246at55c8b6b32ae3). - The point (§4.5, H3). The search box is the step’s polygon box, or
the union of the frame’s cels;
getFrameRect()gives only the first cel (room.h:267-268). The search tries the box’s centre, then 4 px rings outward, and takes the first on-screen point thathitTest()resolves to the sprite. Points are cached per sprite and step, and every cached point is re-checked at each rebuild. The polygon box is private today, so the packet addsRoom::getHitBox(sprite). - One target per interaction (H22, §7.6):
- A class target on a room sprite merges with that sprite.
- Toolbar sprites that click the same index are one target, such as an item over its slot or the snack box’s digits. So the open toolbar gives at most nine.
- Two genuinely different interactions stay separately reachable.
- Any other collision moves the later target’s point to its next grid point. “Later” means later in the provider’s list order: the room’s sprites in draw order, then the class’s targets in hook order, then the toolbar. The moved point still hit-tests to its own target, stays on screen and creates no new collision.
current(§5.5, H17). This is the provider’s, as Appendix C notes. From the selection’s identity (or none), the cursor and the point the cursor adapter last moved it to:- a selection whose point the cursor has left by more than 2 px drops;
- with none, a target under the cursor counts as selected. That’s a
sprite by
hitTest(), or a class target byRoomClass::navTargetAt().
It’s one pure provider function. Packets 6 and 7 call it, and packet 7 stores and drops the selection.
- The list. One
- The room-class hooks (H11, H13; Appendix B):
- Declared here: only the three target hooks on
RoomClass:addNavTargets(),isNavTargetValid()andnavTargetAt(). ButtonRoomadds its visible buttons (getButtonCount(),getButtonSprite(),room_class.h:97-98). That covers the main menu, level select, quit, Sign In’s buttons and the clue book.- Wizard’s Rule adds its six bottles, which are plain sprites (E45).
- Left for other packets: a class’s own directions,
navigate(dir), are packet 16’s. The starting mode (startMode(),keepsMode()) and OK with no target (clicksWithoutTarget(), the corral) are packet 6’s.
- Declared here: only the three target hooks on
- The click audit (WP-091, EC-013’s capture). At fork
55c8b6b32ae3there are 32bool click(int sprite) overridedeclarations in 28 headers,ButtonRoom’s own included. WP-101 added the wizard’s bedroom’s.- Why it matters: each takes a click before the kind checks
(
handleMouse(),terraglyph.cpp:362-363). Any that act on sprites of a kind H7 leaves out need the hook, or those objects aren’t targets. - Why the listing hook can’t find them: its “unpointed sprites” report covers only sprites of an eligible kind.
- Expected cases: §6.8 leaves three open as “cursor mode, or a hook”: Sign In’s player rows, the artifact jigsaw’s places and Maria’s pans.
- Not part of it: rooms that read the pointer in
tick()(Pie Noon, KST, the corral) are §6.8’s, not the click audit’s.
- Why it matters: each takes a click before the kind checks
(
- Drift since WP-091’s pin
1539a7b59cf3that bears on the provider. The session that ported these rooms flagged it, and the pre-flight confirms it at its pin:- WP-101 (fork #26): the wizard’s bedroom takes a click on the wizard (to the Wizard’s Rule room) and holds input while it gives the clue.
- WP-102 (#27): the library shelf is now a requires object.
- WP-103 (#29): the maze centre’s exits go through
leaveBy(), and taking the shears hides them and holds input. - WP-105 (#30): no change in behavior. The button sound moved to
TerraglyphEngine::buttonSound().
- The show-all display (§6.5). The same list serves ScummVM’s hotspot
display through the
getHotspotPositions()override.hotspotDirty()reports a change only after a room change, a step change, or a hide or show.- Why the drawing waits for packet 6: the display draws only while the
show action has turned it on (
Engine::drawHotspots()returns otherwise,engine.cpp:792-794;showHotspots()at:751-752), and that action comes with packet 6’s keymaps. So thedrawHotspots()call each frame moves there too. - What this packet tests: both overrides, directly.
- Why the drawing waits for packet 6: the display draws only while the
show action has turned it on (
- The checks’ environment.
- The self-test’s script checks run with the
scriptchannel at level 3 (terraglyph.cpp:134-153at55c8b6b32ae3). checkMenus()already enters rooms throughshowRoom()there (:623-624).- The bare
RoomthatcheckAllRooms()builds has no room class, toolbar or inventory, so it can’t serve (§12.7).
- The self-test’s script checks run with the
- Fork tip while drafting:
55c8b6b32ae3. The pre-flight re-pins and recounts the overrides. - Supersession check (2026-11-28). WORK_INDEX has no other provider packet, and plan §11 names this as packet 5. It takes WP-107 and EC-017 after WP-106 and EC-016.
Scope
In scope
- The pre-flight. It covers:
- the fork pin, and a fork worktree (
tools/New-ForkWorktree.ps1); - the file names, and the override recount;
- how the checks enter rooms, wait out openings and open the toolbar (see “For the pre-flight” below);
- the risks.
- the fork pin, and a fork worktree (
Room::getHitBox(sprite). The current step’s polygon box, offset by the sprite’s position, or the union of the current frame’s cels (E37).- The point search and cache (§4.5). Centre first, then 4 px rings: the first on-screen point that hit-tests to the sprite. Cached per sprite and step, and re-checked at every rebuild.
- The filter (§4.6), exactly as written, with H7’s kinds and the click gate.
- The three target hooks on
RoomClass:addNavTargets(),isNavTargetValid()andnavTargetAt().ButtonRoomand Wizard’s Rule implement them, as does any room the audit names. - The click audit. Read every override at the pin, and give each one of
these verdicts:
- Eligible kinds only: nothing to add.
- Hook added: the class now adds the sprites it acts on.
- A §6.8 cursor-mode room, recorded: its objects aren’t sprites to select, for example Sign In’s rows, the jigsaw’s places and Maria’s pans. Each is recorded as a §6.8 row.
- Jeff decides: neither rule settles it. The packet raises it rather than choosing.
The override list and its verdicts go in the WP’s §Result.
- One target per interaction (H22), with its three rules and the collision rule as defined above.
- The provider’s entry points:
- From Appendix B:
listTargets(targets, ids), and thegetHotspotPositions()andhotspotDirty()overrides. - Additions, recorded in Appendix B:
targetAt(point)(the hover lookup), and thecurrentdecision of §5.5 as one function: the selection’s identity, the cursor and the last warp point give the index, or −1.
- From Appendix B:
- The listing hook (§12.7). A self-test check enters every room of both
titles through
showRoom(), after its opening, and logs every target with its identity, label and point.- It fails if:
- a sprite target’s point doesn’t hit-test to its sprite;
- a class target’s
navTargetAt(point)isn’t its index; - a point is off screen;
- two targets share a point;
- the open toolbar gives more than one target per click index.
- It also lists:
- every eligible sprite that got no point;
- every room whose list is empty at its start state, with the reason (a busy class, input held, or a redirect).
- Its asserts, room by room:
getHotspotPositions()equalslistTargets();hotspotDirty()is false on a second read with no change, and true aftershowRoom(), a step change, or a hide or show.
- It fails if:
- The
currentdecision’s cases. In the self-test:- a selection with the cursor at its point, and within 2 px;
- the cursor moved more than 2 px away;
- hover over a sprite target, and over a class target;
- hover over nothing.
- The per-room reachability check (§5.8), on the listing hook’s
output, with everything §5.8 lists:
- States: each room as it starts, and with the toolbar open where
isToolbarHidden()doesn’t hide it, waiting until it’s open. - The graph: the press graph from
navigate(), and strong connectivity by a forward and a backward search. A failure fails the self-test. - The geometric graph:
isGeometricConnected(), with each room that needs the fallback named, with its stranded targets. - Order: the graph from the reversed list matches edge for edge, by identity.
- No selection: the smoke grid, edges included.
- The report: on a pass, one line per room and state, with the
target count and whether the fallback ran. On a failure:
- the room and the state;
- every target with its identity, label and point;
- the unreached target and the presses tried.
- States: each room as it starts, and with the toolbar open where
- The self-test passes on both titles, with no new warnings.
- The baseline: a self-test run at the pin before any change.
- The comparison: every existing check’s result matches it.
- The fork PR against
scooby-engine, merged by hand after CI passes. It’s reviewed bytools/Check-ScummvmStyle.ps1once that tool is on main (open PR #209). - Records:
- the plan: §11 packet 5 marked done; §5.8 with the list of rooms that need the fallback; §6.8 with any new rows from the audit; Appendix B with the two additions and any other departure; a revision-history row;
- this WP’s §Result, with the audit and the room results;
- EC-017;
- the WORK_INDEX row;
- the
dashboard.jsonnote.
Out of scope
- Moving the cursor, clicking, the keymaps and the input adapter.
Packet 6. That includes:
- the show-all toggle and the
drawHotspots()call; - the starting-mode hooks;
clicksWithoutTarget().
- the show-all toggle and the
- Storing and dropping the selection (§4.4), and the activation
re-check. Packet 7 calls this packet’s
currentdecision. - The Hotspot Assist option. Packet 8.
- A room class’s own directions (
navigate(dir), H24). Packet 16. - Characters as targets (H7: later).
- States reached by play and moving targets: the live tests (§12.2).
- Any change to the rules of §4.5, §4.6, §5.5 or §5.8. If the code or the rooms show a rule is wrong, the packet records it and raises it to Jeff. It doesn’t decide in code.
For the pre-flight
Points the pre-flight must settle, from the cold review of this draft:
- Run state:
- Set
_checking, orshowRoom()saves the profile. - Build fresh room classes, since classes keep state across visits
(
checkMenus()’s pattern). - Reset the inventory, with nothing in hand.
- Enter each room from one fixed room, as
checkMenus()does withshowRoom(game), because some openings depend on the room the player came from.
- Set
- Openings:
- Skip them rather than tick through, with a tick cap (§12.7).
- Handle rooms that redirect at once: the title, Big Head, the credits, the chases.
- Wizard’s Rule’s clock is the song’s position, and the room leaves when the song ends. The check needs a way to hold it.
- The toolbar.
Inventory::clickToolbar()is private (inventory.h:174,:211). UsecheckAllInventory()’s pattern instead: a click ongetVanSprite(), then run until the toolbar is open. - Runtime. A press graph costs O(16n³) through
navigate(). Time both checks over 122 rooms in two states.
Exit criteria
- Pre-flight. It exists and settles every point above.
getHitBox(), the point search and cache, and the filter implement §4.5 and §4.6 as written.- The hooks. The three target hooks are on
RoomClass, andButtonRoomand Wizard’s Rule implement them. The listing shows the menu rooms’ buttons and Wizard’s Rule’s six bottles as targets. - The click audit is complete. Every override at the pin is listed with its verdict, every “hook added” has its hook, and every “Jeff decides” is decided.
- One target per interaction. In every room, the listing hook finds no shared point, no failed hit test, no point off screen, and at most one target per toolbar click index.
- Unpointed sprites and empty lists. None, or each is listed with its reason and Jeff’s decision on it.
- The
currentdecision’s cases pass, and thegetHotspotPositions()andhotspotDirty()asserts pass. - The per-room check passes in every room of both titles, as started and with the toolbar open where it can open. The log names each room that needs the reading-order fallback, and no failing or empty room is accepted silently (H20, §7.6).
- The self-test passes on both titles with no new warnings, and every existing check matches the pre-change baseline.
- No change in play. No cursor moves, nothing new draws, and no input path changes.
- The fork PR is merged against
scooby-engine, and the merge commit is recorded. - The records are updated, including §5.8’s fallback rooms and any §6.8 rows. The strict wiki build passes.
Deliverables
- Fork:
- the provider in
terraglyph.{h,cpp}or a newmagnet_provider.cpp; Room::getHitBox();- the
RoomClasshooks, withButtonRoom, Wizard’s Rule and any room the audit names; - the two checks;
- the
module.mklines.
The pre-flight fixes the names.
- the provider in
- This repo:
- the pre-flight;
- this WP, EC-017 and the WORK_INDEX row;
- the plan’s §11, §5.8, §6.8, Appendix B and revision history;
dashboard.json.
Notes
- Hand-written (plan §14.1). The plan’s text is the specification.
- The audit is the long pole. Record each verdict as it’s made, so a stopped session loses nothing.
- A room that fails reachability or the listing is a finding, not something to hide. Record it, fix the provider if the rules say how, and ask Jeff if they don’t.
- Fork safety. Work in a fork worktree, and never switch branches in the
shared
C:\dev\scummvmcheckout.New-ForkWorktree.ps1still prints--enable-engine=scooby; useterraglyph(the fix is in open PR #211).
Result
Pre-flight: pre-flight-WP-107-2026-12-01,
at fork 837ca576da. Run sheet: EC-017.
Jeff’s decisions are at the end of this section. He decided the first on 2026-12-02: the 15 classes that answer a click on a character add those characters as targets (H25), done in a second fork PR. He decided the second on 2026-12-04: the covered targets and the empty rooms (exit criterion 6) stand as listed.
In the fork (barefootbetters/scummvm#62,
two commits, a8badf89d9 and fbcbe7aedd, merged as dcf2630b21), all in
engines/terraglyph/:
magnet_provider.cpp:listTargets()(the filter, the point search and cache, and H22’s merges and collisions);- the
getHotspotPositions()andhotspotDirty()overrides; targetAt()(the hover lookup);magnetCurrent()(§5.5).
Room::getHitBox(),Room::getDrawOrder()andInventory::getToolbarIndex().- The three target hooks on
RoomClass, implemented by:ButtonRoom(the main menu, level select, quit, Sign In and the clue book);- the drawbridge’s four flags;
- Wizard’s Rule’s six bottles.
magnet_room_check.cpp:checkMagnetRooms(), called last among the script checks. It holds the listing hook, thecurrentcases, the show-all asserts and the per-room reachability check.
The character targets (barefootbetters/scummvm#66,
one commit, e6154a9f8b, merged as 37b75bf77e), from Jeff’s H25:
RoomClassgainsNavTarget::cursor(an item’s cursor a target also answers) and three static helpers:addCharacterTarget(),getTargetCharacterSprite()andcharacterAt().- The 15 classes of the audit’s D rows implement the three hooks. Each
character is valid under the cursor and story state that its
click()and tick answer:- Brad with the shield, Jane with the duster, Shaggy with the nickel;
- Gummy with the arrow, or the dentures once his puzzle is solved;
- the Sheriff with the arrow, or the sign while he waits for it;
- Maria with the arrow, until her game is won;
- the arrow alone for Artie, the donkey, ICDouble, Ewan, Jenny, the
Princess, the wizard and the Jester. The Jester’s four rooms share
JesterControl::isTarget().
- The check gains three things:
- Item-held states. Each item’s cursor that a class target answers is held in a state of its own, before the toolbar opens. Arena 2 leaves for Brad’s game while the van drives in.
- A story pass. A new game doesn’t place the Sheriff, Gummy and the donkey, Jenny, or the Jester. Their seven rooms are entered a second time with what places them, and the dentures and the sign get their flags while held. The story pass skips the toolbar state, which the first pass covers.
- A room that asks for itself on entry is followed once. The throne room’s first visit plays Jane’s movie and comes back. Until now the check took that for a redirect, so the throne room never got its toolbar state.
The self-test, on both titles, debug build, --debuglevel=11, at
37b75bf77e (logs kept local):
Showdown:
magnet room check current: 2520 checks, 0 failed, 60 on class targets
magnet room check dirty: 57 rooms, 0 failed
magnet room check fallback in 0:
magnet room check: 69 rooms, 3 story passes, 100 states (23 with the toolbar open,
5 with an item held), 0 failures, 11 unpointed, the slowest list 4 ms
(ROOM_P06_Stage_Trapdoor), 3428 ms in all
Phantom:
magnet room check current: 2985 checks, 0 failed, 75 on class targets
magnet room check dirty: 55 rooms, 0 failed
magnet room check fallback in 0:
magnet room check: 53 rooms, 4 story passes, 88 states (29 with the toolbar open,
2 with an item held), 0 failures, 7 unpointed, the slowest list 2 ms
(ROOM_P10_Throne_Room), 2684 ms in all
At dcf2630b21, before the character targets, the check had 147 listed
states, 5,090 current cases and 15 unpointed targets, all passing.
- Reachability: 162 listed states pass, 79 in Showdown and 83 in Phantom: as started, with an item held, with the toolbar open, and in the story passes. The largest has 40 targets (Sign In). No room needs the reading-order fallback.
- The class targets: the menus list their buttons, and Sign In lists 40. The clue book in a new game shows only its exit: in Phantom that’s an exit with a destination, so it merges into the room’s target (H22). Wizard’s Rule lists its six bottles, and the drawbridge its four flags.
- The characters (H25): all 18 character targets of the 15 classes are
listed in at least one state. 17 have a point:
- as started: Artie, ICDouble, Maria, Ewan, the Princess, the wizard;
- with an item held: Shaggy (the nickel), Jane (the duster), Gummy (the dentures, in the story pass), the Sheriff (the sign, in the story pass);
- in the story pass: the Sheriff, Gummy and the donkey, Jenny, and the Jester in all four rooms.
Brad, with the shield, has no point at a new game’s frame. His 18×8 box is behind the armour pile, and a mouse click there hits the pile too. The point search tries again at each of his steps.
- Toolbar targets, one per click index: the open toolbar gives the van, Scrappy, quit, the glass, the snack box and the four slots, and never two on one index.
The 15 unpointed targets. An unpointed target is eligible, with a box on screen, but every point of its box hits something else:
| Room | Target | What a click there hits |
|---|---|---|
| Sheriff’s office | OBJ_P02_TO_P07 |
the closed door, OBJ_P02_DOOR |
| Bank | OBJ_P13_TO_P16 |
the closed door, OBJ_P13_DOOR |
| Bank vault | OBJ_P16_TO_P19 |
the closed door, OBJ_P16_DOOR |
| Hotel hall | OBJ_P17_TO_P20 |
the closed door, OBJ_P17_HOTEL_HALL_DOOR |
| Jail | OBJ_P07_JAIL_HOTSPOT2 |
Scooby, standing in front |
| Throne room (Phantom) | OBJ_P10_TO_P19 |
the throne |
| Kitchen storage (Phantom) | OBJ_P17_TO_P13 |
the closed door |
| Secret passage 2 (Phantom) | OBJ_P19_TO_P16 |
Scooby, standing in front |
Each is listed in both states where it has one, which makes 15 at
dcf2630b21. With the character targets the count is 18:
- Brad, with the shield (above);
- the throne room’s exit, now also with the toolbar open, since the throne room gets that state;
- the stage’s first slot in the story pass. Entering with Jenny’s clue given leaves the toolbar moving, and the moving hit blocker covers the slot. That state exists only in the check’s story pass.
§3.5’s rule leaves them out: a fully covered sprite isn’t a target. A mouse click there hits the same door, character or blocker. The doors are targets themselves.
The rooms with an empty list as they start (§5.8 has the summary):
| Why | Rooms |
|---|---|
| Cursor-mode room (§6.8) | Pie Noon |
| Input held, and the room leaves by itself | The chases B1, B4 and C1–C4; the strong boxes SB1–5; Artie’s close-up |
| Input held to the cap (400 ticks), a set piece | Chases C5 and C6 |
| Input held, and a skip leaves | The title, Big Head, the credits, the ghost spot (both titles) |
| Nothing eligible | The open safe (a cut scene: it takes every click with the cursor hidden); the cheat room |
Arena 2 with the toolbar open isn’t checked: the room leaves for Brad’s game while the van drives in. It passes as started.
The click audit (exit criterion 4). At the pin, bool click(int sprite)
override appears 32 times in 28 headers. Each has one of item 6’s verdicts:
- A, eligible kinds only: nothing to add.
- B, hook added.
- C, a §6.8 cursor-mode room.
- D, Jeff decides. All 15 became B with Jeff’s H25.
The kinds come from the class’s claim (kSprite builds a plain sprite) or
from the default path, which makes the names in kCharacters characters
(room.cpp:84-90).
| # | Override | Room(s) | Acts on | Kind | Verdict |
|---|---|---|---|---|---|
| 1 | Arena2Room (arena_rooms.h:65) |
Arena 2 | Brad, with the shield | character | B (H25; progress) |
| 2 | BelowBalconyRoom (below_balcony_rooms.h:59) |
Below the balcony | The vines, with the shears | requires | A |
| 3 | BelowBalconyDoorRoom (below_balcony_rooms.h:114) |
Below the balcony’s door | The Jester | character | B (H25; lines only) |
| 4 | BradGameRoom (brad_rooms.h:68) |
Brad’s three games | The armour, pressed and dragged | plain | C (row exists) |
| 5 | CloseupRoom (chase_rooms.h:106) |
Chase B2’s close-up | ICDouble | character | B (H25; progress) |
| 6 | ArtifactRoom (chase_rooms.h:152) |
The nine jigsaws | Any click; pieces follow the pointer | plain | C (row exists) |
| 7 | DiningRoomRoom (dining_rooms.h:44) |
Dining room | Maria | character | B (H25; progress) |
| 8 | RoomOfDoorsRoom (doors_rooms.h:88) |
Room of doors | The Jester (the meeting) | character | B (H25; progress) |
| 9 | DrawbridgeRoom (drawbridge_rooms.h:42) |
Drawbridge | The four flags | plain | B, hook added |
| 10 | EwanRoom (ewan_rooms.h:49) |
Ewan | The four answers | requires | A |
| 11 | RoyalGalleryRoom (gallery_rooms.h:48) |
Royal gallery | The Jester | character | B (H25; lines only) |
| 12 | GardenPlaqueRoom (garden_rooms.h:84) |
Garden plaque | The four buttons | requires | A |
| 13 | KitchenRoom (kitchen_rooms.h:45) |
Kitchen | Ewan | character | B (H25; progress) |
| 14 | MariaGameRoom (maria_rooms.h:64) |
Maria’s game | Items carried and thrown | engine | C (row exists) |
| 15 | WellInMazeRoom (maze_interior_rooms.h:176) |
Well in the maze | The Jester | character | B (H25; lines only) |
| 16 | HedgeMazeRoom (maze_rooms.h:57) |
Hedge maze | The four direction buttons | exit | A (listed: they have destinations) |
| 17 | MazeMapRoom (maze_rooms.h:134) |
Maze map | The four markers | clickable | A |
| 18 | OptionsRoom (options_rooms.h:43) |
Options | The knobs, dragged | engine | C (row exists) |
| 19 | TreasuryRoom (passage_rooms.h:107) |
Treasury | The Princess (the final clue) | character | B (H25; progress) |
| 20 | PostOfficeRoom (post_rooms.h:45) |
Post office | The hole, with the lantern | exit | A |
| 21 | ButtonRoom (room_class.h:108) |
Main menu, level select, quit, the clue book, Sign In | The buttons | engine or plain | B, hook added (H13) |
| 22 | SaloonRoom (saloon_rooms.h:48) |
Saloon | Artie; Shaggy, with the nickel | character | B (H25; progress) |
| 23 | SheriffRoom (sheriff_rooms.h:48) |
Sheriff | The four answers | requires | A |
| 24 | SignInRoom (signin_room.h:44) |
Sign In | Its buttons; the rows by the pointer | buttons; rows drawn | B (through 21); rows C, see below |
| 25 | StageRoom (stage_rooms.h:43) |
Stage | Jenny | character | B (H25; lines only) |
| 26 | RailroadStationRoom (station_rooms.h:45) |
Railroad station | Gummy (arrow, dentures); the donkey | character | B (H25; progress) |
| 27 | Street1Room (story_rooms.h:81) |
Street 1 | The Sheriff (arrow, the sign) | character | B (H25; progress) |
| 28 | ThroneRoomRoom (throne_rooms.h:42) |
Throne room | Jane, with the duster | character | B (H25; progress) |
| 29 | OpenSafeRoom (vault_rooms.h:87) |
The open safe | Every click, taken | — | A (a cut scene; nothing listed) |
| 30 | VaultClockRoom (vault_rooms.h:158) |
The vault’s clock | The hands, dragged | plain | C (row exists) |
| 31 | WizardsRuleRoom (wfr_rooms.h:63) |
Wizard’s Rule | The six bottles | plain | B, hook added (E45) |
| 32 | WizardsBedroomRoom (wizards_bedroom_rooms.h:56) |
Wizard’s bedroom | The wizard (to Wizard’s Rule) | character | B (H25; progress) |
Totals: A 8, B 18 (3 at first and 15 from H25; Sign In’s buttons ride on row 21), C 6 (Sign In’s rows among them), D 0.
Sign In’s rows. They’re drawn sprites the class reads by the pointer, so
they aren’t targets. But the up and down buttons move the selection a row
at a time, and Play plays the selected player (signin_room.cpp:433-450,
:489-490). So with the buttons as targets, Sign In plays in Magnet mode.
§6.8’s row now says so.
The D rows, now B (H25). H7 leaves characters out until their click behavior is verified. These 15 overrides are classes that give a character click a meaning. In 11 of them that meaning is progress:
- the Sheriff’s introduction and the sign;
- Artie;
- Gummy, the dentures and the donkey;
- ICDouble’s close-up;
- Brad and the shield;
- Maria;
- Ewan;
- the Jester’s meeting;
- Jane and the duster;
- the wizard;
- the Princess, who gives the final clue.
Without those clicks, neither title can be finished in Magnet mode. The other four (the Jester’s lines, three times, and Jenny’s) are flavour.
§4.6 rule 2 says “a class that catches clicks on sprites of other kinds must add them”, which reads as “add them”. H7 says characters come later. The packet raised that conflict, and Jeff settled it with H25: all 15 classes add their characters.
| # | Exit criterion | Met | Evidence |
|---|---|---|---|
| 1 | Pre-flight | ✅ | The pre-flight above, verdict READY, with each “For the pre-flight” point settled |
| 2 | Geometry and the filter | ✅ | getHitBox(), the ring search and its cache, and §4.6’s rules 1–5, in magnet_provider.cpp. The listing finds no point that misses its target, and none off screen |
| 3 | The hooks | ✅ | The three hooks on RoomClass, and no other. The listing shows the menus’ buttons and the six bottles; the check fails a menu with nothing listed, and Wizard’s Rule with other than six |
| 4 | The click audit | ✅ | The table above: all 32 overrides, each with a verdict and each “hook added” with its hook. The 15 “Jeff decides” rows became hooks with H25 (#66) |
| 5 | One target per interaction | ✅ | No shared point, failed hit test or off-screen point in any room, and at most one toolbar target per index |
| 6 | Unpointed sprites and empty lists | ✅ | Each is listed above with its reason. Jeff accepted them as listed (2026-12-04) |
| 7 | current and the overrides |
✅ | 5,505 current cases pass (5,090 before the character targets). The show-all list equals listTargets() in every state, the hotspotDirty() cases pass in 112 rooms, and the room-entry case passes on each title |
| 8 | The per-room check | ✅ | 162 listed states pass (147 before the character targets). No room needs the fallback. Every failing or empty room is named |
| 9 | Self-test on both titles | ✅ | For each fork PR, every check line matches the baseline at its pin (837ca576da, then c1f2825762; Showdown 2,220 lines, Phantom 2,004), except lines that differ between any two runs. Those are timings and random draws: Phantom’s clips, positions, and the drawbridge’s, Ewan’s and Maria’s draws; in #66’s run, also one of Showdown’s bank clock times, missing from its 80 draws. All of them are logged before the new check runs. Warnings: none new in the build; logs Showdown 0, Phantom 18, as at the baseline |
| 10 | No change in play | ✅ | Only the check calls the provider. getHotspotPositions() is called by Engine::drawHotspots() alone, which TerraGlyph never calls. showRoom() only resets the point cache and counts entries |
| 11 | The fork PR | ✅ | #62 merged as dcf2630b21, and #66 as 37b75bf77e. tools/Check-ScummvmStyle.ps1 isn’t on main yet (open PR #209), so it wasn’t run |
| 12 | Records | ✅ | Plan §4.5, §5.8, §6.8, §11, §14.3, Appendix B and the revision history; this section; EC-017; WORK_INDEX; dashboard.json. The strict wiki build passes |
The review. A cold review read the commit against the plan. The provider
held: the filter matches handleMouse()’s gate, the ring search and toolbar
merge are right, and nothing in play changes. Fixed in the second commit:
hotspotDirty()consumed its own answer. Each read stored the new state, so a second caller would take a change away from the show-all display. It’s now a pure comparison with whatgetHotspotPositions()last listed.- A class target on an exit or a clickable vanished with an item in hand. The class takes the click before the kind checks, with any cursor. It now stays listable.
- The check changed the sprite it tested. The test restored a step with
setPlayer(), which also reset the sprite’s speed. It now restores the step alone. - The check could pass silently. A toolbar that wasn’t parked, a room that left while the van drove in, and a room that never settled were not reported. They are now.
- Some cases couldn’t fail. The “over nothing” cases are now worked out
independently of
targetAt(). Every valid class target must be listed. The room-entry count is tested on its own.
Recorded, not changed:
- A moved point stays. A point moved by a collision or by something in front stays cached while it still hits its sprite (§4.5 allows it; now said there).
hotspotDirty()watches every sprite. That’s every sprite’s step and place, so with the show-all display on it’s true on most animation steps. A list costs at most 3–5 ms in a debug build. Packet 6 decides whether to narrow it.- The 2 px is per axis, as Appendix B now says.
For the next packets:
- Packet 6 calls
drawHotspots()and usesmagnetCurrent(), thennavigate(). - Packet 7 stores the selection as a
MagnetTarget. - A possible crash, not this packet’s:
MazeMapRoom::click()(maze_rooms.cpp:407-409) readsgetObjectName(sprite)before checkingsprite < 0. A click on empty space in the maze map passes −1. Found by reading, not run. Fixed 2026-12-04 in fork PR barefootbetters/scummvm#76 (merged as323e89d12f): the check now comes first. The crash was latent: a 20 px hover sweep of the map never reads −1. The seeded self-test is unchanged on both titles.
Jeff’s decisions:
- The character clicks (the audit’s D rows). Decided 2026-12-02: yes, all 15 (H25 in the plan’s §10.4). Each class adds its characters through its hook, as §4.6 rule 2 reads. Characters that no class answers stay out, as H7 has it. Done in #66.
- The unpointed targets and the empty rooms above. Decided 2026-12-04: accepted as listed. Each matches what a mouse click there does, since it hits the door, character or blocker in front, or the room holds input or leaves by itself.