Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
vor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
minor rearrangements and the beginnings of a Windows port.
[vor.git]
/
shape.c
diff --git
a/shape.c
b/shape.c
index
92729e9
..
f29bd6e
100644
(file)
--- 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;
{
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");
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;
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;
}
return r->mask[(yoff*r->mw) + (xoff>>5)] & pmask;
}