Project

General

Profile

Statistics
| Revision:

root / proj / include / sprite.h @ 246

History | View | Annotate | Download (2.16 KB)

1 152 up20180642
#ifndef SPRITE_H_INCLUDED
2
#define SPRITE_H_INCLUDED
3
4 192 up20180642
struct basic_sprite;
5
typedef struct basic_sprite basic_sprite_t;
6
7
basic_sprite_t* (basic_sprite_ctor)(const char **xpm, int16_t u0, int16_t v0);
8
void            (basic_sprite_dtor)(basic_sprite_t *p);
9
const uint8_t* (basic_sprite_get_map)(const basic_sprite_t *p);
10
uint16_t       (basic_sprite_get_w)  (const basic_sprite_t *p);
11
uint16_t       (basic_sprite_get_h)  (const basic_sprite_t *p);
12
int16_t        (basic_sprite_get_u0) (const basic_sprite_t *p);
13
int16_t        (basic_sprite_get_v0) (const basic_sprite_t *p);
14 216 up20180642
/*
15
struct basic_sprite_alpha;
16
typedef struct basic_sprite_alpha basic_sprite_alpha_t;
17 192 up20180642

18 216 up20180642
basic_sprite_alpha_t* (basic_sprite_alpha_ctor)(const char **xpm, int16_t u0, int16_t v0);
19
void                  (basic_sprite_alpha_dtor)(basic_sprite_alpha_t *p);
20
const uint8_t*        (basic_sprite_alpha_get_map)(const basic_sprite_alpha_t *p);
21
uint16_t              (basic_sprite_alpha_get_w)  (const basic_sprite_alpha_t *p);
22
uint16_t              (basic_sprite_alpha_get_h)  (const basic_sprite_alpha_t *p);
23
int16_t               (basic_sprite_alpha_get_u0) (const basic_sprite_alpha_t *p);
24
int16_t               (basic_sprite_alpha_get_v0) (const basic_sprite_alpha_t *p);
25
*/
26 152 up20180642
struct sprite;
27
typedef struct sprite sprite_t;
28
29 192 up20180642
sprite_t* (sprite_ctor)(const basic_sprite_t *bsp);
30
/*
31
 * /!\ WARNING: Entity destructor does not destruct the basic_sprite passed as
32
 * constructor arguments, since it is assumed the same basic_sprite may be used to
33
 * draw several sprites. It is thus YOUR responsibility to delete basic_sprite's.
34
 * @param   p   Pointer to sprite_t to be destructed
35
 */
36 163 up20180642
void      (sprite_dtor)(sprite_t *p);
37 152 up20180642
38 163 up20180642
void (sprite_set_pos)   (sprite_t *p, int16_t x, int16_t y);
39 190 up20180642
void (sprite_set_center)(sprite_t *p, int16_t u0, int16_t v0);
40 163 up20180642
void (sprite_set_angle) (sprite_t *p, double angle);
41 190 up20180642
void (sprite_set_scale) (sprite_t *p, double scale);
42 152 up20180642
43 178 up20180642
int16_t  (sprite_get_x)(const sprite_t *p);
44
int16_t  (sprite_get_y)(const sprite_t *p);
45 231 up20180655
double   (sprite_get_angle)(const sprite_t *p);
46 178 up20180642
uint16_t (sprite_get_w)(const sprite_t *p);
47
uint16_t (sprite_get_h)(const sprite_t *p);
48 152 up20180642
49 163 up20180642
void (sprite_draw)(const sprite_t *p);
50 152 up20180642
51
#endif //SPRITE_H_INCLUDED