Blob Blame Raw
#ifndef HELI_ANIMATION_H
#define HELI_ANIMATION_H


#include "common.h"

typedef struct _Animation *Animation;


int imageLoad(const char *path, int *outWidth, int *outHeight, unsigned char **outPixels);
unsigned int imageToGLTexture(int width, int height, const unsigned char *pixels, int horWrap, int vertWrap);


Animation createAnimation(const char *path);
Animation createAnimationEx(const char *path, int horWrap, int vertWrap);
Animation createAnimationEmpty();
void animationDestroy(Animation animation);

Animation animationClone(Animation animation);
Animation animationCloneEx(Animation animation, int start, int count);

unsigned int animationGetGLTexId(Animation animation);

int animationGetFramesCount(Animation animation);
void animationInsert(Animation animation, int index, Animation other);
void animationInsertEx(Animation animation, int index, Animation other, int start, int count);
void animationRemove(Animation animation, int start, int count);
void animationClear(Animation animation);

double animationGetFps(Animation animation);
void animationSetFps(Animation animation, double fps);

int animationIsPlaying(Animation animation);
void animationPlay(Animation animation);
void animationPause(Animation animation);

void animationAddTime(Animation animation, double time);

int animationGetLoop(Animation animation);
void animationSetLoop(Animation animation, int loop);

double animationGetPos(Animation animation);
void animationSetPos(Animation animation, double pos);
int animationGetFrame(Animation animation);
void animationSetFrame(Animation animation, int frame);
void animationNextFrame(Animation animation);


#endif