Re: [AD] Logic in al_load_bitmap

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


On Tue, February 26, 2008 2:34 pm, Peter Hull said:
> I've got a question about this one too. In these lines:
> /* If it's a display bitmap */
>    if (!(al_get_new_bitmap_flags() & ALLEGRO_MEMORY_BITMAP) &&
> bitmap) {
>       bitmap->vt->upload_bitmap(bitmap, 0, 0, bitmap->w, bitmap->h);
>    }
> would it be better to test bitmap->flags rather than
> al_get_new_bitmap_flags? It doesn't matter except if a display
> driver
> doesn't support any accelerated bitmaps and returns a memory bitmap
> instead. Then the upload_bitmap vtable function is NULL and it
> crashes.
>
> Pete

Yes, I think you're right again. Good eye.


Trent




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