Skip to content

The UI examples are scenes; a new 12_font example; install.sh knows Alpine - #62

Merged
omardev29 merged 3 commits into
mainfrom
ccr-0e58095e-jh8d23
Nov 22, 2026
Merged

omardev29 merged 3 commits into
mainfrom
ccr-0e58095e-jh8d23

Conversation

@omardev29

@omardev29 omardev29 commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

What changed, and why

Omar asked (2026-11-21) for three things in the framework: the menu examples in the scene model, a menu with a font like JetBrains Mono ExtraBold, and Alpine's packages in the installer.

The UI examples are scenes.

  • 01 to 07 start with RMP_GAME, not RMP_ENTRY_POINT with their own InitWindow:
    • on_ready becomes the scene's _ready(), the frame's logic _update(), its drawing _draw();
    • the file's state becomes the scene's members, and the window flags go (RMP_GAME already opens a resizable window).
  • 01_menu has a scene per screen: MainMenuScene, OptionsScene, ConfirmScene and PlayingScene, in src/scenes/, with change<>() between them. Its script now says which scene is on top at each shot (expect scene).
  • 05_inventory's scene owns the icon and hands it to the grid.
  • The other platform-specific examples (ads/, assets/, platform/) keep their raw entry point, as Omar said.

Every shot of the seven is byte for byte what it was. I played the seven scripts before and after the change, in build/examples-check (PLATFORM=Memory, the examples' optimised renderer):

  • the driver's hash of every one of the 29 shots is the same;
  • before the change, those shots already matched the committed goldens here.

No golden moves.

A new example, ui/12_font. Omar asked for a menu in JetBrains Mono Nerd Font ExtraBold "or something similar if the licence does not allow it". JetBrains Mono and the Nerd Font patches are under the OFL, which tools/license_db.py does not accept, and adding it would change a gate. So it uses Hack Bold 3.003 (Source Foundry): monospaced, bold, MIT, with DejaVu's public-domain changes and the Bitstream Vera licence it derives from.

  • It is unmodified, with its sha256 and source in resources/README.md and its licence in resources/License-hack-bold.ttf.txt, the pattern of ui/09_skinned's font.
  • It has three scenes (title, options, credits), all in the font through one rmp::ui::set_font().
  • Its script tests/e2e/ui/12_font.e2e has four shots and four expect scene assertions.
  • I looked at the four pictures locally: the title at 48 is sharp, the options' controls, the credits, and the notice.
  • Its goldens come from the image (3a75eef): the four shots of this PR's first e2e run (44939040409, e2e-pictures). I looked at each one, and each is byte for byte what the laptop drew.

install.sh knows Alpine. It finds apk and names Alpine's packages:

  • samurai is Alpine's Ninja, and build-base its compiler and make;
  • the X11 or DRM headers come with mesa-dev and linux-headers.

I checked every package name against Alpine 3.22's own APKINDEX; Alpine 3.21 and later have CMake 3.31 and Python 3.12. There are two new cases in InstallTest, one desktop (with and without doas) and one console.

07_responsive pays its lint debt. breakpoint_name() returns a std::string_view, so its custom-rmp-raw-pointer line leaves tools/lint_debt.txt.

The docs follow in omardev29/rmp-docs, branch ccr-0e58095e-jh8d23, pushed to main after the merge with FRAMEWORK_REF bumped:

  • the install commands for Debian/Ubuntu, Fedora, Arch and Alpine;
  • working inside the build image with rootless Podman;
  • apk in the installer's list and in the console table;
  • 12_font in the examples, and 01_menu's scenes.

The ladder

Stage Where Result
rmp fmt check laptop every file is formatted
clang-tidy on every changed example file laptop, build/examples-check nothing but the one raw-pointer line now paid
The seven UI scripts before and after laptop, examples_build.sh's configuration 29 shots, every hash identical; 01_menu's expect scene lines pass
ui/12_font script laptop E2E PASS, 9 checks over 81 frames; 4 shots looked at
InstallTest laptop the apk cases pass
rmp test (xvfb-run -a ./rmp test) laptop PASS, every stage, with 12_font's goldens in place. The rm-guard this session puts first on PATH broke 5 tests of campaign_test.FuzzBuildCompilerTest (rm: command not found in their tool folder); they fail the same on main, and pass with that one folder off PATH.
e2e this PR's CI, the pinned image the seven converted examples compared exactly and pass; 12_font failed only for its missing goldens, now committed

Seen red first

  • The apk cases in InstallTest: on the old install.sh, the three cases (the desktop one with and without doas, and the console one) failed, and they pass on the new one.
  • 01_menu's expect scene: with 12 expect scene OptionsScene planted, the script failed with E2E FAIL 17: expected OptionsScene on top after frame 12, and it is PlayingScene.

Not verified

  • Alpine itself: a real Alpine machine running the installer, and a native build there. No container engine here; the package names are checked against Alpine's own index.

Checklist

  • rmp fmt check is clean.
  • rmp lint is clean on what changed.
  • rmp test passes.
  • rmp test examples passes: the seven converted examples locally, byte for byte; the rest in CI.
  • The docs say what the code now does: the rmp-docs branch above.
  • An API change: none.
  • No gate was weakened: a lint debt line removed, no golden moved.
  • No secret anywhere.
  • Commits are plain, in Omar's name.

Generated by Claude Code

… in the scene, 01_menu a scene per screen with change<>() between them and its script asserting which is on top -- every shot of the seven byte for byte what it was. A new example, ui/12_font: a title, options and credits in Hack Bold (MIT, unmodified) through one set_font(), its script and four shots looked at; its goldens come from the image. install.sh names Alpine's packages (apk: samurai, build-base, linux-headers), seen red first. 07_responsive returns a string_view: its raw-pointer debt is paid
… e2e run (44939040409), looked at -- the title, the options changed by keyboard, the credits and the notice -- and byte for byte what the laptop draws
…tself, like every other one there; the third row of three becomes two rows of two
@omardev29
omardev29 merged commit 982bf2a into main Nov 22, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant