Pre-Flight — WP-131 — 2026-11-30
Filled-in copy of docs/reference/pre-flight for WP-131. Verdict at the bottom.
Drafted and executed by one session, the one that did WP-130, after Jeff said “Execute WP-131” (2026-11-30). Checked at claim time: no
wp-131branch in either repository, and no PR naming WP-131 but the drafting PR #324 (merged). The claim branches were pushed before anything else.
Header
- WP:
WP-131 - Title: The ImGui debug panel (Gen 1)
- Pre-flight date:
2026-11-30 - Targets generation(s): 1
- Targets disc(s): Phantom for the runs; the code covers both titles.
Dependency check
| Prereq | Status in WORK_INDEX |
Notes |
|---|---|---|
| WP-130 | ✅ Done | The operations the panel calls, and the hit overlay. Fork PR #55 merged (bcefc97cf4). |
Rule check: every prereq is ✅ Done.
Repo + disc state
- Docs repo: branch
claude/wp-131-imgui-debug-panelcut fromorigin/main @ 6c655d4, pushed at once. - Fork worktree, the claim:
tools/New-ForkWorktree.ps1 -Branch wp-131-imgui-debug-panel, forked fromorigin/scooby-engine @ bcefc97cf4, the branch pushed at once. - Disc image Scooby Doo Phantom of the Knight.iso mounted at
K:\scooby.
The build
- FreeType.
pacman -S mingw-w64-ucrt-x86_64-freetypeinstalled FreeType 2.15.0, with libpng, harfbuzz, graphite2, glib2, brotli and python-packaging as its dependencies. UCRT64’s SDL2 is 2.32.10. configure(--disable-all-engines --enable-engine=terraglyph). With FreeType there, it still reported “Feature Dear ImGui based debugger is disabled as unused by enabled engines” andImGui... no. An engine has to name the component in itsconfigure.engine(Director and qdengine listimgui). With"imgui"added to TerraGlyph’s, it reportsImGui... yes, andconfig.hdefinesUSE_IMGUIandUSE_IMGUI_SDLRENDERER2. Soconfigure.enginejoins the packet’s files.- Both graphics paths draw it. The SDL backend renders ImGui from the
OpenGL graphics manager and from the SDL-surface one
(
backends/graphics/{openglsdl,surfacesdl}), so the engine’s 640×480 RGB565 mode needs nothing of its own. - Every build changes.
configurenow also finds FreeType and libpng, so every desktop build links them, with ImGui or without: the--disable-imguibuild’s DLL list (ldd) is the same as the ImGui build’s.Make-Release.ps1gathers the DLLs withldd, so it bundles the new ones without a change, and its build would defineUSE_IMGUItoo. The panel stays behind the debug channel there.
What the code has (read at bcefc97cf4)
- The channel. ScummVM defines
kDebugImGui(“imgui”, “Show ImGui debug window (if available)”) incommon/debug.hfor every engine. Director and qdengine use it, so the engine doesn’t add its own. The packet’s “a new debug channel” is this one. - The callbacks.
OSystem::setImGuiCallbacks()takesinit,renderandcleanup. The render callback runs inside the backend’supdateScreen(). The engine’s own drawing (showRoom(),drawRoom(),playMovie()) callscopyRectToScreen()andupdateScreen(), so the panel can’t run an operation from inside its callback. It queues a command, and the run loop runs it before the next tick. - One write path. WP-130’s
runTestScript()handled its debug verbs inline. They move to one dispatcher,runDebugCommand(), which the script and the panel’s queue both call.
Scope lock
This repo: docs/work-packets/WP-131-imgui-debug-panel.md, this file,
WORK_INDEX.md.
Fork, engines/terraglyph/: debug_panel.{h,cpp} (new);
configure.engine; module.mk; debug_tools.cpp (the dispatcher and the
queue); clues.cpp (getSuspects()); terraglyph.{h,cpp} (the callbacks
in run(), the queue in the loop, the script driver on the dispatcher,
getters). Staged by name.
Risk review
| Risk | Likelihood | Impact | Mitigation |
|---|---|---|---|
| The panel writing state from inside the render callback. | med | high | Every control queues a command; a search of debug_panel.cpp for setter calls. |
| The script verbs changing behaviour on the move to the dispatcher. | med | med | Re-run WP-130’s live script on this build and compare its Debug: lines and refusals. |
| ImGui compiled in changing the game with the channel off. | low | high | The self-test with the channel off, against the WP-130 run. |
| The live check needs clicks a script can’t send. | high | med | ImGui reads SDL’s events, not the engine’s, so test_script can’t drive it. The clicks need desktop control or Jeff. |
Verdict
- READY TO EXECUTE
- NOT READY
Prepared by: Claude (WP-131 session, drafting + execution in one) Date: 2026-11-30