moving to RLE sprites instead of compiled sprites
[eradicate] / src / sprite.h
1 #ifndef SPRITE_H_
2 #define SPRITE_H_
3
4 enum {
5         SOP_END,
6         SOP_ENDL,
7         SOP_SKIP,
8         SOP_RESVD,
9         SOP_COPY
10 };
11
12 #define SOP_OP(op)      ((op) & 0xff)
13 #define SOP_LEN(op)     ((op) >> 16)
14
15 struct sprite_op {
16         unsigned char op;
17         unsigned short size;
18         void *data;
19 };
20
21 struct sprite {
22         struct sprite_op *ops;
23         int num_ops;
24 };
25
26 struct sprites {
27         int width, height, bpp;
28
29         struct sprite *sprites;
30         int num_sprites;
31 };
32
33 void destroy_sprites(struct sprites *ss);
34
35 int load_sprites(struct sprites *ss, const char *fname);
36
37 #endif  /* SPRITE_H_ */