Re: [AD] [BUG] (misfeature) In 8bpp 3d code

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


tom st denis wrote :
> 
> The POLYTYPE_FLAT and POLYTYPE_ATEX_LIT/POLYTYPE_PTEX_LIT should use
> the rgb_map table to get the colors.  It makes things more standard
> (POLYTYPE_GRGB uses it) and simplifies alot of code.

Yes, it may use rgb_map but it does not :-) This is not a bug nor a
misfeature. It is simpler to write 8bpp *LIT* functions with color_map
rather than use rgb_map. The 8 bpp scanline filler routines are
optimized to take advantage of the paletted modes specifities so they
use color_map rather than rgb_map. If we want to use rgb_map, we should
:
1. convert each 8bpp colors (texture color *and* light color) into 15 or
16 bpp depth
2. mix each R,G and B component of each color (up to six components !)
3. convert back the resulting colors into 8bpp
The color_map array reduces this procedure into one step ; if you want
to mix two colors c1 and c2 you just read color_map[c1][c2] which is
faster. 
Run test.exe and compare the speed of each rendering mode :
POLYTYPE_GCOL is twice faster than POLYTYPE_GRGB !!!

	Bertrand.



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/