www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/04/26/05:25:00

Xref: news2.mv.net comp.os.msdos.djgpp:3151
From: stwand07 AT uctvms DOT uct DOT ac DOT za
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Allegro + pallete fades
Date: 25 Apr 96 11:55:56 +0200
Organization: University of Cape Town
Lines: 40
Message-ID: <1996Apr25.115556@uctvms.uct.ac.za>
References: <317561DD DOT A86 AT gl DOT umbc DOT edu> <4la5q0$6rg AT news DOT wco DOT com> <4lmmgb$je3 AT frodo DOT smartlink DOT net>
NNTP-Posting-Host: uctvms.uct.ac.za
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <4lmmgb$je3 AT frodo DOT smartlink DOT net>, nmarrone AT smartlink DOT net (Nicholas Marrone) writes:
> 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
> 
> 

Huh? From what this sounds like, wouldn't it look gray as well? (I haven't
tried it, but it sounds as if it won't preserve the colours correctly.)

Eg, if one palette entry is (r,g,b)=(32,48,63), the blue will be decremented to
48, then green & blue dec'd to 32 (now we have 50% gray), and then r,g,b dec'c
to 0 (50% gray to black). That doesn't sound too hot to me!

Adios
Mark Wodrich.

- Raw text -


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