Mail Archives: djgpp/1996/04/24/23:36:29
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 -