From: Michael Bukin 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: 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 Precedence: bulk Vic 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.