Re: understanding .pal files - XCC ForumRegister | Login | Search
History | Home | Messages

understanding .pal filessuicdman16:41 29-09-2005
Re: understanding .pal filesOlaf van der Spek17:13 29-09-2005
Re: understanding .pal filessuicdman17:44 29-09-2005
Re: understanding .pal filesOlaf van der Spek20:15 29-09-2005
Re: understanding .pal filessuicdman23:48 29-09-2005
Re: understanding .pal filesmeselfs18:49 30-09-2005

> > > > byte pal[768];
> > > > int i = 9;
> > > > int red = pal[3 * i];
> > > > int green = pal[3 * i + 1];
> > > > int blue = pal[3 * i + 2];

> > > (bare with me here)
> > > makes more sense now, but why is i = 9?

> > That's just an example. 0 to 255 are also valid.

> Understandable, thanks.

> > > i assume i increases to put more entires into the array, right? how would you read a .pal file and enter all of the colors into the array?

> > With fread().

> fread() has 4 parameters,

> void *buffer, -this would be pal[768]

Just pal, not pal[768].

> size_t size, -im not sure of this(would 6 bits have anything to do with it?)

This is the number of bytes to read at a time. Since byte (which is unsigned char) is 1 byte, set it to one.

> size_t count, -not sure about this one either.

Number of bytes to read, 768 in this case.

> FILE *stream -file object, i know this one;)

meselfs himself!



Home | Post | Users | Messages