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

modular_aphelion/modules/character_preview/code/animation.dm

CHARACTER_PREVIEW_ANIMATION_MAX_PATCHESAnimation in the drawn character preview.
CHARACTER_PREVIEW_ANIMATION_MAX_PIXELSThe most pixels those patches hold in all.
CHARACTER_PREVIEW_ANIMATION_MAX_PERIODThe longest an animation's steps run before they start again, in ms. Animations whose loops don't come round together within it restart together at its end.
CHARACTER_PREVIEW_ANIMATION_MAX_FRAMESThe most frames an icon state may have to be animated. Reading a frame of one takes about a millisecond.
CHARACTER_PREVIEW_ANIMATION_MAX_AREAThe most pixels a frame of an icon state may have to be animated.
CHARACTER_PREVIEW_ANIMATION_MIN_DELAYThe shortest a frame is shown, in ms.
/proc/preview_animation_readingA reading of an animated icon state, or null for one that is drawn still without reading it.
/datum/preview_animation_readingReads which pixels of an animated icon state change, and between which frames, a frame at a time: each frame is compared with the one before it, in every direction at once. A pixel that changes between any two frames is one that changes between two that follow each other, so their differences together give the box that changes.
/proc/preview_animation_splitAn icon as two opaque icons that differ wherever it does: its colours, and its alpha in grey. Uses up source.
/proc/preview_animation_differenceWhite where two icons, each split by preview_animation_split(), differ, and black where they don't.
/proc/preview_state_animatedWhether an icon state has more than one frame, from its file's metadata, remembered by file and state.
/proc/preview_animated_leavesThe animated icon states a flat icon draws, and where: list(list(leaf, x, y), ...), with the leaf's lower left pixel at (x, y) of the flat's own canvas. In a walk's recipes only crops move what is already drawn; an animated leaf that anything else would move is left out, and drawn still.
/proc/character_preview_animationA look's animation, for a walk: its facings' patches, as one iconforge recipe, and the steps the page shows them in. flats is each facing's flat icon, stamped whether one flat walked facing UP serves them all (see uni_icon_facings_json()), and width and height the canvas they share.
/proc/preview_animation_mark_framesMarks animated leaves in a detached to_list() recipe, using their source identities to keep shared leaves on the same track. The source tree and its transformer lists remain untouched.
/proc/cmp_preview_region_costOrders regions by what all their patches would take, cheapest first.
/proc/preview_animation_tokensA recipe marked for patches, split where each fills in its own numbers: the pieces between, and in place of each number a code for it: 0 for the facing's dir, a leaf's number for its frame, and -1 to -4 for the crop's x1, y1, x2 and y2.
/proc/preview_animation_trackOne leaf's frames in a facing, as the steps of preview_animation_steps() read them: list("leaf" = its number, "frames" = each frame it shows in turn, "starts" = when each starts, in ms, "shows" = whether each looks different from the one before it, the first from the last, "cycle" = how long they take in all).
/proc/preview_animation_stepsA region's animation as steps, list(list(start, ms), ...): from the start, each time any of its leaves shows something new, when, and for how long, in ms. The leaves start together and come round together once all their loops have, or at CHARACTER_PREVIEW_ANIMATION_MAX_PERIOD. The first step is every leaf's first frame, the facing as drawn; see preview_animation_frames_at() for the others.
/proc/preview_animation_frames_atWhat frame each of a region's leaves shows time ms into its animation: leaf number -> frame.
/proc/preview_animation_fewer_stepsThe same steps, with only keep after the first: dropped evenly, each kept one shown for the time of those after it.

Define Details

CHARACTER_PREVIEW_ANIMATION_MAX_AREA

The most pixels a frame of an icon state may have to be animated.

CHARACTER_PREVIEW_ANIMATION_MAX_FRAMES

The most frames an icon state may have to be animated. Reading a frame of one takes about a millisecond.

CHARACTER_PREVIEW_ANIMATION_MAX_PATCHES

Animation in the drawn character preview.

iconforge draws a look's first frame only, so a drawing alone freezes what animates, like a halo's bob, an IPC screen's blink or a galaxy suit's twinkle. Most of an animated look never moves, though: only the pixels its animated icon states change from frame to frame. So beside each facing a drawing carries small patches, the look as it is at each later step of its animation cropped to the box that changes, and the page lays them over the facing in turn.

Which pixels an icon state changes, and between which of its frames, comes from reading the state once a round with BYOND's icon procs, in SScharacter_preview's spare time: about a millisecond a frame. A look with a state not read yet is drawn still, and drawn again once it has been.

Patches are capped, by count and by pixels, for each drawing: iconforge draws the whole look for each before cropping it. An animation with more steps than fit keeps fewer, evenly, each kept step shown for the time of those dropped after it, so it still runs its whole length, in coarser steps. The most patches a drawing carries over all its facings.

CHARACTER_PREVIEW_ANIMATION_MAX_PERIOD

The longest an animation's steps run before they start again, in ms. Animations whose loops don't come round together within it restart together at its end.

CHARACTER_PREVIEW_ANIMATION_MAX_PIXELS

The most pixels those patches hold in all.

CHARACTER_PREVIEW_ANIMATION_MIN_DELAY

The shortest a frame is shown, in ms.