libmsx
C library for MSX
Loading...
Searching...
No Matches

Updates animation state of Animated Color Sprites. More...

+ Collaboration diagram for SM2 updates animation state.:

Functions

void sm2_init_sprite (sm2_Sprite *s, const sm2_SpriteSheet *sheet, const sm2_FrameTag *tag)
 MSX2 Construction and (re)initialization of the animated color sprite.
 
void sm2_update_sprite (sm2_Sprite *s)
 MSX2 Update the animation state of sprite object.
 
void sm2_update_sprites (sm2_Sprite ss[], size_t num)
 MSX2 Update the animation state of a series of sprite objects.
 

Detailed Description

Updates animation state of Animated Color Sprites.

Function Documentation

◆ sm2_init_sprite()

void sm2_init_sprite ( sm2_Sprite * s,
const sm2_SpriteSheet * sheet,
const sm2_FrameTag * tag )

MSX2 Construction and (re)initialization of the animated color sprite.

Parameters
sSprite object to be (re-)initialized.
sheetSprite-sheet object.
tagFrame-tag object that defines the range of animation frames.
Note
This function can be used not only for initialization but also for switching the animation pattern (sprite sheet and/or tag) of a sprite object.

◆ sm2_update_sprite()

void sm2_update_sprite ( sm2_Sprite * s)

MSX2 Update the animation state of sprite object.

Parameters
sSprite object.
Note
In order to update the animation state of the sprite object, sm2_update_sprite() and sm2_update_sprites() should be called periodically (as much as possible at each VSYNC timing).
Both sm2_update_sprite() and sm2_update_sprites() can be called from the VSYNC interrupt handler.

◆ sm2_update_sprites()

void sm2_update_sprites ( sm2_Sprite ss[],
size_t num )
inline

MSX2 Update the animation state of a series of sprite objects.

Parameters
ssAn array of sprite objects.
numNumber of elements of the array.
Note
In order to update the animation state of the sprite object, sm2_update_sprite() and sm2_update_sprites() should be called periodically (as much as possible at each VSYNC timing).
Both sm2_update_sprite() and sm2_update_sprites() can be called from the VSYNC interrupt handler.

Definition at line 190 of file sm2.h.