X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=blobdiff_plain;f=sprite.h;fp=sprite.h;h=939de0855470e2a7b41161e3be626bf8d18f8073;hp=c2d0a8e1757859c3ff1ab53a38766686f448fe18;hb=f8a464d8eed8cf611c0c3f80166d2a650efb1485;hpb=f33f1a05297ce0156030f0f78ecf5b84e00d424c diff --git a/sprite.h b/sprite.h index c2d0a8e..939de08 100644 --- a/sprite.h +++ b/sprite.h @@ -1,9 +1,11 @@ #ifndef VOR_SHAPE_H #define VOR_SHAPE_H -#include +#include #include +typedef union sprite Sprite; + // Shape stuff @@ -15,15 +17,13 @@ struct shape { }; 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); +int collide(Sprite *r, Sprite *s); +int pixel_collide(unsigned int xdiff, unsigned int ydiff, struct shape *r); // Sprite stuff -typedef union sprite Sprite; - #define SPRITE(x) ((Sprite *) (x)) struct base_sprite { @@ -71,4 +71,7 @@ union sprite { #define SHIP_SPRITE 1 #define ROCK_SPRITE 2 +SDL_Surface *load_image(char *filename); +void load_sprite(Sprite *sprite, char *filename); + #endif // VOR_SHAPE_H