Fills a color mapping table for translucency effects.
Fills the specified color mapping table with lookup data for doing
translucency effects with the specified palette. When combining the
colors c1 and c2 with this table, the result will be a color somewhere
between the two. The r, g, and b parameters specify the solidity of each
color component, ranging from 0 (totally transparent) to 255 (totally
solid). For 50% solidity, pass 128.
This function treats source color #0 as a special case, leaving the
destination unchanged whenever a zero source pixel is encountered, so that
masked sprites will draw correctly. This function will take advantage of
the global rgb_map variable to speed up color conversions. If the callback
function is not NULL, it will be called 256 times during the calculation,
allowing you to display a progress indicator. Example:
/* Build a color lookup table for translucent drawing. */
create_trans_table(&trans_table, pal, 128, 128, 128, NULL);
The following threads each have code containing this keyword:
Note: You can click on the numbers to jump directly to the posts that reference this page.
The following projects include source code containing this keyword: