From: "A. Jans-Beken" Newsgroups: comp.os.msdos.djgpp Subject: Allegro: Lighting tables - how to? Date: Sat, 02 Jan 1999 16:34:24 +0100 Organization: World Access Lines: 33 Message-ID: <368E3C7F.94F8802F@wxs.nl> NNTP-Posting-Host: vl0082-0.dial.wxs.nl Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: reader3.wxs.nl 915291567 9234 195.121.18.82 (2 Jan 1999 15:39:27 GMT) X-Complaints-To: abuse AT wxs DOT nl NNTP-Posting-Date: 2 Jan 1999 15:39:27 GMT X-Mailer: Mozilla 4.04 [en] (Win95; I) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com I can't figure out how to use the lighting tables in allegro. I have red the docs and looked at the example programs. I want to create an effect (described later) and I think that lighting tables should do the trick. However everything that I try results in something different than what I expect -> a clear indication that my understanding has gaps. What I want is create realistic shadow effects: I have a sprite S, a shadow mask M and a tile T. To create nice effects with shadow I first draw the tile to a buffer. Next, I draw the shadow mask with draw_lit_sprite. Finally I draw the sprite with normal draw_sprite. In a program this would look like this: void draw_with_shadow(SPRITE& s, SHADOW& m, TILE& t) { BITMAP *buffer; // 1) Tile fills buffer. blit(... t to buffer ...); // 2) Shadow reduces intensity with 50% draw_lit_sprite(... m to buffer with color 128 ...); // 3) Sprite is draw normally. draw_sprite(... s to buffer ...); // 4) Copy the result to the screen. blit(... buffer to screen ...); } Two questions: - How do I have to initialize a COLOR_MAP to get this effect? - Someone has some example code?