2024-08-01 16:47:53 +02:00
|
|
|
#ifndef ANIMATION_H
|
|
|
|
#define ANIMATION_H
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
typedef struct {
|
2024-08-01 17:37:20 +02:00
|
|
|
unsigned char frame : 8;
|
2024-08-01 16:47:53 +02:00
|
|
|
bopti_image_t *image;
|
2024-08-01 17:37:20 +02:00
|
|
|
unsigned char len : 8;
|
|
|
|
unsigned short frame_ms : 16;
|
|
|
|
int current_ms : 32;
|
|
|
|
unsigned short width : 16;
|
|
|
|
unsigned short height : 16;
|
|
|
|
unsigned char wrap_dest : 8;
|
2024-08-01 16:47:53 +02:00
|
|
|
} Animation;
|
|
|
|
|
|
|
|
/* TODO: Doc! */
|
|
|
|
void animation_new(Animation *animation, bopti_image_t *image,
|
|
|
|
unsigned char len, unsigned short frame_ms);
|
|
|
|
|
|
|
|
/* TODO: Doc! */
|
|
|
|
void animation_draw(Animation *animation, int x, int y);
|
|
|
|
|
|
|
|
/* TODO: Doc! */
|
|
|
|
void animation_update(Animation *animation, unsigned short frame_ms);
|
|
|
|
|
|
|
|
#endif
|