35#ifndef __JO_SPRITE_ANIMATOR_H__
36# define __JO_SPRITE_ANIMATOR_H__
183int jo_replace_sprite_anim(
const int at,
const unsigned short sprite_id,
const unsigned short frame_count,
const unsigned char frame_rate);
191int jo_create_sprite_anim(
const unsigned short sprite_id,
const unsigned short frame_count,
const unsigned char frame_rate);
#define JO_ZERO(X)
Set a variable to zero.
Definition math.h:240
static __jo_force_inline void jo_reset_sprite_anim(const int anim_id)
Stop animation and reset the animation to the first frame.
Definition sprite_animator.h:135
static __jo_force_inline int jo_set_sprite_anim_frame_rate(const int anim_id, const unsigned char framerate)
Set animation framerate.
Definition sprite_animator.h:171
unsigned short frame_count
Definition sprite_animator.h:51
static __jo_force_inline void jo_start_sprite_anim(const int anim_id)
Start animation and stop it at the last frame.
Definition sprite_animator.h:127
static __jo_force_inline unsigned short jo_get_sprite_anim_frame(const int anim_id)
Get current animation frame.
Definition sprite_animator.h:85
unsigned char frame_rate
Definition sprite_animator.h:53
static __jo_force_inline void jo_set_sprite_anim_frame(const int anim_id, const unsigned char frame)
Set animation frame.
Definition sprite_animator.h:94
unsigned short frame0_sprite_id
Definition sprite_animator.h:50
void jo_remove_sprite_anim(const int anim_id)
Remove a specific animation by ID.
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.
jo_sprite_anim_action
Animation action.
Definition sprite_animator.h:40
@ JO_SPRITE_ANIM_STOP
Definition sprite_animator.h:43
@ JO_SPRITE_ANIM_STOP_AT_LAST_FRAME
Definition sprite_animator.h:44
@ JO_SPRITE_ANIM_START
Definition sprite_animator.h:41
@ JO_SPRITE_ANIM_START_REVERSE
Definition sprite_animator.h:42
static __jo_force_inline bool jo_is_sprite_anim_stopped(const int anim_id)
Determine if the animation is stopped.
Definition sprite_animator.h:111
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).
Definition sprite_animator.h:162
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.
jo_sprite_anim __jo_sprite_anim_tab[JO_MAX_SPRITE_ANIM]
Internal animation table.
unsigned short cur_frame
Definition sprite_animator.h:52
static __jo_force_inline unsigned char jo_get_sprite_anim_frame_rate(const int anim_id)
Get animation frame rate.
Definition sprite_animator.h:67
static __jo_force_inline void jo_start_sprite_anim_loop(const int anim_id)
Start animation loop.
Definition sprite_animator.h:102
static __jo_force_inline unsigned short jo_get_sprite_anim_frame_count(const int anim_id)
Get animation frame count.
Definition sprite_animator.h:76
static __jo_force_inline int jo_get_anim_sprite(const int anim_id)
Get the sprite to display according to the animation (current frame).
Definition sprite_animator.h:154
static __jo_force_inline void jo_restart_sprite_anim(const int anim_id)
Restart animation and stop it at the last frame.
Definition sprite_animator.h:145
unsigned char frame_skip
Definition sprite_animator.h:54
jo_sprite_anim_action action
Definition sprite_animator.h:55
static __jo_force_inline void jo_stop_sprite_anim(const int anim_id)
Stop animation.
Definition sprite_animator.h:119
Internal animation struct.
Definition sprite_animator.h:49
#define __jo_force_inline
force inline attribute (and prevent Doxygen prototype parsing bug)
Definition types.h:39