- if(initialshield>0 || shieldsup && shieldlevel>0) {
- int x,y,l;
- Uint16 c;
-
- if(initialshield>0) {
- initialshield -= movementrate;
- c = SDL_MapRGB(surf_screen->format,0,255,255);
- } else {
- c = heatcolor[(int)shieldlevel];
- shieldlevel -= movementrate;
- }
-
- shieldpulse += 0.2;
- for(p = black_point; p<blackptr; p++) {
- x = p->x + (int)xship + (rnd() + rnd()-1)*sin(shieldpulse)*4 + 1;
- y = p->y + (int)yship + (rnd() + rnd()-1)*sin(shieldpulse)*4 + 1;
- if(x>0 && y>0 && x<XSIZE && y<YSIZE) {
- offset = surf_screen->pitch/2 * y + x;
- raw_pixels[offset] = c;
- }
- }
- } else {
- // When the shields are off, check that the black points
- // on the ship are still black, and not covered up by rocks
- for(p = black_point; p<blackptr; p++) {
- offset = surf_screen->pitch/2 * (p->y + (int)yship) + p->x + (int)xship;
- if(raw_pixels[offset]) {
- // Set the bang flag
- bang = 1;
- }
+ // Check that the black points on the ship are
+ // still black, and not covered up by rocks.
+ for(p = black_point; p<blackptr; p++) {
+ offset = surf_screen->pitch/2 * (p->y + (int)yship) + p->x + (int)xship;
+ if(raw_pixels[offset]) {
+ // Set the bang flag
+ bang = 1;