www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/04/24/23:36:29

Xref: news2.mv.net comp.os.msdos.djgpp:3069
From: nmarrone AT smartlink DOT net (Nicholas Marrone)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Allegro + pallete fades
Date: Thu, 25 Apr 1996 12:31:17 GMT
Organization: SmartLink.net Premier ISP 805-294-1273
Lines: 28
Message-ID: <4lmmgb$je3@frodo.smartlink.net>
References: <317561DD DOT A86 AT gl DOT umbc DOT edu> <4la5q0$6rg AT news DOT wco DOT com>
NNTP-Posting-Host: pm42-52.smartlink.net
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

agserm AT netwizards DOT net (Ansel Sermersheim) wrote:

>"Patrick L. Jenkins" <pjenki1 AT gl DOT umbc DOT edu> wrote:

>>Anybody know how to fade the pallete (in Allegro or generically) 1 step 
>>at a time so that amazing wonderful stuff can be done?

>>ex: an animation of some sort while fading to black...

>Well I'd start like this. 

>mypal: array of 768 bytes

>Read the pallette into mypal

[Basic palette fading function deleted]

	That last way works well, but when you fade out the palette it looks
grey and uneven. A better way to do it so that it fades evenly is to
take a variable and start it at 63 (for a 256 color palette). Compare
it to each R, B, & G value in each color, and if they are equal then
decrement it by one. Once you have gone through everything once,
decrement the variable and do it over again until the variable is
zero. This causes the screen to fade out to black evenly.

	nicholas


- Raw text -


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