delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/04/18:12:59

Message-ID: <8D53104ECD0CD211AF4000A0C9D60AE30154E48C@probe-2.acclaim-euro.net>
From: Shawn Hargreaves <ShawnH AT Probe DOT co DOT uk>
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)
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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019