dirt_pixels 
One mask's pixels: a tone role and a thickness for each. Lists are indexed y * width + x + 1 in the reference generator's coordinates, as a /datum/dirt_surface's are: x from the left and y from the top, both from 0.
Vars | |
| covers | Whether it's a splat at the top level, which covers: where splats merge, it keeps every piece (dirt_merge()). |
|---|---|
| drawn_indexes | For a mask made again from a cached raster (dirt_pixels_from_drawn()), the pixels it was drawn on, so a merge walks those alone; null for one drawn here. Pixels cleared since stay listed. |
| height | Pixels down. |
| roles | Each pixel's DIRT_ROLE_* define, or null where nothing is drawn. |
| thicknesses | Each drawn pixel's thickness, from 0 to 1. Where masks merge, the thicker one wins a pixel its role ties on. |
| width | Pixels across. |
Procs | |
| New | Starts an empty mask. |
| copy | Returns a copy of the mask, its own lists. |
| drawn | Returns a mask's drawn pixels alone, which is all a cached raster keeps, packed as text: "1" if it covers, else "0", then three characters a drawn pixel, in row-major order, for its index, role and thickness (dirt_thickness_code()). Equal masks pack as equal text. SSdirt.rasters keeps a splat's four directions joined in one text, its key's own. Three base-64 characters hold indexes up to 2048, the 64x32 taur canvas: a bigger mask can't be packed. |
| grid_text | Returns the mask as text, one line per row joined by newlines, one glyph per pixel: "." none, "h" haze, "f" film, "b" body, "c" core, "k" fleck, "g" glint. |
| put_index | Draws a role on a pixel of the mask by its index. |
Var Details
covers 
Whether it's a splat at the top level, which covers: where splats merge, it keeps every piece (dirt_merge()).
drawn_indexes 
For a mask made again from a cached raster (dirt_pixels_from_drawn()), the pixels it was drawn on, so a merge walks those alone; null for one drawn here. Pixels cleared since stay listed.
height 
Pixels down.
roles 
Each pixel's DIRT_ROLE_* define, or null where nothing is drawn.
thicknesses 
Each drawn pixel's thickness, from 0 to 1. Where masks merge, the thicker one wins a pixel its role ties on.
width 
Pixels across.
Proc Details
New
Starts an empty mask.
Arguments:
- width: Pixels across.
- height: Pixels down.
copy
Returns a copy of the mask, its own lists.
drawn
Returns a mask's drawn pixels alone, which is all a cached raster keeps, packed as text: "1" if it covers, else "0", then three characters a drawn pixel, in row-major order, for its index, role and thickness (dirt_thickness_code()). Equal masks pack as equal text. SSdirt.rasters keeps a splat's four directions joined in one text, its key's own. Three base-64 characters hold indexes up to 2048, the 64x32 taur canvas: a bigger mask can't be packed.
grid_text
Returns the mask as text, one line per row joined by newlines, one glyph per pixel: "." none, "h" haze, "f" film, "b" body, "c" core, "k" fleck, "g" glint.
put_index
Draws a role on a pixel of the mask by its index.
Arguments:
- index: The pixel's index.
- role: A DIRT_ROLE_* define.
- thickness: How thick it lies, from 0 to 1.