![]() |
SANDAL2
A SDL2 Wrapper in C
|
Sprite manager for SANDAL2. More...
#include <stdlib.h>
Go to the source code of this file.
Classes | |
struct | Sprite |
informations about a step of an animation More... | |
struct | ListSprite |
all steps of an animation More... | |
struct | ListAnimation |
a list of animations More... | |
Typedefs | |
typedef struct Sprite | Sprite |
typedef struct ListSprite | ListSprite |
Functions | |
ListSprite * | initListSprite (int code) |
create an empty list of sprite More... | |
void | freeListSprite (ListSprite *l) |
free the memory of a list of sprite More... | |
int | addSprite (ListSprite *l, int x, int y, int width, int height, unsigned lifespan, int code) |
add a Sprite to the list More... | |
int | delSprite (ListSprite *l, int code) |
remove a Sprite to the list More... | |
int | setLifeSpanSprite (ListSprite *l, int code, unsigned lifespan) |
set the lifespan of a sprite More... | |
int | setSprite (ListSprite *l, int code) |
change the current sprite in a given list of sprite More... | |
ListAnimation * | initListAnimation () |
create an empty list of animation More... | |
void | freeListAnimation (ListAnimation *l) |
free the memory of a list of animation More... | |
int | createAnimation (ListAnimation *l, int code) |
add an empty animation to the list More... | |
int | delAnimation (ListAnimation *l, int code) |
remove an empty animation from the list More... | |
int | addSpriteAnimation (ListAnimation *l, int code, int x, int y, int width, int height, unsigned lifespan, int codeS) |
add a Sprite to an animation More... | |
int | delSpriteAnimation (ListAnimation *l, int code, int codeS) |
remove a Sprite to an animation More... | |
int | setLifeSpanSpriteAnimation (ListAnimation *l, int code, int codeS, unsigned lifespan) |
set the lifespan of a sprite More... | |
int | setAnimation (ListAnimation *l, int code) |
set the current animation of a list of animations More... | |
int | setSpriteAnimation (ListAnimation *l, int codeS) |
change the current sprite in the current list of sprite in a given list of animation More... | |
Sprite manager for SANDAL2.
int addSprite | ( | ListSprite * | l, |
int | x, | ||
int | y, | ||
int | width, | ||
int | height, | ||
unsigned | lifespan, | ||
int | code | ||
) |
add a Sprite to the list
l | : list of sprite |
x | : abscissa coordinate of the top left corner of the sprite in its image |
y | : ordinate coordinate of the top left corner of the sprite in its image |
width | : width of the sprite in its image |
height | : height of the sprite in its image |
lifespan | : number of time the sprite should be displaied before going to the next sprite |
code | : identifier of the Sprite to add |
int addSpriteAnimation | ( | ListAnimation * | l, |
int | code, | ||
int | x, | ||
int | y, | ||
int | width, | ||
int | height, | ||
unsigned | lifespan, | ||
int | codeS | ||
) |
add a Sprite to an animation
l | : list of animations |
code | : code of the animation to add the sprite |
x | : abscissa coordinate of the top left corner of the sprite in its image |
y | : ordinate coordinate of the top left corner of the sprite in its image |
width | : width of the sprite in its image |
height | : height of the sprite in its image |
lifespan | : number of time the sprite should be displaied before going to the next sprite |
codeS | : code of the Sprite to be added |
int createAnimation | ( | ListAnimation * | l, |
int | code | ||
) |
add an empty animation to the list
l | : list of animation |
code | : code of the new animation |
int delAnimation | ( | ListAnimation * | l, |
int | code | ||
) |
remove an empty animation from the list
l | : list of animation |
code | : code of the animation to be removed |
int delSprite | ( | ListSprite * | l, |
int | code | ||
) |
remove a Sprite to the list
l | : list of sprite |
code | : code of the sprite to be removed |
int delSpriteAnimation | ( | ListAnimation * | l, |
int | code, | ||
int | codeS | ||
) |
remove a Sprite to an animation
l | : list of animations |
code | : code of the animation to remove the sprite |
codeS | : code of the sprite to be removed |
void freeListAnimation | ( | ListAnimation * | l | ) |
free the memory of a list of animation
l | : list to be freed |
void freeListSprite | ( | ListSprite * | l | ) |
free the memory of a list of sprite
l | : list to be freed |
ListAnimation* initListAnimation | ( | ) |
create an empty list of animation
ListSprite* initListSprite | ( | int | code | ) |
create an empty list of sprite
int setAnimation | ( | ListAnimation * | l, |
int | code | ||
) |
set the current animation of a list of animations
l | : list of animations |
code | : code of the animation to be set as current |
int setLifeSpanSprite | ( | ListSprite * | l, |
int | code, | ||
unsigned | lifespan | ||
) |
set the lifespan of a sprite
l | : list of sprite |
code | : code of the sprite to be changed |
lifespan | : new number of time the sprite should be displaied before going to the next sprite |
int setLifeSpanSpriteAnimation | ( | ListAnimation * | l, |
int | code, | ||
int | codeS, | ||
unsigned | lifespan | ||
) |
set the lifespan of a sprite
l | : list of animations |
code | : code of the animation to set the sprite |
codeS | : code of the sprite to be modified |
lifespan | : new number of time the sprite should be displaied before going to the next sprite |
int setSprite | ( | ListSprite * | l, |
int | code | ||
) |
change the current sprite in a given list of sprite
l | : list of sprite |
code | : code of the sprite to be set |
int setSpriteAnimation | ( | ListAnimation * | l, |
int | codeS | ||
) |
change the current sprite in the current list of sprite in a given list of animation
l | : list of animation |
codeS | : code of the sprite to be set |