Mail Archives: djgpp/1998/04/16/06:57:29
Alastair Duncan wrote:
>
> I'm having trouble with masked blits. The mask colour is plotting as black
> and not transparent as it should, I've tried a number of permutations to
> see if I have the right mask colour and all seems well, here is some code
> I have been using to test masked blits,
>
> BITMAP* bitmap;
> bitmap = create_bitmap(100, 100);
> clear(bitmap);
> floodfill(bitmap,2,2,0);//this fills the bitmap with the mask colour 0
> floodfill(screen,2,2,255); //fill screen with white
> draw_sprite(screen, bitmap, 50,50); //should'nt plot anything as it is
> //masked however it blits a black rectangle
> masked_blit(bitmap,screen,0,0,150,50,bitmap->w,bitmap->h);
> ////should'nt plot anything as it is
> //masked however it blits a black rectangle
>
> I've checked the mask colour with bitmap_mask_colour(bitmap) which is
> returning 0 as expected,
>
> any help appreciated
>
> Alastair
My guess is that you are working in a high/truecolor graphics mode, and
therefore the masking color is 'bright pink' so doing a
floodfill(bitmap,2,2,makecol(255,0,255));
should do the trick.
Hope that helps,
Marco Koegler
koegler AT uni-koblenz DOT de
- Raw text -