|
|
|
|
@ -392,6 +392,20 @@ opendoc(Document *d, char *name)
|
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int |
|
|
|
|
savebmp(void) |
|
|
|
|
{ |
|
|
|
|
int w, h; |
|
|
|
|
SDL_GetRendererOutputSize(gRenderer, &w, &h); |
|
|
|
|
w /= ZOOM; |
|
|
|
|
h /= ZOOM; |
|
|
|
|
SDL_Surface *sshot = SDL_CreateRGBSurfaceFrom(pixels, w, h, 8 * 4, w * 4, 0, 0, 0, 0); |
|
|
|
|
SDL_SaveBMP(sshot, "screenshot.bmp"); |
|
|
|
|
printf("Rendered screenshot\n"); |
|
|
|
|
SDL_FreeSurface(sshot); |
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
lookat(int x, int y) |
|
|
|
|
{ |
|
|
|
|
@ -431,23 +445,6 @@ pasteclip(Uint8 *clip, int id)
|
|
|
|
|
clearclip(clip); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int |
|
|
|
|
savebmp(void) |
|
|
|
|
{ |
|
|
|
|
SDL_Rect rect = {0, 0, WIDTH * ZOOM, HEIGHT * ZOOM}; |
|
|
|
|
SDL_Surface *surface = SDL_GetWindowSurface(gWindow); |
|
|
|
|
SDL_RenderReadPixels(gRenderer, |
|
|
|
|
&rect, |
|
|
|
|
SDL_PIXELFORMAT_ARGB8888, |
|
|
|
|
surface->pixels, |
|
|
|
|
surface->pitch); |
|
|
|
|
if(SDL_SaveBMP(surface, "nasu-render.bmp")) |
|
|
|
|
return error("Render", "Failed"); |
|
|
|
|
puts("Render: nasu-render.bmp"); |
|
|
|
|
SDL_FreeSurface(surface); |
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
selectoption(int option) |
|
|
|
|
{ |
|
|
|
|
|