[Dev-C++] Help with ALLEGRO question
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Louis G. <lg...@ya...> - 2003-04-29 13:28:36
|
Hi,
I'm new to the ALLEGRO package and when trying to compile this code
segment:
/* for generating the 8 bit additive color lookup table */
static void add_blender8 (PALETTE pal, int x, int y, RGB *rgb)
{ int r, g, b;
r = (int)pal[x].r + (int)pal[y].r;
g = (int)pal[x].g + (int)pal[y].g;
b = (int)pal[x].b + (int)pal[y].b;
rgb->r = MIN(r, 63);
rgb->g = MIN(g, 63);
rgb->b = MIN(b, 63);
}
int main ();
.....
PALETTE pal;
COLOR_MAP * color_map;
RGB_MAP * rgb_map;
color_map = (COLOR_MAP *) malloc(sizeof(COLOR_MAP));
create_color_table (color_map, pal, add_blender8, NULL);
.....
I get the compiler error:
converting `void (*)(RGB *, int, int, RGB *)' to
`void (*)(const RGB *, int, int, RGB *)' is a
contravariance violation.
Can any ALLEGRO experts help me on eliminating this error ?
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
|