Re: [AD] bugfix in floodfill()

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


> Yeah, I think it is necessary to keep the other fields as shorts,
> because the algorithm uses a huge array of this struct. I was even
> thinking of incorporating the flags field in the top two bits of next,
> but that would only reduce the size from 12 to 10 bytes, which is not
> that useful and could even give speed penalties.

I agree.

> Probably not: this is merely an array index, which we usually keep as a
> signed int.

Ok.

> But it does make sense for lpos, rpos and y, in case someone floodfills
> really big bitmaps (but note that in general, we assume bitmaps can be
> addressed with fixed point coordinates, i.e., <32768). In floodfill it 
> can't hurt supporting up to 65535-sized bitmaps, so I attach an updated
> patch.

Yes, but coordinates are signed for Allegro and this would not really buy us 
anything so I think we should keep signed shorts.

> Sorry, what should be ASSERTed and where is the critical point?

The index wrapping around and the place in the code where this may happen.

-- 
Eric Botcazou




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