Palette storage... Shifting...
13h game. DJGPP. Windows95
Will someone please explain to me what Brackeen
is doing when he's shifing the return value
of fgetc(fp)?
Code:
for(index=0;index<num_colors;index++)
{
b->palette[(int)(index*3+2)] = fgetc(fp) >> 2;
b->palette[(int)(index*3+1)] = fgetc(fp) >> 2;
b->palette[(int)(index*3+0)] = fgetc(fp) >> 2;
x=fgetc(fp);
}
Is there a specific reason why he's doing this
(as in, does it have to be done in order for
the palette to be stored correctly?), or is
it just for speed? I understand what shifting does,
but I'm not quite comfortable with it, yet.
Thanks,
static.