Re: Re: [AD] About create_bitmap

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


> Hm, to me, a bitmap with either
> dimension as 0 doesn't make much sense
> -
> so I'd tend to change this to ASSERT(w > 0 && h > 0). If there's some
> special reason why you need bitmaps
> with w/h 0, or maybe even with
> negative dimensions, it seems you
> could easily use a wrapper.

I've said it earlier, so I'll just summarize here:

To me, a BITMAP with zero area (zero w, h, or both) makes perfect sense. If you think about it in terms of a window on a screen, say, it just corresponds to a window which is resized down up to the limit. This is still a window, you can still draw stuff on it, but it is just that, zero size.
It's quite useful to have zero sized BITMAPs for GUIs. I have one, in which widgets are sub BITMAPs of their parent. In this case, I have a few cases where a zero area BITMAP makes sense. However, negative sizes do not make sense to me.

So, I'd allow zero w and/or h, and assert for negative sizes. I don't mind the "blow up in release mode" bit. In fact, I don't mind so much that I agree with it :)

Vincent





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