delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/16/06:57:29

From: Marco Koegler <koegler AT mailhost DOT uni-koblenz DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Allegro, sprite_draw and masked_blit
Date: Thu, 16 Apr 1998 07:49:01 +0200
Organization: Universitaet Koblenz, Germany.
Lines: 36
Message-ID: <35359BCD.30D59A00@informatik.uni-koblenz.de>
References: <4837423b4ealastairduncan AT argonet DOT co DOT uk>
NNTP-Posting-Host: delta
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019