Advertisement
Guest User

Untitled

a guest
Apr 26th, 2015
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1.     /*
  2.     Overlay a red alpha surface onto
  3.     */
  4.     SDL_Surface *hitRect;
  5.     for (int i = SHIP_HIT_INDEX ; i < MAX_SHIPSHAPES ; i++)
  6.     {
  7.         if (graphics.shipShape[i - SHIP_HIT_INDEX] == NULL)
  8.             continue;
  9.         graphics.shipShape[i] = graphics.createSurface(graphics.shipShape[i - SHIP_HIT_INDEX]->w, graphics.shipShape[i- SHIP_HIT_INDEX]->h);
  10.         graphics.blit(graphics.shipShape[i - SHIP_HIT_INDEX], 0, 0, graphics.shipShape[i]);
  11.         hitRect = graphics.alphaRect(graphics.shipShape[i]->w, graphics.shipShape[i]->h, 255, 0, 0);
  12.         graphics.blit(hitRect, 0, 0, graphics.shipShape[i]);
  13.         SDL_SetColorKey(graphics.shipShape[i], (SDL_SRCCOLORKEY|SDL_RLEACCEL), SDL_MapRGB(graphics.shipShape[i]->format, 127, 0, 0));
  14.         SDL_FreeSurface(hitRect);
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement