Re: [AD] clipping funny?

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


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 :{)>




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/