for(x = 0; x<s->w; x++) {
for(y = 0; y<s->h; 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;
for(i = 0; i<NROCKS; i++) {
char a[MAX_PATH_LEN];
- snprintf(a,MAX_PATH_LEN,add_path("sprites/rock%d.png"),i);
+ snprintf(a,MAX_PATH_LEN,add_path("sprites/rock%02d.png"),i);
NULLERROR(temp = IMG_Load(a));
NULLERROR(surf_rock[i] = SDL_DisplayFormat(temp));
}
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 {