X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=blobdiff_plain;f=shape.h;h=9f7371d678f3c2d3b460b8d2907f77e2af61999d;hp=c9a43fab48acc003c9d7084076bb7a9ad1b65294;hb=cd7fb220b16a73c15ff9dff7a5627bf78478875f;hpb=8193e09e49bc571f9c61e6e3adf45010271c08d5 diff --git a/shape.h b/shape.h index c9a43fa..9f7371d 100644 --- a/shape.h +++ b/shape.h @@ -1,11 +1,18 @@ +#ifndef VOR_SHAPE_H +#define VOR_SHAPE_H + #include #include struct shape { - uint32_t w, h; - uint32_t mw; + int w, h; + int mw; // mask width (number of uint32's) uint32_t *mask; + uint32_t area; }; void get_shape(SDL_Surface *img, struct shape *s); int collide(int xdiff, int ydiff, struct shape *r, struct shape *s); +int pixel_collide(unsigned int xoff, unsigned int yoff, struct shape *r); + +#endif // VOR_SHAPE_H