/tg/ Station 13 - Modules - Types — Var Details - Proc Details

dirt_surface

One direction of a body's dirt surface. Dirt lies on limbs, not on the screen: every pixel of the body and of a margin round it maps to a limb, an angle round that limb (theta) and a height along it (h), so a mark keeps its place on the body as the mob turns.

Per-pixel lists are indexed y * width + x + 1, in the reference generator's coordinates: x from the left and y from the top, both from 0. That pixel is (x + 1, height - y) in an icon.

Vars

band_builtWhether outline_band() has marked DIRT_PIXEL_BAND, which waits until it's asked for.
directionThe direction it's seen from.
eye_softalist(index = TRUE) on an eye's diagonals, which take film at most.
face_guardWhere nothing may be drawn: alist(index = DIRT_GUARD_EYE) on an eye and the pixels beside it, DIRT_GUARD_MOUTH on a human mouth. A few pixels, so it keeps only those.
flags_ofEach pixel's flags, one number, or null off the surface: its limb (DIRT_PIXEL_LIMB()), its zone (DIRT_PIXEL_ZONE(): the body zone whose image shows there, dirt_zone_owners()'s, or none off the body), and the marks DIRT_PIXEL_RIM, DIRT_PIXEL_OUTLINE and DIRT_PIXEL_BAND.
height_ofEach pixel's h, from -0.2 to 1.2: the margin runs past the limbs' ends.
limb_row_pixelsIts pixels by limb and row, from dirt_surface_rows(), or null until they're asked for.
limb_rowsalist(limb = alist(row = list(leftmost column, rightmost column))): each row a limb's sprites cover, hidden parts included.
outline_builtWhether outline() has marked DIRT_PIXEL_OUTLINE, which waits until it's asked for.
theta_ofEach pixel's theta, from -180 up to 180.

Procs

NewBuilds one direction of a body's surface from the sprites it draws.
find_rimMarks the rim (DIRT_PIXEL_RIM): the silhouette's edge, body pixels with a side off the body or off the canvas, and the margin's first ring. Each leg's lowest row is its sole and stays off it. The body's pixels off the rim are its interior.
guard_faceGuards the face: nothing on an eye or the pixels beside it, film at most on its diagonals, and nothing on a human mouth, whose pixels are the human head sprite's.
map_bodyReturns each body pixel's limb: its zone's, except below the belt, where the torso's pixels go to the legs. Facing south or north they split down the middle; in profile they go to the near leg. Each body pixel's zone goes in its flags.
measure_rowsFinds the rows each limb covers and its span in each, from its zones' whole sprites, the torso's only above the belt. A leg also spans the torso pixels it took below the belt, in the rows its own sprite misses.
outlineMarks DIRT_PIXEL_OUTLINE on the body pixels a covering coat fades at: the silhouette's edge, and where the head, an arm or a hand meets another zone. The legs' meeting with the chest stays off it: a film line there read as a waistband. Marked once.
outline_bandMarks DIRT_PIXEL_BAND on the outline and the pixels beside it, where a covering coat breaks in profile: whole, it ran the torso's height as one band. Marked once.
pixel_indexReturns a pixel's index in the per-pixel lists, or null off the canvas.
place_pixelsPlaces each pixel of the body and its margin on its limb, from the limb's span in the nearest row it covers, the upper one on a tie. Theta is the angle whose sine is how far the pixel sits from the span's middle, as a fraction of its half width, turned to the direction; h runs from the limb's lowest row, 0, to its highest, 1.
spread_marginReturns each pixel's limb with the margin added: DIRT_SURFACE_MARGIN rings round the body, each margin pixel taking the limb of the first pixel of the ring before it to reach it. A ring is reached from in row-major order, each pixel trying right, left, down and up, as the reference generator does, so a margin pixel between two limbs goes the same way.
widen_rowWidens a limb's span in one row to take in a column.

Var Details

band_built

Whether outline_band() has marked DIRT_PIXEL_BAND, which waits until it's asked for.

direction

The direction it's seen from.

eye_soft

alist(index = TRUE) on an eye's diagonals, which take film at most.

face_guard

Where nothing may be drawn: alist(index = DIRT_GUARD_EYE) on an eye and the pixels beside it, DIRT_GUARD_MOUTH on a human mouth. A few pixels, so it keeps only those.

flags_of

Each pixel's flags, one number, or null off the surface: its limb (DIRT_PIXEL_LIMB()), its zone (DIRT_PIXEL_ZONE(): the body zone whose image shows there, dirt_zone_owners()'s, or none off the body), and the marks DIRT_PIXEL_RIM, DIRT_PIXEL_OUTLINE and DIRT_PIXEL_BAND.

height_of

Each pixel's h, from -0.2 to 1.2: the margin runs past the limbs' ends.

limb_row_pixels

Its pixels by limb and row, from dirt_surface_rows(), or null until they're asked for.

limb_rows

alist(limb = alist(row = list(leftmost column, rightmost column))): each row a limb's sprites cover, hidden parts included.

outline_built

Whether outline() has marked DIRT_PIXEL_OUTLINE, which waits until it's asked for.

theta_of

Each pixel's theta, from -180 up to 180.

Proc Details

New

Builds one direction of a body's surface from the sprites it draws.

Arguments:

find_rim

Marks the rim (DIRT_PIXEL_RIM): the silhouette's edge, body pixels with a side off the body or off the canvas, and the margin's first ring. Each leg's lowest row is its sole and stays off it. The body's pixels off the rim are its interior.

Arguments:

guard_face

Guards the face: nothing on an eye or the pixels beside it, film at most on its diagonals, and nothing on a human mouth, whose pixels are the human head sprite's.

Arguments:

map_body

Returns each body pixel's limb: its zone's, except below the belt, where the torso's pixels go to the legs. Facing south or north they split down the middle; in profile they go to the near leg. Each body pixel's zone goes in its flags.

Arguments:

measure_rows

Finds the rows each limb covers and its span in each, from its zones' whole sprites, the torso's only above the belt. A leg also spans the torso pixels it took below the belt, in the rows its own sprite misses.

Arguments:

outline

Marks DIRT_PIXEL_OUTLINE on the body pixels a covering coat fades at: the silhouette's edge, and where the head, an arm or a hand meets another zone. The legs' meeting with the chest stays off it: a film line there read as a waistband. Marked once.

outline_band

Marks DIRT_PIXEL_BAND on the outline and the pixels beside it, where a covering coat breaks in profile: whole, it ran the torso's height as one band. Marked once.

pixel_index

Returns a pixel's index in the per-pixel lists, or null off the canvas.

Arguments:

place_pixels

Places each pixel of the body and its margin on its limb, from the limb's span in the nearest row it covers, the upper one on a tie. Theta is the angle whose sine is how far the pixel sits from the span's middle, as a fraction of its half width, turned to the direction; h runs from the limb's lowest row, 0, to its highest, 1.

Arguments:

spread_margin

Returns each pixel's limb with the margin added: DIRT_SURFACE_MARGIN rings round the body, each margin pixel taking the limb of the first pixel of the ring before it to reach it. A ring is reached from in row-major order, each pixel trying right, left, down and up, as the reference generator does, so a margin pixel between two limbs goes the same way.

Arguments:

widen_row

Widens a limb's span in one row to take in a column.

Arguments: