Re: [Dev-C++] Help with ALLEGRO question
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2003-04-29 15:10:23
|
I don't run allegro, so I haven't the header files and can compare them
but:
your add_blender8() is a function, and you send it in as a function
pointer to the create_color_table function. The compiler error on the
other hand seem to list a parameter list taking an integer as third
parameter, i.e. the result of the call to add_blender8(xxx).
/Per W
On Tue, 29 Apr 2003, Louis Godio wrote:
> 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
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|