modular_aphelion/modules/bulge/code/templates.dm 
| BULGE_SHEET_CLOTH_SMALL | The bulge template sheets (icons/templates), the templates derived at run time, and the accessors that find either by identity. |
|---|---|
| BULGE_LOINCLOTH_TOP_HEM | A loincloth's cut never sits higher than this row: a drape that stays above it facing south takes the lifted hem. |
| BULGE_SKIN_TINT | One channel of a sprite pixel tinted with that skin tone (#fcccb3), as the previews tinted it, rounded to nearest: a whole number of 255ths, which never sits on a half. |
| BULGE_DRAPE_TOP | The row of a loincloth's flap facing south: its drape's top row there. |
| BULGE_DRAPE_REACH | A loincloth's drape follows the penis at most this many columns past its hinge facing east. |
| BULGE_DRAPE_ECLIPSE | From this sprite size a tentacle eclipses the drape: only a stub of it shows at the hinge. |
| BULGE_SHAPE_SLOT | Memo slot of an identity with a penis shape: 1-64. |
| BULGE_FORM_SLOT | Memo slot of an identity without one: 1-32. |
| BULGE_DRAPE_SLOT | Memo slot of a drape: 1-112. |
| BULGE_GLOBAL_ALIST | A null alist global, created on first use. |
| /datum/bulge_sheet_state | One state of a template sheet and where it sits: its sheet, its name and the pixel offsets of the sheet's window. A state derived at run time (a shape past small_cap, which is also the anatomy it leaves bare, or a loincloth's cut) has no sheet and sits on the whole tile: only its name, and its pixels are never read from a file. |
| /proc/bulge_sheet_state | The one /datum/bulge_sheet_state for a sheet's state, or null when the sheet has no such state; with no sheet
(icon_file null), the one for the derived state of that name. |
| /proc/bulge_mask_shows | Whether a mask shows anything. A skirt's anatomy clearance can be empty (the shaft shows behind the skirt and none of it above), and anatomy masked by an empty one would be a fully transparent icon, derived and sent for nothing. Read once per state, from its frames facing south, east and west (north is empty in every template sheet); a derived mask has no sheet, and always shows something (bulge_exposed()). |
| /proc/bulge_memo_slots | The slots list memo[first][second], created on first use with slots empty slots. |
| /proc/bulge_memo_list | The slots list memo[first], created on first use with slots empty slots. |
| /proc/bulge_decode_template | Decodes a sheet state into a print template, once per sheet and state: each pixel facing south, east and west with
its kind, read from its fixed grey (a kind map), or as cloth (a mask, when mask). North is never read: it is empty
in every template sheet. A state saved with one direction is read facing south every way, as getFlatIcon() treats
one. The template's key names its sheet and state, so no two sheets can share a cached template. |
| /proc/bulge_shape_owner | The family whose shape, anatomy clearance or flap a family draws at a size up to its small_cap: itself, or the
family it names by design for that form (half_shapes_of, hard_shapes_of), except at the hard sizes in own_sizes,
the family's own of that kind (own_shape_sizes, own_clearance_sizes or own_flap_sizes). |
| /proc/bulge_family_size | The size a family draws a bulge of size at: its own up to its cap for the form, the cap past it; 0 for none. |
| /proc/bulge_shape_size | The size whose shape a family draws for a bulge of size on a penis shape: bulge_family_size(), except that past the
family's small_cap, where shapes follow the penis shape, a shape with none of its own (bulge_hyper FALSE, the
tentacles) draws the family's small_cap shape, as any other shape draws at that size, and so does a shape past its
print_cap (Nondescript (Alt), Tapered (Alt) and Hemi (Alt)); 0 for none. |
| /proc/bulge_shape_where | Where a family's shape for an identity is (see bulge_shape()), or null when the family has none there. Where the family has a precoloured printed patch (bulge_printed_patch()), the patch is drawn instead: no shape (the look shows the anatomy the shape of large_shapes_of leaves bare, under the patch: bulge_resolve()). The sheet is chosen by the garment's own family (a skirt reads skirt_shapes.dmi whichever family owns the shape), and a family named by half_shapes_of, hard_shapes_of or large_shapes_of is followed one level only: it must own its shapes. Past small_cap the shape has no sheet: the derived state named as bulge_large_name() names it. |
| /proc/bulge_large_size | The size whose shape a bulge past small_cap draws: past size 6, a penis whose sprite has stopped growing (its size affix cap, with skin tones when toned) keeps size 6's shape. |
| /proc/bulge_large_name | The name of a shape past small_cap: "[shapes][form][size][legs][penis shape]", "_untoned" for a shape whose untoned sprites have shapes of their own, drawn without skin tones; the size as bulge_large_size(). Legs are digitigrade only where the family has digitigrade versions of that form. |
| /proc/bulge_sprite_pixels | One direction of a sprite the shapes past small_cap are derived from, frame 1, read once and kept for the round (as
many as the sprites have states and directions): its opaque pixels row by row from the top, as flat (index,
luminance) pairs. The index is row * 32 + column + 1, rows and columns from 0 at the top left; the luminance is that
of the pixel tinted with the skin tone, in thousandths, plus one. A penis or testicle sprite is read inside the window
those draw in (BULGE_SPRITE_*), a loincloth's (whole) all of it. Null where it has no opaque pixel, or no such state. |
| /proc/bulge_penis_state | The state of a penis shape's sprite a shape past small_cap is derived from, as the approved previews chose it: drawn
in front, hard or half hard, skin-toned where the sprite has that and the shape is drawn toned, at sprite_size or
the largest smaller size the sprite has. Null where it has none. |
| /proc/bulge_derive_large | Derives a shape past small_cap from the penis and testicle sprites by the approved rule, in whole numbers: the cloth
the bulge pushes out, as a kind map, or with mask the anatomy it leaves bare, as a white mask (null where it covers
the whole penis). Pixels facing south, east and west, in the order bulge_decode_template() reads a sheet, as the
sheet states it replaced held them; facing east and west, every penis shape but the human one takes amendments to
that rule (see below), and its mask is what the amended cloth leaves bare. The kind map is kept for the round, by its
name, with the decoded templates; the mask is not (bulge_exposed() keeps the tile drawn from it). Arguments as
bulge_large_name(): owner is the family whose shapes past small_cap these are. |
| /proc/bulge_shape | The shape a garment of family bulges with, as a kind map (a /datum/bulge_print_template), or null where the family
has none. Decoded the first time, or past small_cap derived (bulge_derive_large()); then a few list reads. |
| /proc/bulge_exposed | The anatomy a bulge past the family's small_cap leaves bare, as a white mask (a /datum/bulge_sheet_state): the derived state of the bulge_shape() of the same identity, its tile drawn from the pixels bulge_derive_large() derives for it. Null where nothing shows, the shape covering the whole penis. Arguments as bulge_shape(). |
| /proc/bulge_clearance | Where a skirt's shaft shows through the cloth: the anatomy clearance mask (a /datum/bulge_sheet_state) for an identity, or null when the family has none there. Named as the skirt's shape without its legs, in skirt_clearance.dmi: a clearance is the same on plain and digitigrade legs. With a clearance the anatomy is drawn behind the skirt and, inside the mask, above its cloth; an empty mask shows none of it above. |
| /proc/bulge_flap | The flap a revealing skirt cuts away from its cover when hard, as a decoded mask (a /datum/bulge_print_template, every pixel cloth) for bulge_cut_cover_flap(), or null when the family cuts none. Named as the skirt's hard shape, in skirt_flaps.dmi. |
| /proc/bulge_drape_name | The name of a loincloth's drape: "[drapes][penis shape][sprite size]", "_untoned" as bulge_large_name(), and "_flat" from the family's flat_tip_from on a shape that grows past size 4. |
| /proc/bulge_derive_drape | Derives a loincloth's drape, as bulge_drape_name() names it, by the approved rule: facing east the flap's top edge follows the penis from its hinge, up to BULGE_DRAPE_REACH columns, then the rest of the flap hangs past the tip or, from a penis reaching further, drops over its side; facing west the same, mirrored; facing south the flap's top and hem rows where the loincloth's own sprite has cloth. Kept for the round, by its name, with the decoded templates; pixels in the order bulge_decode_template() reads a sheet. Arguments as bulge_drape_name(). |
| /proc/bulge_drape | The drape a hard loincloth hangs over the penis, as a kind map derived the first time (bulge_derive_drape()), or null where it has none. |
| /proc/bulge_loincloth_cut | The cut a hard loincloth takes under its drape (a derived /datum/bulge_sheet_state named "[drapes]cut[hem]", whose keep mask says what of the garment stays inside the cut window), or null. The cut follows the drape: at the lowest row its drape reaches facing south, or, for a drape that stays above the hem rows there (a tentacle's stub), the family's lifted_hem. Its keep mask (bulge_patch_keep()) is cut from the loincloth's own sprite as the approved previews cut it: facing south the flap's columns below the hem go, facing east and west the flap's two columns from its hinge row down, facing north nothing. Arguments as bulge_drape(). |
| /proc/bulge_printed_patch | A printed garment's precoloured patch past its family's small_cap (a /datum/bulge_sheet_state, drawn as it is), or null when its prints there are derived or it has none: the patch drawn for the penis shape's profile where the sheet has one (the human penis's name with the shape's icon state appended, and "_untoned" after it first for a shape drawn without skin tones whose untoned sprites draw differently), else the human penis's. None for a penis shape that draws the family's small_cap shape there (bulge_shape_size(): the tentacles, a shape past its print_cap), which keeps that shape's print. Arguments as bulge_shape(); with no penis shape, the human penis's. |
Define Details
BULGE_DRAPE_ECLIPSE 
From this sprite size a tentacle eclipses the drape: only a stub of it shows at the hinge.
BULGE_DRAPE_REACH 
A loincloth's drape follows the penis at most this many columns past its hinge facing east.
BULGE_DRAPE_SLOT 
Memo slot of a drape: 1-112.
BULGE_DRAPE_TOP 
The row of a loincloth's flap facing south: its drape's top row there.
BULGE_FORM_SLOT 
Memo slot of an identity without one: 1-32.
BULGE_GLOBAL_ALIST 
A null alist global, created on first use.
BULGE_LOINCLOTH_TOP_HEM 
A loincloth's cut never sits higher than this row: a drape that stays above it facing south takes the lifted hem.
BULGE_SHAPE_SLOT 
Memo slot of an identity with a penis shape: 1-64.
BULGE_SHEET_CLOTH_SMALL 
The bulge template sheets (icons/templates), the templates derived at run time, and the accessors that find either by identity.
Every template is named for what it is, and the accessor computes the name from the identity: the garment's family (families.dm), half or hard, the bulge size, plain or digitigrade legs, and past the family's small_cap the penis shape (and whether it is drawn with skin tones). Where two families share shapes by design the family data says so; nothing else maps one name to another.
The sheets hold the shapes up to small_cap, the skirts' anatomy clearance and flaps, and the large heart boxers' precoloured patches (made by the print rule). A kind map holds the whole shading of one bulge in one state: each kind of pushed-out cloth in its fixed grey, the approved shading laid over mid-grey cloth, so a sheet opened in Dream Maker shows the bulges as drawn on grey cloth. Masks (anatomy clearance, skirt flaps) are white. Each sheet is cropped to one window, placed on the 32x32 tile by the pixel offsets defined below.
Past small_cap the shapes, the anatomy they leave bare, the loincloths' drapes and their cuts have no sheet: they are derived, by the approved rule, from the game's own penis, testicle and loincloth sprites (bulge_derive_large(), bulge_derive_drape(), bulge_loincloth_cut()), under the names their sheet states had, and bulge_derivation holds them to a frozen record of those states. The sprites are read once each, on first use; nothing is derived at init.
A template is decoded or derived once and kept for the round; an identity asked for again is a few list reads. Nothing here is on a per-pass path, and a renderer only asks when a wearer's look changes.
BULGE_SKIN_TINT 
One channel of a sprite pixel tinted with that skin tone (#fcccb3), as the previews tinted it, rounded to nearest: a whole number of 255ths, which never sits on a half.