Mail Archives: djgpp/1999/04/27/08:45:39
Shawn Hargreaves wrote:
>
> Chris Mears writes:
> > In mode 13h, with a 256 colour palette, you could fade the whole screen
> > in and out simply by changing the values in the palette. And it was
> > fast. Now, my question: is there a fast and easy way to achieve the
> > same effect with 16 bit colours? Using djgpp and allegro, of course.
>
> There is no such easy way. You have to manually modify every single
> pixel on the screen to make them darker or lighter. The Allegro
> translucency and lighting functions can do this (eg. draw translucent
> black rectangles to darken the screen down), but it will be very
> slow and probably not look too smooth.
>
> Alternatively you could sacrifice a 128k lookup table, and use that
> to store the color one level darker than each 16 bit pixel, then
> just loop through the screen memory and replace each pixel with the
> version from your table. Allegro won't do that for you, though, and
> it still might be too slow, depending on video resolution and the
> speed of your PC.
>
> In truecolor modes, it is much more useful to swipe things on and off
> from the side of the screen, rather than trying to fade them :-)
>
> Shawn Hargreaves.
I had a feeling it might be that way. Sliding things from the sides of
the screen sounds good though. Thank the gods for masked_blit().
Chris
- Raw text -