[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: "Coordination of admins/developers of the game programming library Allegro" <alleg-developers@xxxxxxxxxx>
- Subject: Re: [AD] clipping funny?
- From: "Trent Gamblin" <trent@xxxxxxxxxx>
- Date: Wed, 13 Aug 2008 08:40:59 -0600 (MDT)
On Wed, August 13, 2008 8:31 am, Peter Wang said:
> This looked weird to me:
>
> in al_put_pixel:
>
> if (bitmap->locked) {
> x -= bitmap->lock_x;
> y -= bitmap->lock_y;
> if (x < bitmap->cl || y < bitmap->ct ||
> x > bitmap->cr || y > bitmap->cb) {
> return;
> }
>
> al_get_pixel looks more likely:
>
> if (bitmap->locked) {
> x -= bitmap->lock_x;
> y -= bitmap->lock_y;
> if (x < 0 || y < 0 || x > bitmap->lock_w || y >
> bitmap->lock_h) {
> TRACE("al_get_pixel out of bounds\n");
> memset(&color, 0, sizeof(ALLEGRO_COLOR));
> return color;
> }
Ya I think they're both wrong. I think it should be >= on the upper
bounds. Fixed.
Trent :{)>