Project

General

Profile

Statistics
| Revision:

root / proj / include / sprite.h @ 198

History | View | Annotate | Download (1.46 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

    
10
const uint8_t* (basic_sprite_get_map)(const basic_sprite_t *p);
11
uint16_t       (basic_sprite_get_w)  (const basic_sprite_t *p);
12
uint16_t       (basic_sprite_get_h)  (const basic_sprite_t *p);
13
int16_t        (basic_sprite_get_u0) (const basic_sprite_t *p);
14
int16_t        (basic_sprite_get_v0) (const basic_sprite_t *p);
15

    
16
struct sprite;
17
typedef struct sprite sprite_t;
18

    
19
sprite_t* (sprite_ctor)(const basic_sprite_t *bsp);
20
/*
21
 * /!\ WARNING: Entity destructor does not destruct the basic_sprite passed as
22
 * constructor arguments, since it is assumed the same basic_sprite may be used to
23
 * draw several sprites. It is thus YOUR responsibility to delete basic_sprite's.
24
 * @param   p   Pointer to sprite_t to be destructed
25
 */
26
void      (sprite_dtor)(sprite_t *p);
27

    
28
void (sprite_set_pos)   (sprite_t *p, int16_t x, int16_t y);
29
void (sprite_set_center)(sprite_t *p, int16_t u0, int16_t v0);
30
void (sprite_set_angle) (sprite_t *p, double angle);
31
void (sprite_set_scale) (sprite_t *p, double scale);
32

    
33
int16_t  (sprite_get_x)(const sprite_t *p);
34
int16_t  (sprite_get_y)(const sprite_t *p);
35
uint16_t (sprite_get_w)(const sprite_t *p);
36
uint16_t (sprite_get_h)(const sprite_t *p);
37

    
38
void (sprite_draw)(const sprite_t *p);
39

    
40
#endif //SPRITE_H_INCLUDED