...
|
...
|
@@ -289,13 +289,15 @@ capture_screen(void)
|
289
|
289
|
int w, h;
|
290
|
290
|
SDL_Surface *surface;
|
291
|
291
|
SDL_GetRendererOutputSize(emu_renderer, &w, &h);
|
292
|
|
- surface = SDL_CreateRGBSurface(0, w, h, 24, Rmask, Gmask, Bmask, 0);
|
|
292
|
+ if((surface = SDL_CreateRGBSurface(0, w, h, 24, Rmask, Gmask, Bmask, 0)) == NULL)
|
|
293
|
+ return;
|
293
|
294
|
SDL_RenderReadPixels(emu_renderer, NULL, format, surface->pixels, surface->pitch);
|
294
|
295
|
strftime(fname, sizeof(fname), "screenshot-%Y%m%d-%H%M%S.bmp", localtime(&t));
|
295
|
|
- SDL_SaveBMP(surface, fname);
|
|
296
|
+ if(SDL_SaveBMP(surface, fname) == 0){
|
|
297
|
+ fprintf(stderr, "Saved %s\n", fname);
|
|
298
|
+ fflush(stderr);
|
|
299
|
+ }
|
296
|
300
|
SDL_FreeSurface(surface);
|
297
|
|
- fprintf(stderr, "Saved %s\n", fname);
|
298
|
|
- fflush(stderr);
|
299
|
301
|
}
|
300
|
302
|
|
301
|
303
|
static void
|