Skip to main content

Module card

Module card 

Source
Expand description

The render card (ADR-0052 §6, ticket 2392): one fixed frame with every kind of thing a frame draws, so a backend’s window is held to the raster for all of them, with no game behind it. shuyi-app’s render_card example draws it in a window and compares the window with RenderCard::painter’s picture, in CI’s render job.

The card holds:

  • cells: backgrounds in several colours, see-through cells, glyphs in several colours, and a glyph the atlas lacks (the fallback, in MISSING_COLOR); wide glyphs among narrow ones, each over its two cells, and one without its continuation (the fallback too);
  • rectangles and sprites in both layers; sprites in every Paint, at opacity 255 and 128, at brightness 255 and 102, mirrored, cut by their clip, and one whose image is missing;
  • painted pictures (ADR-0078) of every kind, RGBA (some pixels clear or half clear), indexed and one-bit (with a mask and without), in both layers, at brightness 102, cut by a clip, part of one, and one the frame’s table lacks;
  • a backdrop at zoom 2, its scene offset by half a scene pixel, with a painted picture of its own;
  • the debug view’s gizmos (ADR-0085) over everything: lines into all eight octants, rectangles’ outlines (one cut by a clip), crosses, circles’ outlines (one of radius 0) and labels in the cells.

Its pictures are made in code: the test card and a small font atlas of boxes and bars, and a wide glyph, and the painted pictures’ pixels. A new Item, Paint, Layer or PaintedKind variant goes on the card in the change that adds it: the tests don’t compile until it does.

Structs§

RenderCard
One fixed frame with every kind of thing a frame draws, and what paints it.

Constants§

COLUMNS
The card’s size in cells (8 × 16 pixels each): 256 × 192 pixels.
MISSING_PATH
The path of the picture that is missing: in RenderCard::table, not in RenderCard::images.
PAINTED_INDEXED
The painted indexed picture.
PAINTED_MASKED
The painted one-bit picture with a mask.
PAINTED_MISSING
A painted picture the frame’s table lacks.
PAINTED_ONE_BIT
The painted one-bit picture without a mask.
PAINTED_RGBA
The painted RGBA picture.
PAINTED_SCENE
The backdrop scene’s painted picture.
ROWS
See COLUMNS.
TEST_CARD_PATH
The test card’s path in RenderCard::table.

Functions§

build
The render card.