Allow to specify frame width on animated sprites

This commit is contained in:
2014-07-02 01:01:32 +02:00
committed by Valeriano A.R
parent 0537dd81b1
commit e55fb5e638
2 changed files with 6 additions and 3 deletions

View File

@@ -25,7 +25,7 @@ typedef struct {
// Anim_LoadAnim
//
//
Anim Anim_LoadAnim(char *fichero,int frames,float fps){
Anim Anim_LoadAnim(char *fichero,int width,int frames,float fps){
DrawImg img;
Animation *anim;
int w,h;
@@ -39,7 +39,10 @@ Anim Anim_LoadAnim(char *fichero,int frames,float fps){
// Create the animation container
anim=malloc(sizeof(Animation));
anim->img=img;
anim->w=w/frames;
anim->w=width;
if(width<=0){
anim->w=w/frames;
}
anim->fps=fps;
anim->frames=frames;
anim->ftime=1000/fps;

View File

@@ -17,7 +17,7 @@ typedef void *Anim;
// Anim_LoadAnim
//
//
Anim Anim_LoadAnim(char *fichero,int frames,float fps);
Anim Anim_LoadAnim(char *fichero,int width,int frames,float fps);
/////////////////////////////