gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

C/C++ > Error Help

#161427 - zodiacdagreat - Sun Aug 03, 2008 9:39 am

Can anyone tell me why I'm getting this msg?

"my.c:11: error: expected ')' before '*' token"

Here's the routine:
//! Adjust intensity by \a intensity
/*!
\param dst Destination color array
\param src Source color array.
\param nclrs Number of colors.
\param intensity Intensity (in .8f)
\note Might be faster if preformed via lut.
*/

typedef unsigned short u16;
void clr_adj_intensity(COLOR *dst, const COLOR *src, uint nclrs, FIXED intensity)
{
u32 ii, clr;
int rr, gg, bb;
FIXED ia= intensity+FIX_ONE;

for(ii=0; ii<nclrs; ii++)
{
clr= *src++;

rr= ia*((clr )&31);
gg= ia*((clr>>5 )&31);
bb= ia*((clr>>10)&31);

// Shift here, because it'd be unsigned-shift otherwise
*dst++= RGB15(bf_clamp(rr>>8,5), bf_clamp(gg>>8,5), bf_clamp(bb>>8,5));
}
}

#161432 - kusma - Sun Aug 03, 2008 12:33 pm

It looks to me like COLOR and FIXED isn't any defined types.

#161433 - Kyoufu Kawa - Sun Aug 03, 2008 1:31 pm

That looks like Cearn code.

Oh yeah, that's right. You asked him yesterday. Anyway, I think Kusma's right there.

COLOR should be unsigned short. I'm not sure about FIXED.