X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=blobdiff_plain;f=shape.c;fp=shape.c;h=92729e929f86d7cb6a80f29b5f835985918a2a68;hp=5aa7fb763b5a1600e6ce87313ea9c4ada83e27d0;hb=a77978e0c9bc91ea3d7b192ce136621e78d4ec5b;hpb=f3887c5ba3c117c7a3c2cc74e9ebdcce162a53fc diff --git a/shape.c b/shape.c index 5aa7fb7..92729e9 100644 --- a/shape.c +++ b/shape.c @@ -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 << (xoff & 31); xoff >>= 5; - return r->mask[yoff*r->mw + xoff] & pmask; + pmask = 1 << (32 - (xoff&0x1f)); + return r->mask[(yoff*r->mw) + (xoff>>5)] & pmask; }