WP-132: Game thumbnails in the TV app’s grid

Status: ✅ Done (2026-11-30), every exit criterion met. Fork PR barefootbetters/scummvm#56 merged on 2026-11-30 (merge commit e32c4137ae), private PR barefootbetters/scooby-engine-private#69 the same day (squash 3d4f14c). The TV runs 26041070 with the covers (§Result), Phantom’s the English front Jeff supplied after execution (D4); they hold with ScummVM’s downloaded icon packs too (2026-12-01). The pack also carries 54 Humongous covers (2026-12-01), for when a TV build adds the SCUMM engine. Decisions D1–D4 answered by Jeff on 2026-11-30: D3 by supplying the games’ box-front covers, D1, D2 and D4 all as recommended (§Decisions, DECISIONS.md). Phase: 5 (polish & distribution). Depends on:

Unblocks: a launcher whose games are recognisable at 3 m, ahead of the first store release (WP-084). Companion EC: EC-019. Pre-flight: required. D1’s recommendation adds a commit to the fork’s shared code (common/zip-set.cpp, outside engines/terraglyph/), and the packet changes what the TV build packages. Targets generation(s): none. The grid and the icon packs are engine-independent. The covers are for Gen 1 titles (Showdown, Phantom) and detected Gen 2/3 titles (D2), and no engine code changes. Estimated effort: 1 day for the mechanism, the pack script and the TV check.


Goal

Each TerraGlyph game in the TV app’s grid shows its own box-front cover instead of the grey tile with its name. The covers ship as an icon pack in the private identity, never in the fork. A plain ScummVM build is unchanged.

Background

How the grid finds a thumbnail (gui/widgets/grid.cpp, GridWidget::reloadThumbnails() on the fork’s scooby-engine):

Where the icons set comes from (GuiManager::initIconsSet() and Common::generateZipSet()):

Why the TV app can’t just ship a file today:

Measured on the TCL 65Q77K (2026-11-30, versionCode 26041041, the TV’s 1920×1080 GUI at gui_scale=140, the TV theme). Packs were placed by hand in the app’s icons folder. Captures stay local, as they show the app’s name.

The covers (Jeff, 2026-11-30; kept with the private material, with an artwork-manifest.json that records each one’s source edition): 512 × 512, PNG colour type 2 (RGB), 8-bit. They meet the specification as supplied. Seven are Scooby-Doo titles and two are Humongous titles. In the fork’s detection table these four have a TerraGlyph game id:

gameid Cover
showdown Showdown in Ghost Town, retail box front
phantomknight Phantom of the Knight, German retail box front (D4)
jinxsphinx Jinx at the Sphinx, retail box front
casefile1 Case File #1: The Glowing Bug Man, retail box front

activitychallenge has no cover. Case File #2 and #3, Classic Creep Capers (an N64 title) and the two Humongous games have no TerraGlyph game id.

Scope

In scope

  1. The thumbnail specification, recorded in the private identity README: 512 × 512 px, RGB or RGBA PNG (no palette), square, nothing essential in the flag corner (top-right, 25% × 13%) or the platform corner (bottom-right, 17% square), and any lettering at least 56 px tall in the source.
  2. The covers for the game ids D2 names, copied into the private identity (thumbnails/, with the manifest) byte for byte, never re-encoded.
  3. A pack script, New-ThumbnailPack.ps1 in the private identity’s tools/, in PowerShell 7:
    • it reads a map from gameid to cover file;
    • it checks each cover’s size and PNG colour type (2 or 6);
    • it writes the zip assets/gui-icons-tvapp.dat with entries at icons/terraglyph-<gameid>.png;
    • it is re-runnable, and the same covers give entries byte-identical to the covers.
  4. The fork mechanism, as D1 decides. With (a), generateZipSet() also adds the gui-icons*.dat packs SearchMan holds, so an APK’s asset-root pack loads:
    • after the iconspath packs and before the default file;
    • never the default file twice.

    One brand-free commit, written upstream-ready.

  5. The TV build: FreeType and the private identity, versionCode above the TV’s current one, adb install -r only.
  6. Plain build unchanged: with the identity unset, no pack in the APK, and the grid as before.

Out of scope

Decisions for Jeff

Jeff, 2026-11-30: D3 answered by supplying the covers; D1, D2 and D4: “Yes, all three”. Every recommendation below is the decision.

