Skip to main content

Module frame

Module frame 

Source
Expand description

Frame compositing: the baked background plus animated elements at time t. Particles snap to the cell grid (exact palette, small GIF diffs); sprites use integer nearest-neighbour scaling.

The activity, character and prop art come through SceneArt, so the same code plays live scenes (built-in art) and saved ones (their own copy).

Every draw records the rectangle it writes, so IncrementalFrame can make the next frame from the last one by restoring and redrawing only those rectangles (the live wallpaper, PLAN.md section 5.3), and report what changed.

Structs§

IncrementalFrame
A frame kept between calls: each new time redraws only what the last frame and this one draw over the background. The image always equals render_frame_with_art at the last time given.
PixelRect
A rectangle of pixels, inside the image it belongs to.

Functions§

hero_time
The still-frame time used for stills, thumbnails and the static wallpaper: the first moment at or after the scene’s ember-based hero time (50 ms steps, up to 10 s) when the character shows the first frame of its activity’s start state, so a still never catches a blink or a mid-gesture. Independent of the Buddy toggle, so toggling it keeps the same moment.
hero_time_with_art
hero_time with the given art.
render_frame
Composites one frame at t_ms over a baked background (live clock).
render_frame_clocked
Like render_frame, with an explicit character clock: Clock::Loop makes the character follow the activity’s loop script for a seamless GIF.
render_frame_with_art
Composites one frame with the given art (built-in, or a saved scene’s).