Mail Archives: djgpp/1997/10/11/04:47:26
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 -