# Decision Options Recommendation (approved)
D1 How the pack reaches the grid (a) ship gui-icons-tvapp.dat at the APK’s asset root and let generateZipSet() also load packs from SearchMan (one fork commit); (b) replace gui-icons.dat by name with a merged copy, and override MD5SUMS too so updates extract it (no fork commit); (c) have the Android activity copy asset-root packs into iconspath at start (Java) (a). It reads the pack in place, as the theme and tvapp.ini are read, so no extraction step can go stale. A plain build has no such pack and behaves as before. (b) has to rebuild a merged file and MD5SUMS on every fork update. (c) duplicates the file and adds Java for the same result.
D2 Which covers ship (a) every detected TerraGlyph game with a cover: showdown, phantomknight, jinxsphinx, casefile1; (b) only the two the app plays today (a). About 1.9 MB, and a game shows its cover the day the app adds it. No terraglyph.png fallback until there’s art for one, so activitychallenge keeps the grey tile.
D3 What the thumbnails show (a) studio-made title cards; (b) the games’ own box art Answered (b) by Jeff, 2026-11-30: he supplied the box-front covers.
D4 Phantom’s cover is the German edition (a) find the English retail front and use it; (b) ship the German one (a). The app is English, and the tile reads “Entführung im Spukschloss” under the logo. (b) ships now if an English scan isn’t to hand.

Dependencies

Execution

  1. Pre-flight.
    • Remove the preview pack from the TV (files/icons/gui-icons-preview.dat).
    • Confirm the SearchMan route on the device: a pack at the APK’s asset root is listed by SearchMan.listMatchingMembers(), and the loading order puts it above the default gui-icons.dat.
    • Record the TV’s versionCode.
  2. The fork commit (D1), tested on Windows first. With a pack on SearchMan’s path, the thumbnail shows; with none, the debug log shows the same packs as before.
  3. The covers and New-ThumbnailPack.ps1. Run the script, then check the pack’s entries against the covers byte for byte.
  4. The TV build and install. Captures at 4 and 3 per row, and the list view unchanged.
  5. A downloaded icon pack. If the app offers the download, check TerraGlyph’s covers still show with it in iconspath.
  6. The plain build check.
  7. Close: fork PR, private PR, docs.

Exit criteria

  1. D1–D4 answered and recorded in docs/ai/DECISIONS.md (2026-11-30).
  2. Phantom’s English retail front in the pack (D4), or, if none is to hand, the German cover with that noted in §Result. The English front Jeff supplied, cropped square (§Result).
  3. On the TCL, each game the app has from D2’s list shows its cover in the grid, at 4 and at 3 per row (captures, kept local). It is drawn at the measured size, 256 px at 4 per row.
  4. The pack is rebuilt by New-ThumbnailPack.ps1 alone, and its entries are byte-identical to the covers.
  5. An update install (adb install -r over the previous build, no data cleared) shows the covers without a reinstall, with no hand-placed pack in iconspath. This is the MD5SUMS failure D1 avoids.
  6. With the identity unset, the APK has no gui-icons-tvapp.dat and the grid’s tiles are unchanged (capture or debug log).
  7. The fork commit is brand-free: git log -p over it grepped for the app’s name, its distinctive word and the package id, with no hits beyond the author line.
  8. The build has no new warnings in the changed file under clang (Android) and GCC (Windows).

Deliverables

Notes

Result

Run on 2026-11-30 by the session that pre-flighted it (pre-flight-WP-132-2026-11-30, EC-019).

How it works

Checked

Captures are in C:\pcloud\BB\DEV\wp-132-tv-captures\, kept out of git as the TV’s show the app. SHA-256 prefixes:

