I have a function which takes an array of SDL_Rect (which is a data structure containing four integers, x, y, h and w), and assigns values to the data members. However, when I try to compile, each line generates the error "error C2059: syntax error : '='".
int main()
{
SDL_Rect clips[ 4 ];
set_clips( clips );
}
//I get the error in this function on every line
void set_clips( SDL_Rect *clips )
{
//CLIP_MOUSEOVER and the others are defined to 0, 1, 2, and 3 using #define
clips[ CLIP_MOUSEOVER ]->x = 0;
clips[ CLIP_MOUSEOVER ]->y = 0;
clips[ CLIP_MOUSEOVER ]->w = 320;
clips[ CLIP_MOUSEOVER ]->h = 240;
clips[ CLIP_MOUSEOUT ]->x = 320;
clips[ CLIP_MOUSEOUT ]->y = 0;
clips[ CLIP_MOUSEOUT ]->w = 320;
clips[ CLIP_MOUSEOUT ]->h = 240;
clips[ CLIP_MOUSEDOWN ]->x = 0;
clips[ CLIP_MOUSEDOWN ]->y = 240;
clips[ CLIP_MOUSEDOWN ]->w = 320;
clips[ CLIP_MOUSEDOWN ]->h = 240;
clips[ CLIP_MOUSEUP ]->x = 320;
clips[ CLIP_MOUSEUP ]->y = 240;
clips[ CLIP_MOUSEUP ]->w = 320;
clips[ CLIP_MOUSEUP ]->h = 240;
}
I've been trying to figure it out for hours. Any idea what causes it? (I'm willing to bet it's something really stupid).