X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=blobdiff_plain;f=shape.c;h=f29bd6ed0a6edcbb59d68d4b784a193f71ee757e;hp=92729e929f86d7cb6a80f29b5f835985918a2a68;hb=cd7fb220b16a73c15ff9dff7a5627bf78478875f;hpb=a77978e0c9bc91ea3d7b192ce136621e78d4ec5b diff --git a/shape.c b/shape.c index 92729e9..f29bd6e 100644 --- a/shape.c +++ b/shape.c @@ -7,7 +7,7 @@ get_shape(SDL_Surface *img, struct shape *s) { int x, y; uint16_t *px, transp; - uint32_t bits, bit, *p; + uint32_t bits = 0, bit, *p; if(img->format->BytesPerPixel != 2) { fprintf(stderr, "get_shape(): not a 16-bit image!\n"); @@ -116,6 +116,6 @@ pixel_collide(unsigned int xoff, unsigned int yoff, struct shape *r) if(xoff >= r->w || yoff >= r->h) return 0; - pmask = 1 << (32 - (xoff&0x1f)); + pmask = 0x80000000 >> (xoff&0x1f); return r->mask[(yoff*r->mw) + (xoff>>5)] & pmask; }