Mail Archives: djgpp/1999/08/04/21:49:04
At 01:41 AM 8/4/99 +0200, you wrote:
>1 ) Can anyone tell me more on how to display
>my_nice_povray_rendered_targa_file(tm) in *true color* ?
>
>I already have this :
>
>...
> BITMAP *thing;
>...
Use set_color_depth() here to set the color depth (8, 15, 16, 24, 32 bpp)
> 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);
Is "board" defined ? shouldn't it be "thing" ?
>
> readkey();
>...
>...
>
>but that looks rather 8bbp-ish.
Change the color depth...
>
>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.
You'll need to extract the palette from the image from within the grabber,
so you have a palette and a bitmap object.
You can then use something like this:
pal = (RGB*)data[THING_PAL].dat;
set_palette(pal);
thing = (RPG_SPRITE*)data[THING_TGA].dat;
- GodOfWar
In the world of computers, things tend to become faster, smaller and
cheaper with time. Does that mean that Microsoft invented time travel ?
- Raw text -