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

character_preview

Vars

drawingsPreviews to draw for changes, each started in the next fire, once whatever made its changes has finished.
overrun_budgetHow many ms rebuilds that run a tick over may still take now. Below zero, they went over, and it is paid back first.
overrun_budget_atWhen overrun_budget was last topped up.
queuePreviews whose mob waits to be rebuilt, oldest first.
reading_waitersPreviews drawn still while states they show waited to be read. Each draws again once none waits.
readingsIcon states waiting to be read for animating, by "file|state", oldest first.
rebuild_costHow many ms a rebuild takes, on average.
rebuild_overdueRuns out once the queue has gone CHARACTER_PREVIEW_REBUILD_OVERDUE without a rebuild.

Procs

animation_ofWhat animating an icon state takes, if it has been read. If not, it waits to be read and this returns null. FALSE for one that is drawn still: one that doesn't animate, or changes no pixel, or is too big to read, or animates only a set number of times.
draw_soonA drawing a change asked for. It starts in the next fire, after whatever made the change has finished, so it draws the look that action left rather than one it passed through. While nothing would start it, during init or while this can't fire, it starts at once instead.
fireRebuilds waiting previews' mobs in order while the tick has room, then starts the drawings asked for since the last fire, then reads animated icon states drawings show, in whatever time is left; see animation.dm. Waiting mobs go first: they were asked for earlier, and however many drawings wait to start, the queue never goes longer than CHARACTER_PREVIEW_REBUILD_OVERDUE without a rebuild while this fires, which is what ends every wait for a turn. The first rebuild may take what is left of the tick, and later ones only this subsystem's share of it.
has_roomWhether a rebuild would end within this tick's limit.
read_animationsReads what waits to be read, a frame at a time, while the tick has room. Once nothing waits, every preview drawn still meanwhile draws again.
rebuildA preview's turn: rebuilds its mob, if it is still stale, and returns how many ms that took.
rebuild_or_waitA stale preview mob, for a drawing, which asks once this has started it. Rebuilds it at once if nothing waits ahead of it and it fits in what is left of the tick, or the overrun budget allows, and as well if nothing would take the turn: during init, or while this can't fire. Returns TRUE if it did; otherwise the preview waits its turn in the queue.
stat_entryShows how many previews wait, what a rebuild costs, and what is left of the overrun budget.

Var Details

drawings

Previews to draw for changes, each started in the next fire, once whatever made its changes has finished.

overrun_budget

How many ms rebuilds that run a tick over may still take now. Below zero, they went over, and it is paid back first.

overrun_budget_at

When overrun_budget was last topped up.

queue

Previews whose mob waits to be rebuilt, oldest first.

reading_waiters

Previews drawn still while states they show waited to be read. Each draws again once none waits.

readings

Icon states waiting to be read for animating, by "file|state", oldest first.

rebuild_cost

How many ms a rebuild takes, on average.

rebuild_overdue

Runs out once the queue has gone CHARACTER_PREVIEW_REBUILD_OVERDUE without a rebuild.

Proc Details

animation_of

What animating an icon state takes, if it has been read. If not, it waits to be read and this returns null. FALSE for one that is drawn still: one that doesn't animate, or changes no pixel, or is too big to read, or animates only a set number of times.

draw_soon

A drawing a change asked for. It starts in the next fire, after whatever made the change has finished, so it draws the look that action left rather than one it passed through. While nothing would start it, during init or while this can't fire, it starts at once instead.

fire

Rebuilds waiting previews' mobs in order while the tick has room, then starts the drawings asked for since the last fire, then reads animated icon states drawings show, in whatever time is left; see animation.dm. Waiting mobs go first: they were asked for earlier, and however many drawings wait to start, the queue never goes longer than CHARACTER_PREVIEW_REBUILD_OVERDUE without a rebuild while this fires, which is what ends every wait for a turn. The first rebuild may take what is left of the tick, and later ones only this subsystem's share of it.

Each loop goes round at most once for each entry its list had when the fire began, whatever the work adds to it meanwhile, so neither can go round forever; what is added waits for a later fire.

has_room

Whether a rebuild would end within this tick's limit.

read_animations

Reads what waits to be read, a frame at a time, while the tick has room. Once nothing waits, every preview drawn still meanwhile draws again.

rebuild

A preview's turn: rebuilds its mob, if it is still stale, and returns how many ms that took.

rebuild_or_wait

A stale preview mob, for a drawing, which asks once this has started it. Rebuilds it at once if nothing waits ahead of it and it fits in what is left of the tick, or the overrun budget allows, and as well if nothing would take the turn: during init, or while this can't fire. Returns TRUE if it did; otherwise the preview waits its turn in the queue.

stat_entry

Shows how many previews wait, what a rebuild costs, and what is left of the overrun budget.