delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/11/04:47:26

From: Michael Bukin <bukinm AT sunkedr30 DOT inp DOT nsk DOT su>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: ALLEGRO: datafiles and palette manipulations
Date: 09 Oct 1997 13:34:26 +0600
Organization: Budker Institute of Nuclear Physics
Lines: 17
Message-ID: <m3yb43fkzh.fsf@H-Bukin.inp.nsk.su>
References: <343AD9BE DOT 7A0B AT cam DOT org>
NNTP-Posting-Host: aster.inp.nsk.su
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Vic <tudor AT cam DOT org> writes:

> 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?

  I believe, that memory for objects loaded from datafile
is allocated dynamically with malloc, so, you just do what you want
with its contents, like:

((PALETTE) dat[PALETA].dat)[103].r = 100; ...
set_color (103, &(((PALETTE) dat[PALETA].dat)[103]));

I have not tested above fragment, maybe parenthesis should be
placed differently.

- Raw text -


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