Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Overlay a red alpha surface onto
- */
- SDL_Surface *hitRect;
- for (int i = SHIP_HIT_INDEX ; i < MAX_SHIPSHAPES ; i++)
- {
- if (graphics.shipShape[i - SHIP_HIT_INDEX] == NULL)
- continue;
- graphics.shipShape[i] = graphics.createSurface(graphics.shipShape[i - SHIP_HIT_INDEX]->w, graphics.shipShape[i- SHIP_HIT_INDEX]->h);
- graphics.blit(graphics.shipShape[i - SHIP_HIT_INDEX], 0, 0, graphics.shipShape[i]);
- hitRect = graphics.alphaRect(graphics.shipShape[i]->w, graphics.shipShape[i]->h, 255, 0, 0);
- graphics.blit(hitRect, 0, 0, graphics.shipShape[i]);
- SDL_SetColorKey(graphics.shipShape[i], (SDL_SRCCOLORKEY|SDL_RLEACCEL), SDL_MapRGB(graphics.shipShape[i]->format, 127, 0, 0));
- SDL_FreeSurface(hitRect);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement