X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=blobdiff_plain;f=main.c;h=be5ae97d21f794424319be6b88f4f991e62145bb;hp=9b593084c53293d8dff927f20272f6f69f9e03f0;hb=5bc27bd36ff9d698e4e757a5dd8f981b31cfaeab;hpb=30a8f3daae083e91cd30b016213286a7cdcecb09 diff --git a/main.c b/main.c index 9b59308..be5ae97 100644 --- a/main.c +++ b/main.c @@ -216,7 +216,7 @@ makebangdots(int xbang, int ybang, int dx, int dy, SDL_Surface *s, int power) { for(x = 0; xw; x++) { for(y = 0; yh; y++) { c = rawpixel[s->pitch/2*y + x]; - if(c && c != SDL_MapRGB(s->format,0,255,0)) { + if(c && c != s->format->colorkey) { theta = rnd()*M_PI*2; @@ -565,7 +565,7 @@ init(int fullscreen) { for(i = 0; i 3)) { + continue; + } + dx = rock[i].x - shipx; dy = rock[i].y - shipy; + n = sqrt(dx*dx + dy*dy); if(n < blast_radius) { n *= 20; @@ -944,7 +963,7 @@ gameloop() { } else { state = DEAD_PAUSE; - state_timeout = 20.0; + state_timeout = DEAD_PAUSE_LENGTH; shipdx = 0; shipdy = 0; } @@ -1000,18 +1019,6 @@ gameloop() { if(keystate[SDLK_p] | keystate[SDLK_s]) { if(!pausedown) { paused = !paused; - if(paused) { - SDL_Rect src,dest; - src.w = surf_b_variations->w; - src.h = surf_b_variations->h; - dest.w = src.w; - dest.h = src.h; - dest.x = (XSIZE-src.w)/2; - dest.y = (YSIZE-src.h)/2; - SDL_BlitSurface(surf_b_variations,&src,surf_screen,&dest); - // Update the surface - SDL_Flip(surf_screen); - } pausedown = 1; } } else {