Skip to Content
The Alchemy Project

struct SPR_ANIMATION

One of a sprite's four sprite animations: its animation id, pictures, running script and timer.

Declared in sprite.h.

Fields

NameDescription
Sint16animationIdThe sprite id whose metadata and pictures it uses.
Uint16timerTime left on the current picture in sixteenths of a tick, read signed: each timed command adds its argument times 16, each tick takes off step.
Uint8kindThe facing table its pictures follow (from the metadata, or ANIMCMD_SET_KIND); zero marks a free sprite animation.
Uint8colorModeSPR_COL_MODE its pixels are drawn with; 0 when taken.
Uint8priorityDrawing order 0 to 3 among the animations; above 3 not drawn.
Uint8modeAn SPR_PICTURE_CODEC; anything else is raw.
void **picturesPicture pointers, from the metadata or a picture cache.
Uint8 **scriptsThe metadata's command scripts, one per animation number.
Uint8 *scriptThe running script; null when stopped (ANIMCMD_END).
Uint8scriptOffsetByte offset of the next command in script.
Uint8stepTaken off timer each tick; ANIM_STEP_NORMAL is normal speed.
Uint8picturePicture shown, pictureBase plus the facing offset; SPRITE_PICTURE_NONE for none.
Uint8pictureBasePicture the script chose, before facing; SPRITE_PICTURE_NONE for none.

Description

One of a sprite's four sprite animations: its animation id, pictures, running script and timer.

struct SPR_ANIMATION

Referenced by btEffectTintBattler(), btMotionPlayFall(), btMotionPlayHitFlash(), btMotionShowDowned(), btObjectSetColorMode(), btObjectSpawnObjectsForList(), btObjectUpdateSpritePriorities(), btPlaybackRun(), btStatusIconCycle(), fdActorResetForLeader(), fdActorSetLayersColorMode(), fdActorSetRevealSpriteColor(), fdActorSetSpriteColor(), fdActorSystemConfigure(), fdActorUpdateBlink(), fdEffectBlinkAvoidCaster(), fdEntrancePlayArrivalAnimation(), fdExitPrepareAnimation(), fdPsynergyAvoid(), fdPsynergyEndCloak(), fdPsynergyHaltActor(), fdPsynergyStartCloak(), fdSpriteAddAnimation(), fdSpriteAnimationAllocate(), fdSpriteAnimationClear(), fdSpriteAnimationReset(), fdSpriteAnimationStart(), fdSpriteComposePicture(), fdSpriteRemoveAnimation(), fdSpriteRemoveAnimationAt(), fdSpriteResetAnimations(), fdSpriteSetAnimationColorModes(), fdSpriteSetAnimationSpeed(), fdSpriteSetAnimationTimers(), fdSpriteStartAnimation(), fdSpriteViewerSetLayerSprite(), fdSpriteViewerStartStaggeredAnimations(), scMercuryLighthouseFollowLeader(), scSanctumShowHealerAfterimage(), scSuhallaDesertSetUpSecondMapStorms(), scTolbiSpringSetActorAppearance() and scValePrologueSetActorColorMode().

Definition at line 48 of file sprite.h.

Fields in detail

animationId

Sint16 animationId

The sprite id whose metadata and pictures it uses.

timer

Uint16 timer

Time left on the current picture in sixteenths of a tick, read signed: each timed command adds its argument times 16, each tick takes off step.

kind

Uint8 kind

The facing table its pictures follow (from the metadata, or ANIMCMD_SET_KIND); zero marks a free sprite animation.

colorMode

Uint8 colorMode

SPR_COL_MODE its pixels are drawn with; 0 when taken.

priority

Uint8 priority

Drawing order 0 to 3 among the animations; above 3 not drawn.

mode

Uint8 mode

An SPR_PICTURE_CODEC; anything else is raw.

pictures

void **pictures

Picture pointers, from the metadata or a picture cache.

scripts

Uint8 **scripts

The metadata's command scripts, one per animation number.

script

Uint8 *script

The running script; null when stopped (ANIMCMD_END).

scriptOffset

Uint8 scriptOffset

Byte offset of the next command in script.

step

Uint8 step

Taken off timer each tick; ANIM_STEP_NORMAL is normal speed.

picture

Uint8 picture

Picture shown, pictureBase plus the facing offset; SPRITE_PICTURE_NONE for none.

pictureBase

Uint8 pictureBase

Picture the script chose, before facing; SPRITE_PICTURE_NONE for none.