Check Capture SHA-256
Pre-flight: preview pack removed, grey tiles again (pixel-identical to WP-118’s grid capture) pf-grey-tiles EB51BF3A5259
Windows, the baseline exe, no pack: shaders.dat, gui-icons.dat win-shot-A-base-nopack D5C2F66C34A4
Windows, this commit, no pack: the same two files, grey tiles (criterion 6’s debug log) win-shot-B-wp132-nopack 2067ADF94131
Windows, the pack in the current folder: loaded between them, both covers shown win-shot-C-wp132-datapack 760A3934159B
Windows, plus a stand-in downloaded pack in iconspath (a red card for showdown): it loads first and wins; Phantom falls through to the pack win-shot-D-wp132-both C1E55776D684
Windows, the baseline exe with the pack in the current folder: ignored, grey tiles win-shot-E-base-datapack B85BD14C23B2
TCL, 26041050, 4 per row: both covers; the log loads shaders.dat, gui-icons-tvapp.dat, gui-icons.dat, no already present warning. Each cover measures 256 × 256 px tv-4perrow 879D82765FEB
TCL, 3 per row: both covers, about 380 px wide tv-3perrow 3F46CCA4711D
TCL, the list view: unchanged tv-list 81B669763D5D
TCL, 26041051 over 26041050: only the pack changed (showdown a test card); the test card shows at once tv-upd-51 B96A53C378A8
TCL, 26041052 over 26041051: the real pack again; the cover shows, pixel-identical to 26041050 tv-upd-52, tv-final 879D82765FEB
TCL, 26041060 over 26041052: Phantom’s English cover (D4), a pack-only update; scummvm.ini byte-identical after tv-en-60 39A5D326D314

D4: Phantom’s cover

This session looked for the English Windows front on MobyGames, but its covers page answered with a bot check (HTTP 403) that this session doesn’t get past, and an archived copy was off limits. The first builds (26041050–52) shipped the German cover. Jeff first answered “Keep German cover”, then supplied an English front: “here is an english cover”. D4’s notes are in DECISIONS.md.

The English cover is the GSP edition’s box front, a 714 × 1000 WebP (SHA-256 95907731…4B35), kept in the private identity at thumbnails/source/. A portrait box doesn’t fit the square tile, so the thumbnail is cropped and resized:

The flag corner falls on sky and the platform corner on the stone floor. The other three covers are still Jeff’s PNGs byte for byte; this one is derived, and the manifest records its source and crop.

On the TV it went in as a pack-only update: 26041060 has the same MD5SUMS and libscummvm.so as 26041052, and only the pack differs.

At Jeff’s request the English PNG is also in his pCloud set (terraglyph/scooby-doo-phantom-of-the-knight.png, SHA-256 52EA0B7C…7AF5, equal to the private copy). The German PNG stays beside it as -de.png. Its manifest entry matches the private one, but for the paths: the source is the WebP Jeff had already put in that folder. (Jeff’s later rebuild of that set moved the German PNG and the WebP to its archive folder, with the manifest’s paths updated.)

Follow-up: Activity Challenge’s cover (2026-11-30)

Jeff: “add Activity Challenge’s cover to the TV pack”. The cover is the 2001 Bonus CD sleeve front, a 640 × 559 JPG from archive.org that Jeff’s rebuilt pCloud set carries. It’s kept in the private identity’s thumbnails/source/. The pCloud thumbnail centres the sleeve, which puts the language flag over the top of “ACTIVITY”. The pack’s copy is resized to 512 wide with all the padding on top, so the flag sits on plain colour, and nothing is cropped or stretched. The bottom-right platform corner covers only the AOL trial badge and the end of “The Learning Company”.

Private PR barefootbetters/scooby-engine-private#71 (160601b).

Follow-up: the Download Icons check (2026-12-01)

Jeff: “run the Download Icons check on the TV”. On 26041061, Global Options → GUI → Download Icons found 12 packs, 356.8 MB, from scummvm.org, and fetched them into iconspath (files/icons, gui-icons-20211112.dat to gui-icons-20261010.dat).

Afterwards the TV went back to its state before the check: the app stopped, the 12 packs removed through run-as (files/icons empty), and scummvm.ini restored from the pre-flight copy, byte-identical (A1354D35…) before and after a launch. The grid after that launch is tv-ac-61 again. Download Icons fetches them again in about two minutes. At Jeff’s request the packs were downloaded again the same day, and the TV keeps them.

Follow-up: Humongous covers in the pack (2026-12-01)

Jeff: “Add the Humongous covers to the TV pack”. His thumbnail set holds 68 Humongous Entertainment (HE) titles. ScummVM’s SCUMM engine detects 54 of them (engines/scumm/detection_tables.h), and those 54 go into the pack, byte for byte from his set, as icons/scumm-<gameid>.png. The other 14 aren’t SCUMM games (the later Backyard Sports titles among them), so the launcher can’t add them. The private pack script now maps covers per engine. The pack is 23,429,684 bytes with 59 entries, and rebuilding it gives the same file.

Not done or not checked