root / proj / include / sprite.h @ 274
History | View | Annotate | Download (2.16 KB)
1 |
#ifndef SPRITE_H_INCLUDED
|
---|---|
2 |
#define SPRITE_H_INCLUDED
|
3 |
|
4 |
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 |
/*
|
15 |
struct basic_sprite_alpha;
|
16 |
typedef struct basic_sprite_alpha basic_sprite_alpha_t;
|
17 |
|
18 |
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 |
struct sprite;
|
27 |
typedef struct sprite sprite_t; |
28 |
|
29 |
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 |
void (sprite_dtor)(sprite_t *p);
|
37 |
|
38 |
void (sprite_set_pos) (sprite_t *p, int16_t x, int16_t y);
|
39 |
void (sprite_set_center)(sprite_t *p, int16_t u0, int16_t v0);
|
40 |
void (sprite_set_angle) (sprite_t *p, double angle); |
41 |
void (sprite_set_scale) (sprite_t *p, double scale); |
42 |
|
43 |
int16_t (sprite_get_x)(const sprite_t *p);
|
44 |
int16_t (sprite_get_y)(const sprite_t *p);
|
45 |
double (sprite_get_angle)(const sprite_t *p); |
46 |
uint16_t (sprite_get_w)(const sprite_t *p);
|
47 |
uint16_t (sprite_get_h)(const sprite_t *p);
|
48 |
|
49 |
void (sprite_draw)(const sprite_t *p); |
50 |
|
51 |
#endif //SPRITE_H_INCLUDED |