Message-ID: <8D53104ECD0CD211AF4000A0C9D60AE30154E48C@probe-2.acclaim-euro.net> From: Shawn Hargreaves To: djgpp AT delorie DOT com Subject: Re: beginner allegro question Date: Wed, 4 Aug 1999 09:46:13 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.0.1460.8) Content-Type: text/plain Reply-To: djgpp AT delorie DOT com Delbeke P. writes: > if (set_gfx_mode(GFX_VESA2L, 640, 480, 0, 0) != 0) { > printf ("uh-oh"); > exit(1); > } > > thing = load_tga("thing.tga",pal); > set_palette(pal); > draw_sprite(screen, board, 0, 0); > > but that looks rather 8bbp-ish. Add a call to set_color_depth(something greater than 8) before you call set_gfx_mode(). > And yet another silly question : If I put this tga-fila in a data-file, I > do : > thing = (RLE_SPRITE *)data[THING_TGA].dat; > ... but I don't know how to get the palette right. Datafiles don't store the palette along with the bitmap, so you need to add this separately. Make a palette object, grab into it from your image file, and then select that palette before displaying the image. The exdata.c example program shows how to display a simple image from inside a datafile. Shawn Hargreaves.