www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/04/21/04:22:25

Xref: news2.mv.net comp.os.msdos.djgpp:2901
From: agserm AT netwizards DOT net (Ansel Sermersheim)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Allegro + pallete fades
Date: Sat, 20 Apr 1996 08:07:26 GMT
Organization: West Coast Online's News Server - Not responsible for content
Lines: 34
Message-ID: <4la5q0$6rg@news.wco.com>
References: <317561DD DOT A86 AT gl DOT umbc DOT edu>
Reply-To: agserm AT netwizards DOT net
NNTP-Posting-Host: dial66.netwizards.net
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

"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

for each frame
	for each byte in mypal
		If it is nonzero subtract one.
	Set the pallette to mypal
	Do one frame 

Repeat as neccesary.

I'm pretty sure it'll work with any graphics library.

Just had a thought:  You're using a palletted mode right?  If you're using
15-16-24 bpp modes, it's gonna be a heck of a lot slower and a bit more
complicated.


---
This message may not be transmitted over any network owned directly or
indirectly by Microsoft without a $5000 royalty.  Transmission of this message
on such a network implies acceptance of these terms.  Subsequent messages
are to be individually licensed.

- Raw text -


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