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, buffer3, 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, true))
Con_Printf("Wrote %s\n", filename);
else
Con_Printf("unable to write %s\n", filename);
unsigned char *b, *out;
char filename[32];
int outoffset = (width/2)*(height/2);
- //return SCR_ScreenShot(filename, cl_capturevideo_buffer, cl_capturevideo_buffer + vid.realwidth * vid.realheight * 3, cl_capturevideo_buffer + vid.realwidth * vid.realheight * 6, vid.realx, vid.realy, vid.realwidth, vid.realheight, false, false, false, jpeg);
+ //return SCR_ScreenShot(filename, cl_capturevideo_buffer, cl_capturevideo_buffer + vid.realwidth * vid.realheight * 3, cl_capturevideo_buffer + vid.realwidth * vid.realheight * 6, vid.realx, vid.realy, vid.realwidth, vid.realheight, false, false, false, jpeg, true);
// speed is critical here, so do saving as directly as possible
switch (cl_capturevideo_format)
{
}
envmapinfo[12] =
{
- {{ 0, 0, 0}, "rt", true, false, false},
- {{ 0, 90, 0}, "ft", true, false, false},
- {{ 0, 180, 0}, "lf", true, false, false},
- {{ 0, 270, 0}, "bk", true, false, false},
- {{-90, 180, 0}, "up", false, true, false},
- {{ 90, 180, 0}, "dn", false, true, false},
+ {{ 0, 0, 0}, "rt", false, false, false},
+ {{ 0, 270, 0}, "ft", false, false, false},
+ {{ 0, 180, 0}, "lf", false, false, false},
+ {{ 0, 90, 0}, "bk", false, false, false},
+ {{-90, 180, 0}, "up", true, true, false},
+ {{ 90, 180, 0}, "dn", true, true, false},
{{ 0, 0, 0}, "px", true, true, true},
{{ 0, 90, 0}, "py", false, true, false},
R_Mesh_Start();
R_RenderView();
R_Mesh_Finish();
- 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);
+ 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, false);
}
Mem_Free (buffer1);
==============================================================================
*/
-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)
+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, qboolean gammacorrect)
{
int indices[3] = {0,1,2};
qboolean ret;
qglReadPixels (x, y, width, height, GL_RGB, GL_UNSIGNED_BYTE, buffer1);
CHECKGLERROR
- if (scr_screenshot_gamma.value != 1)
+ if (scr_screenshot_gamma.value != 1 && gammacorrect)
{
int i;
double igamma = 1.0 / scr_screenshot_gamma.value;
void R_Mesh_Draw_ShowTris(int firstvertex, int numvertices, 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, qbyte *buffer3, 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, qboolean gammacorrect);
// used by R_Envmap_f and internally in backend, clears the frame
void R_ClearScreen(void);
// invoke refresh of frame