Re: [AD] auto convert bitmap mask to alpha channel

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


On 5 Aug 2009, at 7:13 , Elias Pschernig wrote:
Still had this mail marked as important so a final reply - loading the
A4 fonts is a matter of:

ALLEGRO_FONT *load_a4_font(char const *filename)
{
   ALLEGRO_BITMAP *bitmap = al_load_bitmap(filename);
   al_convert_mask_to_alpha(bitmap, al_map_rgb(255, 0, 255));
   return al_grab_font_from_bitmap(bitmap);
}

So I don't think we need to add anything else.

I agree - but if we're not adding this as a function, it might be nice to have this code in a "porting A4 to A5" FAQ/guide somewhere. I'm sure not everyone will work it out so easily.
(By the way, you have a memory leak there :P)

Evert




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