1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
int i;
for (i = 0; i < 2; i++) {
SDL_Rect dest;
dest.x = players[i].x;
dest.y = players[i].y;
SDL_Rect size;
size.x = 16 * players[i].moving;
size.y = 0;
size.w = 16;
size.h = 16;
SDL_Rect place;
place.x = 4;
place.y = 4;
SDL_Surface *tmp1 = SDL_CreateRGBSurface(0, 16, 16, 16, 0, 0, 0, 0);
SDL_BlitSurface(ship, &size, tmp1, NULL);
SDL_Surface *tmp2 = rotozoomSurface(tmp1, 360 - players[i].dir, 1.0, 0);
SDL_BlitSurface(tmp2, NULL, screen, &dest);
SDL_FreeSurface(tmp1);
SDL_FreeSurface(tmp2);
}
|