/tg/ Station 13 - Modules - Types — Define Details

modular_aphelion/modules/character_preview/code/drawing.dm

CHARACTER_PREVIEW_DIRWhere iconforge writes a preview drawing. It is read back and deleted at once, and tmp/ is cleared every round.
CHARACTER_PREVIEW_SETTLEAfter an answer, how long requests wait to be folded into one, and how quiet a burst of them must go first.
CHARACTER_PREVIEW_MAX_WAITThe longest a request waits while more keep coming.
CHARACTER_PREVIEW_CLEANUP_EVERYHow many looks' worth of images iconforge draws before it is told to let go of what it keeps from drawing them.
CHARACTER_PREVIEW_JOB_TIMEOUTA drawing under way longer than this is given up on, by the proc waiting on it and everything else. They take milliseconds.
/datum/preference_middleware/character_previewThe character preview every tab of character setup shows: the preview mob, facing each way, drawn into one image and sent in the window's data. Height and body size, which a flatten leaves out, go with it for the page to draw, as the game draws them.
/proc/iconforge_drawnA drawing is done: a character preview's, or share of one for a smaller picture, like the custom sprite editors'. iconforge keeps every image it makes until it is told to let them go, and a look is hardly ever drawn twice, so what it keeps only grows, by 80 to 330 KB a look. Every CHARACTER_PREVIEW_CLEANUP_EVERY looks' worth it lets go, once no character preview is under way: one under way would come out empty. Until then new previews wait, for a tick or two, and the last preview under way lets go when it is done. Spritesheets being made let go themselves once they are done, so it waits for them to finish.
/proc/character_preview_drawing_under_wayWhether iconforge is drawing a character preview now, which letting go of what it keeps would spoil. tg's asset loader asks too, as it lets go on every fire once its queue has emptied. A drawing whose proc was killed stops counting after CHARACTER_PREVIEW_JOB_TIMEOUT.
/proc/character_preview_walkA look's facings as iconforge recipes, on one canvas that grows to fit parts that reach past the mob's tile, like big ears and wings: list("recipes" = facing -> recipe, "height" = canvas rows, "x" and "y" = how far the canvas reaches left of and below the tile).
/proc/character_preview_flat_boxA flat icon's canvas, list(x1, y1, width, height): where its lower left pixel sits, counted from the flattened look's own (1, 1), and its size. A grown canvas says so itself; any other is its icon's, at (1, 1).
/proc/character_preview_turns_itselfWhether something redraws a mob when it turns, so each facing of it has to be walked on its own.

Define Details

CHARACTER_PREVIEW_CLEANUP_EVERY

How many looks' worth of images iconforge draws before it is told to let go of what it keeps from drawing them.

CHARACTER_PREVIEW_DIR

Where iconforge writes a preview drawing. It is read back and deleted at once, and tmp/ is cleared every round.

CHARACTER_PREVIEW_JOB_TIMEOUT

A drawing under way longer than this is given up on, by the proc waiting on it and everything else. They take milliseconds.

CHARACTER_PREVIEW_MAX_WAIT

The longest a request waits while more keep coming.

CHARACTER_PREVIEW_SETTLE

After an answer, how long requests wait to be folded into one, and how quiet a burst of them must go first.