Re: [AD] System bitmap bug (fix)

[ Thread Index | Date Index | More Archives ]

On Wed, Jul 16, 2003 at 09:56:51AM +0100, Vincent Penquerc'h wrote:
> But isn't this question moot ? The user surely should not know
> about the BMP_ID_SYSTEM flag anyway, as it's internal, right ?
> The point of having different kinds of BITMAPs is that the user
> can use them interchangeably, without caring whether's it's a
> memory BITMAP, etc (except when you want to access them directly
> through lines, but even that's somewhat abstracted through
> bmp_write_line and friends).

Yes, but the user can inquire wether or not a bitmap is a systembitmap.
IMHO, it would be ugly if create_system_bitmap() were to return a normal
memory bitmap in such a way that is_system_bitmap() returns false.

> There could be problems if system BITMAPs are supported but only
> a few of them, say, can be created. When destroying one, if it
> always has the BMP_ID_SYSTEM dlag set, you don't know whether it's
> really one or not, thus you don't know what "free" ops to do.

True. One dirty hack would be to create a new flag (it's internal anyway,
right) that ovverides the system bitmap flag. Something like an
I-am-a-system-bitmap-but-not-really flag.

The best thing though (IMHO) would be if system bitmaps work similarly to
videobitmaps: if they cabnb't be created, create_system_bitmap() returns
NULL. leaving it to the user to decide what to do. That would break the
API in a potentially bad way though, so we can't do that...


Mail converted by MHonArc 2.6.19+