X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=blobdiff_plain;f=sprite.h;h=0c04cacbb262ab5598d12702aa7f404898135003;hp=953d3039f8b4597bdb23878e5028a9822f99bc61;hb=e9eaa65259d7c35d5a9b08aba9016145fa8f118d;hpb=44497dc461bc10bc2c4398e5311d4136007b3488 diff --git a/sprite.h b/sprite.h index 953d303..0c04cac 100644 --- a/sprite.h +++ b/sprite.h @@ -8,9 +8,9 @@ typedef struct sprite Sprite; #define SPRITE(x) ((Sprite *) (x)) -#define BASE_SPRITE 0 -#define SHIP_SPRITE 1 -#define ROCK_SPRITE 2 +#define BASE 0 +#define SHIP 1 +#define ROCK 2 #define N_TYPES 3 struct sprite { @@ -22,10 +22,14 @@ struct sprite { int w, h; int mask_w; uint32_t *mask; + uint32_t area; }; Sprite *free_sprites[N_TYPES]; // lists of free sprites, by type. +void do_collision(Sprite *a, Sprite *b); +void collisions(void); + void init_sprites(void); void add_sprite(Sprite *s); void move_sprite(Sprite *s); @@ -50,6 +54,7 @@ struct ship { int w, h; int mask_w; uint32_t *mask; + uint32_t area; // SHIP extras int lives; int jets; @@ -65,6 +70,7 @@ struct rock { int w, h; int mask_w; uint32_t *mask; + uint32_t area; // ROCK extras int type; };