Mail Archives: djgpp/1999/08/04/18:12:59
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.
- Raw text -