P20.1: FPS counter — env-gated dev overlay (M3TE_FPS), off by default
Add a small top-left FPS readout for gauging frame cost while tuning the organic animations. Gated behind the M3TE_FPS startup env pin (read like the other M3TE_* hooks); unset/=0 renders nothing, so default play and every committed golden stay byte-identical. - main.sx: g_fps_on (from M3TE_FPS) + g_fps_avg_dt, an EMA of delta_time (FPS_DT_SMOOTH=0.9) advanced only on the gated path; build_ui passes the smoothed FPS + flag into BoardView. delta_time is real wall-clock even when M3TE_ANIM_TIME pins the scene, so the counter stays live while frozen. - board_view.sx: BoardView.fps_on/fps fields + render_fps_overlay — "FPS n" in the top-left safe-area corner (clear of notch/Dynamic Island + the HUD), dark grape text over a bright halo. Drawn last, only when fps_on. - README.md: document M3TE_FPS (sim SIMCTL_CHILD_ + device devicectl env). - goldens/p20_fps.png: FPS overlay over the resting board (M3TE_FPS=1, M3TE_ANIM_TIME=0); FPS digits are dynamic, rest pinned == p6_idle_t0 region. Verified: ios-sim build + 22 logic tests green. Unset capture's board+HUD region is byte-identical to goldens/p6_idle_t0.png; the only ON-vs-OFF delta is the top-left FPS text box.
This commit is contained in:
32
README.md
32
README.md
@@ -344,6 +344,36 @@ env SIMCTL_CHILD_M3TE_FX=11 SIMCTL_CHILD_M3TE_ANIM_TIME=3.0 \
|
||||
The change is render-only — no `board.sx` model change, and normal play is
|
||||
byte-identical apart from the fall's per-column timing.
|
||||
|
||||
### FPS counter — dev overlay (P20.1)
|
||||
|
||||
A small FPS readout for gauging frame cost while tuning the animations. It is a
|
||||
**dev overlay, OFF by default**: only the `M3TE_FPS` env pin turns it on, so default
|
||||
play and every committed golden stay byte-identical (with `M3TE_FPS` unset the
|
||||
rendered scene is unchanged — `goldens/p6_idle_t0.png` reproduces exactly).
|
||||
|
||||
- `M3TE_FPS=<non-zero>` renders the FPS counter in the **top-left corner** (inside
|
||||
the safe area, clear of the centered notch / Dynamic Island and the centered HUD).
|
||||
The rate is computed from the per-frame `delta_time` as an exponential moving
|
||||
average (`FPS_DT_SMOOTH = 0.9`) so the digits don't jitter. Read once at startup
|
||||
like every other `M3TE_*` pin; `=0` or unset leaves it off. Purely a render
|
||||
overlay — no board / score / move / animation state changes, and it never gates
|
||||
input. `delta_time` is real wall-clock even when `M3TE_ANIM_TIME` pins the
|
||||
animation, so the counter stays live while the rest of the scene is frozen.
|
||||
|
||||
```bash
|
||||
# FPS counter over the resting board: goldens/p20_fps.png
|
||||
# (the FPS digits are DYNAMIC — only the FPS text varies run-to-run; the rest of the
|
||||
# scene is pinned at M3TE_ANIM_TIME=0, byte-identical to goldens/p6_idle_t0.png)
|
||||
env SIMCTL_CHILD_M3TE_FPS=1 SIMCTL_CHILD_M3TE_ANIM_TIME=0 \
|
||||
xcrun simctl launch --terminate-running-process booted co.swipelab.m3te
|
||||
# On device, pass the same flag through devicectl's environment instead:
|
||||
# xcrun devicectl device process launch --environment M3TE_FPS=1 ... co.swipelab.m3te
|
||||
```
|
||||
|
||||
`goldens/p20_fps.png` is the only golden that captures this overlay; because the FPS
|
||||
digits are dynamic, compare the FPS text's PRESENCE in the top-left corner, not its
|
||||
exact value. Every other golden is captured with `M3TE_FPS` unset and is unaffected.
|
||||
|
||||
## Audio bank (P10) — final model
|
||||
|
||||
The SFX bank (`audio.sx`) is a purely additive layer over iOS **System Sound
|
||||
@@ -470,5 +500,5 @@ sips -z 128 768 --setProperty format png <generated>.png --out assets/gems/gems.
|
||||
|
||||
After any art change, re-capture the affected goldens with the deterministic hooks
|
||||
above (`M3TE_ANIM_TIME` / `M3TE_SELECT` / `M3TE_FX` / `M3TE_BADSWAP` / `M3TE_TARGET` /
|
||||
`M3TE_MOVE_LIMIT` / `M3TE_RESTART`) and state per golden whether it was refreshed,
|
||||
`M3TE_MOVE_LIMIT` / `M3TE_RESTART` / `M3TE_FPS`) and state per golden whether it was refreshed,
|
||||
left unchanged, or removed.
|
||||
|
||||
Reference in New Issue
Block a user