delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/13/02:07:16

Message-Id: <199710130605.TAA20407@fep1-orange.clear.net.nz>
From: "Jamie Love" <jamie DOT love AT clear DOT net DOT nz>
To: <djgpp AT delorie DOT com>
Subject: Fw: ALLEGRO: datafiles and palette manipulations
Date: Tue, 14 Oct 1997 06:55:45 +1300
MIME-Version: 1.0

----------
> From: Vic <tudor AT cam DOT org>
> To: djgpp AT delorie DOT com
> Subject: ALLEGRO: datafiles and palette manipulations
> Date: Wednesday, October 08, 1997 01:54
> 
> hi. I'm doin this stupid pacman clone and ,if you know the game, at the
> point where the dude gets invulnerable, the ghosts will change colors,
> right? How do I do this in allegro? cause the palette is in a datafile,
> and I say something like set_palette(dat[PALETA].dat). What I want is
> something simmilar to pal[103].r=100 or something like that. Anyone?
> TIA,
I presume that you are using 8bpp (ie 256 colour mode).
to access the palette use the following line:

((RGB *)dat[PALETA].dat)[x].r = 100;

where x is the index into the array.

I havn't tested this but it should work.

J Love

- Raw text -


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