![]() |
Jo Engine
2024.04.28
Jo Sega Saturn Engine
|
Jo Engine Sprite Animator. More...
Go to the source code of this file.
Data Structures | |
| struct | jo_sprite_anim |
| Internal animation struct. More... | |
Enumerations | |
| enum | jo_sprite_anim_action { JO_SPRITE_ANIM_START, JO_SPRITE_ANIM_START_REVERSE, JO_SPRITE_ANIM_STOP, JO_SPRITE_ANIM_STOP_AT_LAST_FRAME } |
| Animation action. More... | |
Functions | |
| static __jo_force_inline unsigned char | jo_get_sprite_anim_frame_rate (const int anim_id) |
| Get animation frame rate. More... | |
| static __jo_force_inline unsigned short | jo_get_sprite_anim_frame_count (const int anim_id) |
| Get animation frame count. More... | |
| static __jo_force_inline unsigned short | jo_get_sprite_anim_frame (const int anim_id) |
| Get current animation frame. More... | |
| static __jo_force_inline void | jo_set_sprite_anim_frame (const int anim_id, const unsigned char frame) |
| Set animation frame. More... | |
| static __jo_force_inline void | jo_start_sprite_anim_loop (const int anim_id) |
| Start animation loop. More... | |
| static __jo_force_inline bool | jo_is_sprite_anim_stopped (const int anim_id) |
| Determine if the animation is stopped. More... | |
| static __jo_force_inline void | jo_stop_sprite_anim (const int anim_id) |
| Stop animation. More... | |
| static __jo_force_inline void | jo_start_sprite_anim (const int anim_id) |
| Start animation and stop it at the last frame. More... | |
| static __jo_force_inline void | jo_reset_sprite_anim (const int anim_id) |
| Stop animation and reset the animation to the first frame. More... | |
| static __jo_force_inline void | jo_restart_sprite_anim (const int anim_id) |
| Restart animation and stop it at the last frame. More... | |
| static __jo_force_inline int | jo_get_anim_sprite (const int anim_id) |
| Get the sprite to display according to the animation (current frame) More... | |
| static __jo_force_inline int | jo_get_anim_sprite_reverse (const int anim_id) |
| Get the sprite to display according to the animation in reverse (current frame) More... | |
| static __jo_force_inline int | jo_set_sprite_anim_frame_rate (const int anim_id, const unsigned char framerate) |
| Set animation framerate. More... | |
| int | jo_replace_sprite_anim (const int at, const unsigned short sprite_id, const unsigned short frame_count, const unsigned char frame_rate) |
| Replace an existing animation. More... | |
| int | jo_create_sprite_anim (const unsigned short sprite_id, const unsigned short frame_count, const unsigned char frame_rate) |
| Create an animation. More... | |
| void | jo_clear_all_sprite_anim (void) |
| Clear all sprite animation. More... | |
Variables | |
| jo_sprite_anim | __jo_sprite_anim_tab [JO_MAX_SPRITE_ANIM] |
| Internal animation table. More... | |
Jo Engine Sprite Animator.
| struct jo_sprite_anim |
Internal animation struct.
| Data Fields | ||
|---|---|---|
| jo_sprite_anim_action | action | |
| unsigned short | cur_frame | |
| unsigned short | frame0_sprite_id | |
| unsigned short | frame_count | |
| unsigned char | frame_rate | |
| unsigned char | frame_skip | |
| void jo_clear_all_sprite_anim | ( | void | ) |
Clear all sprite animation.
| int jo_create_sprite_anim | ( | const unsigned short | sprite_id, |
| const unsigned short | frame_count, | ||
| const unsigned char | frame_rate | ||
| ) |
Create an animation.
| sprite_id | First sprite id returned by jo_sprite_add() or similar functions |
| frame_count | Number of frame in the animation (number of continious sprite) |
| frame_rate | Framerate (linked to the global framerate) |
|
static |
Get the sprite to display according to the animation (current frame)
| anim_id | Id returned by jo_create_sprite_anim() |
|
static |
Get the sprite to display according to the animation in reverse (current frame)
| anim_id | Id returned by jo_create_sprite_anim() |
|
static |
Get current animation frame.
| anim_id | Id returned by jo_create_sprite_anim() |
|
static |
Get animation frame count.
| anim_id | Id returned by jo_create_sprite_anim() |
|
static |
Get animation frame rate.
| anim_id | Id returned by jo_create_sprite_anim() |
|
static |
Determine if the animation is stopped.
| anim_id | Id returned by jo_create_sprite_anim() |
| int jo_replace_sprite_anim | ( | const int | at, |
| const unsigned short | sprite_id, | ||
| const unsigned short | frame_count, | ||
| const unsigned char | frame_rate | ||
| ) |
Replace an existing animation.
| at | Id returned by jo_create_sprite_anim() |
| sprite_id | First sprite id returned by jo_sprite_add() or similar functions |
| frame_count | Number of frame in the animation (number of continious sprite) |
| frame_rate | Framerate (linked to the global framerate) |
|
static |
Stop animation and reset the animation to the first frame.
| anim_id | Id returned by jo_create_sprite_anim() |
|
static |
Restart animation and stop it at the last frame.
| anim_id | Id returned by jo_create_sprite_anim() |
|
static |
Set animation frame.
| anim_id | Id returned by jo_create_sprite_anim() |
| frame | Frame of animation to be displayed, where 0 is the first frame. |
|
static |
Set animation framerate.
| anim_id | Id returned by jo_create_sprite_anim() |
| framerate | Frame rate (linked to the global framerate) |
|
static |
Start animation and stop it at the last frame.
| anim_id | Id returned by jo_create_sprite_anim() |
|
static |
Start animation loop.
| anim_id | Id returned by jo_create_sprite_anim() |
|
static |
Stop animation.
| anim_id | Id returned by jo_create_sprite_anim() |
| jo_sprite_anim __jo_sprite_anim_tab[JO_MAX_SPRITE_ANIM] |
Internal animation table.
1.8.18