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
* config.h: added CONDERROR and NULLERROR macros.
[vor.git]
/
shape.c
diff --git
a/shape.c
b/shape.c
index
867610e
..
9e03f19
100644
(file)
--- a/
shape.c
+++ b/
shape.c
@@
-13,6
+13,7
@@
get_shape(SDL_Surface *img, struct shape *s)
exit(1);
}
exit(1);
}
+ s->area = 0;
s->w = img->w; s->h = img->h;
s->mw = ((img->w+31)>>5);
s->mask = malloc(4*s->mw*s->h);
s->w = img->w; s->h = img->h;
s->mw = ((img->w+31)>>5);
s->mask = malloc(4*s->mw*s->h);
@@
-29,7
+30,7
@@
get_shape(SDL_Surface *img, struct shape *s)
bit = 0;
for(x=0; x<img->w; x++) {
if(!bit) { bits = 0; bit = 0x80000000; }
bit = 0;
for(x=0; x<img->w; x++) {
if(!bit) { bits = 0; bit = 0x80000000; }
- if(*px++ != transp) bits |= bit;
+ if(*px++ != transp) { bits |= bit; s->area++; }
bit >>= 1;
if(!bit || x == img->w - 1) { *(p++) = bits; }
}
bit >>= 1;
if(!bit || x == img->w - 1) { *(p++) = bits; }
}