create_light_table(3alleg4) [plan9 man page]
create_light_table(3alleg4) Allegro manual create_light_table(3alleg4) NAME
create_light_table - Fills a color mapping table for lighting effects. Allegro game programming library. SYNOPSIS
#include <allegro.h> void create_light_table(COLOR_MAP *table, const PALETTE pal, int r, g, b, void (*callback)(int pos)); DESCRIPTION
Fills the specified color mapping table with lookup data for doing lighting effects with the specified palette. When combining the colors c1 and c2 with this table, c1 is treated as a light level from 0-255. At light level 255 the table will output color c2 unchanged, at light level 0 it will output the r, g, b value you specify to this function, and at intermediate light levels it will output a color somewhere between the two extremes. The r, g, and b values are in the range 0-63. This function will take advantage of the global rgb_ap 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: COLOR_MAP light_table; ... /* Build a color lookup table for lighting effects. */ create_light_table(&light_table, pal, 0, 0, 0, NULL); SEE ALSO
color_map(3alleg4), create_trans_table(3alleg4), create_color_table(3alleg4), create_blender_table(3alleg4), draw_trans_sprite(3alleg4), draw_lit_sprite(3alleg4), draw_gouraud_sprite(3alleg4), rgb_map(3alleg4), ex3d(3alleg4), exshade(3alleg4), extrans(3alleg4) Allegro version 4.4.2 create_light_table(3alleg4)
Check Out this Related Man Page
draw_lit_sprite(3alleg4) Allegro manual draw_lit_sprite(3alleg4) NAME
draw_lit_sprite - Draws a sprite tinted with a specific color. Allegro game programming library. SYNOPSIS
#include <allegro.h> void draw_lit_sprite(BITMAP *bmp, BITMAP *sprite, int x, int y, int color); DESCRIPTION
In 256-color modes, uses the global color_map table to tint the sprite image to the specified color or to light it to the level specified by "color", depending on the function which was used to build the table (create_trans_table or create_light_table), and draws the resulting image to the destination bitmap. In truecolor modes, uses the blender functions to light the sprite image using the alpha level specified by "color" (the alpha level which was passed to the blender functions is ignored) and draws the resulting image to the destination bitmap. The "color" parameter must be in the range [0-255] whatever its actual meaning is. This must only be used after you have set up the color mapping table (for 256-color modes) or blender functions (for truecolor modes). Example: /* Some one time initialisation code. */ COLOR_MAP global_light_table; create_light_table(&global_trans_table, my_palette, 10, 10, 60, NULL); ... if (get_color_depth() == 8) color_map = &global_light_table; else set_trans_blender(40, 40, 255, 255); /* Lit the cape with a blueish light. */ draw_lit_sprite(buffer, colored_cape, x, y, 64); SEE ALSO
draw_sprite(3alleg4), draw_trans_sprite(3alleg4), draw_gouraud_sprite(3alleg4), draw_lit_rle_sprite(3alleg4), color_map(3alleg4), set_trans_blender(3alleg4), bitmap_mask_color(3alleg4), exblend(3alleg4) Allegro version 4.4.2 draw_lit_sprite(3alleg4)