Message-ID: <3725ABC1.10943C7D@softhome.net> From: Chris Mears X-Mailer: Mozilla 4.04 [en] (Win95; I) MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: Fading in/out with 16 bit colours References: <8D53104ECD0CD211AF4000A0C9D60AE301330CC6 AT probe-2 DOT acclaim-euro DOT net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 30 Date: Tue, 27 Apr 1999 22:21:21 +1000 NNTP-Posting-Host: 139.134.192.84 X-Trace: newsfeeds.bigpond.com 925215347 139.134.192.84 (Tue, 27 Apr 1999 22:15:47 EST) NNTP-Posting-Date: Tue, 27 Apr 1999 22:15:47 EST Organization: Telstra BigPond Internet Services (http://www.bigpond.com) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com 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