char filename[MAX_QPATH];
qbyte *buffer1;
qbyte *buffer2;
+ qbyte *buffer3;
qboolean jpeg = (scr_screenshot_jpeg.integer != 0);
sprintf (base, "screenshots/%s", scr_screenshot_name.string);
buffer1 = Mem_Alloc(tempmempool, vid.realwidth * vid.realheight * 3);
buffer2 = Mem_Alloc(tempmempool, vid.realwidth * vid.realheight * 3);
+ buffer3 = Mem_Alloc(tempmempool, vid.realwidth * vid.realheight * 3 + 18);
- if (SCR_ScreenShot (filename, buffer1, buffer2, vid.realx, vid.realy, vid.realwidth, vid.realheight, false, false, false, jpeg))
+ if (SCR_ScreenShot (filename, buffer1, buffer2, buffer3, vid.realx, vid.realy, vid.realwidth, vid.realheight, false, false, false, jpeg))
Con_Printf("Wrote %s\n", filename);
else
Con_Printf("unable to write %s\n", filename);
Mem_Free (buffer1);
Mem_Free (buffer2);
+ Mem_Free (buffer3);
shotnumber++;
}
{
static qbyte *avi_buffer1 = NULL;
static qbyte *avi_buffer2 = NULL;
+ static qbyte *avi_buffer3 = NULL;
char filename[32];
qboolean jpeg = (scr_screenshot_jpeg.integer != 0);
{
avi_buffer1 = Mem_Alloc(tempmempool, vid.realwidth * vid.realheight * 3);
avi_buffer2 = Mem_Alloc(tempmempool, vid.realwidth * vid.realheight * 3);
+ avi_buffer3 = Mem_Alloc(tempmempool, vid.realwidth * vid.realheight * 3 + 18);
}
}
else
{
Mem_Free (avi_buffer1);
Mem_Free (avi_buffer2);
+ Mem_Free (avi_buffer3);
avi_buffer1 = NULL;
avi_buffer2 = NULL;
+ avi_buffer3 = NULL;
}
cl_avidemo_frame = 0;
return;
else
sprintf(filename, "video/dp%06d.tga", cl_avidemo_frame);
- if (SCR_ScreenShot(filename, avi_buffer1, avi_buffer2, vid.realx, vid.realy, vid.realwidth, vid.realheight, false, false, false, jpeg))
+ if (SCR_ScreenShot(filename, avi_buffer1, avi_buffer2, avi_buffer3, vid.realx, vid.realy, vid.realwidth, vid.realheight, false, false, false, jpeg))
cl_avidemo_frame++;
else
{
char filename[256], basename[256];
qbyte *buffer1;
qbyte *buffer2;
+ qbyte *buffer3;
if (Cmd_Argc() != 3)
{
buffer1 = Mem_Alloc(tempmempool, size * size * 3);
buffer2 = Mem_Alloc(tempmempool, size * size * 3);
+ buffer3 = Mem_Alloc(tempmempool, size * size * 3 + 18);
for (j = 0;j < 12;j++)
{
R_Mesh_Start();
R_RenderView();
R_Mesh_Finish();
- SCR_ScreenShot(filename, buffer1, buffer2, vid.realx, vid.realy + vid.realheight - (r_refdef.y + r_refdef.height), size, size, envmapinfo[j].flipx, envmapinfo[j].flipy, envmapinfo[j].flipdiagonaly, false);
+ SCR_ScreenShot(filename, buffer1, buffer2, buffer3, vid.realx, vid.realy + vid.realheight - (r_refdef.y + r_refdef.height), size, size, envmapinfo[j].flipx, envmapinfo[j].flipy, envmapinfo[j].flipdiagonaly, false);
}
Mem_Free (buffer1);
Mem_Free (buffer2);
+ Mem_Free (buffer3);
envmap = false;
}
==============================================================================
*/
-qboolean SCR_ScreenShot(char *filename, qbyte *buffer1, qbyte *buffer2, int x, int y, int width, int height, qboolean flipx, qboolean flipy, qboolean flipdiagonal, qboolean jpeg)
+qboolean SCR_ScreenShot(char *filename, qbyte *buffer1, qbyte *buffer2, qbyte *buffer3, int x, int y, int width, int height, qboolean flipx, qboolean flipy, qboolean flipdiagonal, qboolean jpeg)
{
int indices[3] = {0,1,2};
qboolean ret;
if (jpeg)
ret = JPEG_SaveImage_preflipped (filename, width, height, buffer2);
else
- ret = Image_WriteTGARGB_preflipped (filename, width, height, buffer2);
+ ret = Image_WriteTGARGB_preflipped (filename, width, height, buffer2, buffer3);
return ret;
}
void R_Mesh_Draw_ShowTris(int numverts, int numtriangles, const int *elements);
// saves a section of the rendered frame to a .tga or .jpg file
-qboolean SCR_ScreenShot(char *filename, qbyte *buffer1, qbyte *buffer2, int x, int y, int width, int height, qboolean flipx, qboolean flipy, qboolean flipdiagonal, qboolean jpeg);
+qboolean SCR_ScreenShot(char *filename, qbyte *buffer1, qbyte *buffer2, qbyte *buffer3, int x, int y, int width, int height, qboolean flipx, qboolean flipy, qboolean flipdiagonal, qboolean jpeg);
// used by R_Envmap_f and internally in backend, clears the frame
void R_ClearScreen(void);
// invoke refresh of frame
rtexture_t *loadtextureimagebumpasnmap (rtexturepool_t *pool, const char *filename, int matchwidth, int matchheight, qboolean complain, int flags, float bumpscale);
// writes a RGB TGA that is already upside down (which TGA wants)
-qboolean Image_WriteTGARGB_preflipped (const char *filename, int width, int height, const qbyte *data);
+qboolean Image_WriteTGARGB_preflipped (const char *filename, int width, int height, const qbyte *data, qbyte *buffer);
// writes a RGB TGA
void Image_WriteTGARGB (const char *filename, int width, int height, const qbyte *data);