delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/15/07:48:06

Message-ID: <8D53104ECD0CD211AF4000A0C9D60AE3535866@probe-2.acclaim-euro.net>
From: Shawn Hargreaves <ShawnH AT Probe DOT co DOT uk>
To: djgpp AT delorie DOT com
Subject: Re: Problems with allegro masked_blit function....transparency no
t working
Date: Mon, 15 Feb 1999 12:46:18 -0000
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.0.1460.8)
Reply-To: djgpp AT delorie DOT com

Chris writes:
> I have a 16 bit background on which I want to move around some 8 bit
> colour sprites. I would also like some parts of these sprites to be
> transparent so the background is visible through them.
>
> There is an allegro function masked_blit to do this, but it doesn't
> seem to work.....any points of colour 0 on my sprites simply show up
> as black on my background, NOT transparent.

Read the sections titled "loading image files" and "converting between 
color formats" in allegro.txt. To summarise, your 8 bit graphics are
probably being converted into 16 bit format when you load them: you
should call set_color_conversion(COLORCONV_NONE) to disable this. Once
you've got them in an 8 bit format, you can't use masked_blit() at 
all, because it doesn't support mixing images of different formats.
As a special case, the draw_sprite() function will handle this for
you, but please do read the relevant section of the docs: Allegro is
not generally designed to draw graphics of one format onto surfaces
of another, and this will cause you a lot of trouble unless you
understand exactly what (very limited) set of routines will correctly
support this situation.


	Shawn Hargreaves.

- Raw text -


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