Mail Archives: djgpp/2000/03/31/07:26:32
Greetings, Yannick Benoit <yannick DOT benoit AT dr DOT cgocable DOT ca>! You wrote:
> hi
> I got 2 bitmap that id like to use for a game,1 is background and 1 is
> player
> but i have a problem because the palletes are mixed up and the colors are
> weird.
> its like if it was using only 1 pallete, can anyone help?
Use that:
> static BITMAP *background;
> static PALLETE pal1;
> BITMAP *player;
> PALLETE pal2;
>
> int main ()
> {
> allegro_init();
set_color_depth(16);
if (set_gfx_mode(GFX_AUTODETECT, 800, 600, 0, 0) != 0) {
printf("Error setting a 16 bpp 800x600 video mode\n%s\n\n",
allegro_error);
return 1;
}
set_color_conversion(COLORCONV_TOTAL);
> background = load_pcx("background.pcx",pal1);
> set_pallete(pal1);
> player = load_pcx("player.pcx",pal2);
> set_pallete(pal2);
> blit(background,screen,0,0,0,0,800,600);
> blit(player,background,0,490,j,490,92,99);
> destroy_bitmap(background);
> destroy_bitmap(player);
> allegro_exit();
> }
or change resolution -- 640x480x16bpp is good enough for majority of apps.
Your problem is a too small display palette. If you want to save this
palette anyway, then you've to define and redefine it manually (like in
Starcraft). But that is a torment. :)
- Raw text -