Tue, 01 Jan 2002 10:18:33 +0000
change coordinates to signed.
bitblt.c | file | annotate | diff | revisions | |
bitblt.h | file | annotate | diff | revisions |
1.1 diff -r 3aac131058da -r 44d823824a46 bitblt.c 1.2 --- a/bitblt.c Tue Jan 01 10:16:50 2002 +0000 1.3 +++ b/bitblt.c Tue Jan 01 10:18:33 2002 +0000 1.4 @@ -50,7 +50,8 @@ 1.5 boolean get_pixel (Bitmap *bitmap, Point coord) 1.6 { 1.7 u8 *p; 1.8 - if ((coord.x >= bitmap->width) || (coord.y >= bitmap->height)) 1.9 + if ((coord.x < 0) || (coord.y < 0) || 1.10 + (coord.x >= bitmap->width) || (coord.y >= bitmap->height)) 1.11 return (0); 1.12 p = bitmap->bits + coord.y * bitmap->rowbytes + coord.x / 8; 1.13 return ((*p & pixel_mask (coord.x & 7)) != 0); 1.14 @@ -59,7 +60,8 @@ 1.15 void set_pixel (Bitmap *bitmap, Point coord, boolean value) 1.16 { 1.17 u8 *p; 1.18 - if ((coord.x >= bitmap->width) || (coord.y >= bitmap->height)) 1.19 + if ((coord.x < 0) || (coord.y < 0) || 1.20 + (coord.x >= bitmap->width) || (coord.y >= bitmap->height)) 1.21 return; 1.22 p = bitmap->bits + coord.y * bitmap->rowbytes + coord.x / 8; 1.23 if (value) 1.24 @@ -77,7 +79,6 @@ 1.25 int tfn) 1.26 { 1.27 Point src_point, dest_point; 1.28 - boolean src_pixel, dest_pixel; 1.29 1.30 if (! dest_bitmap) 1.31 {
2.1 diff -r 3aac131058da -r 44d823824a46 bitblt.h 2.2 --- a/bitblt.h Tue Jan 01 10:16:50 2002 +0000 2.3 +++ b/bitblt.h Tue Jan 01 10:18:33 2002 +0000 2.4 @@ -1,7 +1,7 @@ 2.5 typedef struct Point 2.6 { 2.7 - u32 x; 2.8 - u32 y; 2.9 + int x; 2.10 + int y; 2.11 } Point; 2.12 2.13 typedef struct Rect