我对这种方法有一个小问题,这是我的代码(我有更多代码,但这是给我错误的部分)
void ranCol( SDL_Surface sprite[], SDL_Rect paste)
{
SDL_FillRect(sprite[y],NULL,temp);
SDL_BlitSurface(sprite[y],&paste[y],rScreen(),NULL);
}
我收到 2 个错误
error C2664: 'SDL_FillRect' : cannot convert parameter 1 from 'SDL_Surface' to 'SDL_Surface *'
error C2664: 'randCol' : cannot convert parameter 2 from 'SDL_Surface *[50000]' to 'SDL_Surface []'
谁能帮我搞定这个工作?
编辑:这是代码以防有人想要编译它
void randCol(int times, SDL_Surface* sprite[], SDL_Rect paste)
{
int unsigned temp = 10101;//seed
for(int y = 0;y < times;y++)
{
temp = temp*(y+y+1);
temp = (temp^(0xffffff))>>2;
//printf("%x\n",temp);
SDL_FillRect(sprite[y],NULL,temp);
SDL_BlitSurface(sprite[y],&paste[y],rScreen(),NULL);
}
}