| Description | Uses | Classes, Interfaces, Objects and Records | Functions and Procedures | Types | Constants | Variables |
256-color special effects.
In paletted video modes, translucency and lighting are implemented with a 64k lookup table, which contains the result of combining any two colors c1 and c2. You must set up this table before you use any of the translucency or lighting routines. Depending on how you construct the table, a range of different effects are possible. For example, translucency can be implemented by using a color halfway between c1 and c2 as the result of the combination. Lighting is achieved by treating one of the colors as a light level (0-255) rather than a color, and setting up the table appropriately. A range of specialised effects are possible, for instance replacing any color with any other color and making individual source or destination colors completely solid or invisible. Color mapping tables can be precalculated with the colormap utility, or generated at runtime.
PROCEDURE al_create_light_table (table: AL_COLOR_MAPptr; CONST pal: AL_PALETTE; r, g, b: AL_INT; callback: AL_INT_PROC); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'create_light_table'; |
PROCEDURE al_create_trans_table (table: AL_COLOR_MAPptr; CONST pal: AL_PALETTE; r, g, b: AL_INT; callback: AL_INT_PROC); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'create_trans_table'; |
PROCEDURE al_create_color_table (table: AL_COLOR_MAPptr; CONST pal: AL_PALETTE; blend: AL_256_BLEND_PROC; callback: AL_INT_PROC); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'create_color_table'; |
PROCEDURE al_create_blender_table (table: AL_COLOR_MAPptr; CONST pal: AL_PALETTE; callback: AL_INT_PROC); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'create_blender_table'; |
AL_COLOR_MAPptr = ˆAL_COLOR_MAP; |
AL_COLOR_MAP = ARRAY [0..AL_PAL_SIZE-1, 0..AL_PAL_SIZE-1] OF AL_UCHAR; |
AL_256_BLEND_PROC = PROCEDURE (CONST pal: AL_PALETTE; x, y: AL_INT; rgb: AL_RGBptr); CDECL; |
al_color_table: AL_COLOR_MAPptr; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'color_map'; |
PROCEDURE al_create_light_table (table: AL_COLOR_MAPptr; CONST pal: AL_PALETTE; r, g, b: AL_INT; callback: AL_INT_PROC); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'create_light_table'; |
|
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 al_rgb_map variable to speed up color conversions. If the callback function is not See also
|
PROCEDURE al_create_trans_table (table: AL_COLOR_MAPptr; CONST pal: AL_PALETTE; r, g, b: AL_INT; callback: AL_INT_PROC); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'create_trans_table'; |
|
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 al_rgb_map variable to speed up color conversions. If the callback function is not See also
|
PROCEDURE al_create_color_table (table: AL_COLOR_MAPptr; CONST pal: AL_PALETTE; blend: AL_256_BLEND_PROC; callback: AL_INT_PROC); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'create_color_table'; |
|
Fills the specified color mapping table with lookup data for doing customised effects with the specified palette, calling the blend function to determine the results of each color combination. Your blend routine will be passed a pointer to the palette and the two indices of the colors which are to be combined, and should fill in the RGB structure with the desired result in 0-63 format. Allegro will then search the palette for the closest match to the RGB color that you requested, so it doesn't matter if the palette has no exact match for this color. If the callback function is not See also
|
PROCEDURE al_create_blender_table (table: AL_COLOR_MAPptr; CONST pal: AL_PALETTE; callback: AL_INT_PROC); CDECL; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'create_blender_table'; |
|
Fills the specified color mapping table with lookup data for doing a paletted equivalent of whatever truecolor blender mode is currently selected. After calling al_set_trans_blender, al_set_blender_mode, or any of the other truecolor blender mode routines, you can use this function to create an 8-bit mapping table that will have the same results as whatever 24-bit blending mode you have enabled. If the callback function is not See also
|
AL_COLOR_MAPptr = ˆAL_COLOR_MAP; |
|
Pointer to AL_COLOR_MAP. |
AL_COLOR_MAP = ARRAY [0..AL_PAL_SIZE-1, 0..AL_PAL_SIZE-1] OF AL_UCHAR; |
|
Clolor map. See also
|
AL_256_BLEND_PROC = PROCEDURE (CONST pal: AL_PALETTE; x, y: AL_INT; rgb: AL_RGBptr); CDECL; |
|
Call-back procedure to be ussed to create color tables using al_create_color_table. |
al_color_table: AL_COLOR_MAPptr; EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'color_map'; |
|
Pointer to the color mapping table. You must allocate your own AL_COLOR_MAP either statically or dynamically and set See also
|