|
fblend fade with magic pink |
Neil Walker
Member #210
April 2000
|
Hello, In standard allegro you can simply do something like this for a fade, e.g. set_trans_blender(0,0,0, somevalue); draw_trans_sprite(bmp1,bmp2, 0,0); and the magic pink is preserved. However if you do fblend_fade_to_color(bmp2, bmp1, 0,0, colour1, somevalue); It does a complete fade, ignoring the magic pink. What you have to do (unless I'm completely wrong) is you have to do is check the original untouched bitmap for mask colour pixels and put them back into the faded bitmap (repeating/checking each bitmap depth): if(ColourDepth==32) { acquire_bitmap(bmp2); for(int i=0;i<w;i++) { for(int j=0;j<w;j++) { FadeColour=_getpixel32(bmp1, i, j); if(FadeColour==MASK_COLOR_32) _putpixel32(bmp2,i,j,MASK_COLOR_32); } } release_bitmap(bmp2);
Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
|