From: Alexei Levenko Newsgroups: comp.os.msdos.djgpp Subject: Re: Allegro shading, once again I'm lost Date: Wed, 14 Jul 1999 15:39:42 +0200 Organization: TU Ilmenau Lines: 11 Message-ID: <378C931E.14AEE6C1@in.stud.tu-ilmenau.de> References: <378C896D DOT BA341D0 AT ameritech DOT net> NNTP-Posting-Host: lanai.theoinf.tu-ilmenau.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.61 [en] (Win95; I) X-Accept-Language: en,ru To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com [skipped] In 8bit mode you have Color = ShadePalette[ BMP->line[y][x] ] [ 0 ] In 16bit mode you have double ShadeCoefficient; Color = BMP->line[y][x] * ShadeCoefficient; or if you prefer fixed-point, then long ShadeCoefficient; Color = (BMP->line[y][x] * ShadeCoefficient) >> 8;