l SDL_BlitSurface(tileSheets.at(sheet), &clip[tile], screen, &tileBox);
工作得很好,我像这样初始化剪辑:
clip[ 0 ].x = x;
clip[ 0 ].y = y;
clip[ 0 ].w = 48;
clip[ 0 ].h = 48;
x += 48;
clip[ 1 ].x = x;
clip[ 1 ].y = y;
clip[ 1 ].w = 48;
clip[ 1 ].h = 48;
然而,这根本不起作用
SDL_BlitSurface(tileSheets.at(sheet), &clip.at(tile), screen, &tileBox);
我像这样初始化它们:
for(int i = 0; i < number; i++)
{
SDL_Rect clipBox = {x,y,48,48};
clip.push_back(clipBox);
}
这是我得到的错误:http: //imageshack.us/photo/my-images/836/83468944.png/
有什么线索吗?