1create_light_table(3) Allegro manual create_light_table(3)
2
3
4
6 create_light_table - Fills a color mapping table for lighting effects.
7 Allegro game programming library.
8
10 #include <allegro.h>
11
12
13 void create_light_table(COLOR_MAP *table, const PALETTE pal, int r, g,
14 b, void (*callback)(int pos));
15
17 Fills the specified color mapping table with lookup data for doing
18 lighting effects with the specified palette. When combining the colors
19 c1 and c2 with this table, c1 is treated as a light level from 0-255.
20 At light level 255 the table will output color c2 unchanged, at light
21 level 0 it will output the r, g, b value you specify to this function,
22 and at intermediate light levels it will output a color somewhere
23 between the two extremes. The r, g, and b values are in the range 0-63.
24
25 This function will take advantage of the global rgb_ap variable to
26 speed up color conversions. If the callback function is not NULL, it
27 will be called 256 times during the calculation, allowing you to dis‐
28 play a progress indicator. Example:
29
30 COLOR_MAP light_table;
31 ...
32 /* Build a color lookup table for lighting effects. */
33 create_light_table(&light_table, pal, 0, 0, 0, NULL);
34
35
37 color_map(3), create_trans_table(3), create_color_table(3), cre‐
38 ate_blender_table(3), draw_trans_sprite(3), draw_lit_sprite(3),
39 draw_gouraud_sprite(3), rgb_map(3), ex3d(3), exshade(3), extrans(3)
40
41
42
43Allegro version 4.2.2 create_light_table(3)