#include "quakedef.h"
#include "cl_video.h"
+#include "jpeg.h"
cvar_t scr_viewsize = {CVAR_SAVE, "viewsize","100"};
cvar_t scr_fov = {CVAR_SAVE, "fov","90"}; // 10 - 170
cvar_t scr_showpause = {CVAR_SAVE, "showpause","1"};
cvar_t scr_printspeed = {0, "scr_printspeed","8"};
cvar_t scr_2dresolution = {CVAR_SAVE, "scr_2dresolution", "1"};
+cvar_t scr_screenshot_jpeg = {CVAR_SAVE, "scr_screenshot_jpeg","0"};
cvar_t cl_avidemo = {0, "cl_avidemo", "0"};
qboolean scr_initialized; // ready to draw
extern int c_rt_lights, c_rt_clears, c_rt_scissored;
extern int c_rt_shadowmeshes, c_rt_shadowtris, c_rt_lightmeshes, c_rt_lighttris;
extern int c_rtcached_shadowmeshes, c_rtcached_shadowtris;
-extern int r_shadow_lightingmode;
void R_TimeReport_Start(void)
{
r_timereport_active = r_speeds.integer && cls.signon == SIGNONS && cls.state == ca_connected;
c_faces, c_nodes, c_leafs, c_light_polys,
c_models, c_bmodels, c_sprites, c_particles, c_dlights,
c_alias_polys, c_meshs, c_meshelements / 3);
- if (r_shadow_lightingmode)
- {
- sprintf(r_speeds_string + strlen(r_speeds_string),
- "realtime lighting:%4i lights%4i clears%4i scissored\n"
- "dynamic: %6i shadowmeshes%6i shadowtris%6i lightmeshes%6i lighttris\n"
- "precomputed: %6i shadowmeshes%6i shadowtris\n",
- c_rt_lights, c_rt_clears, c_rt_scissored,
- c_rt_shadowmeshes, c_rt_shadowtris, c_rt_lightmeshes, c_rt_lighttris,
- c_rtcached_shadowmeshes, c_rtcached_shadowtris);
- }
+
+ sprintf(r_speeds_string + strlen(r_speeds_string),
+ "realtime lighting:%4i lights%4i clears%4i scissored\n"
+ "dynamic: %6i shadowmeshes%6i shadowtris%6i lightmeshes%6i lighttris\n"
+ "precomputed: %6i shadowmeshes%6i shadowtris\n",
+ c_rt_lights, c_rt_clears, c_rt_scissored,
+ c_rt_shadowmeshes, c_rt_shadowtris, c_rt_lightmeshes, c_rt_lighttris,
+ c_rtcached_shadowmeshes, c_rtcached_shadowtris);
c_alias_polys = 0;
c_light_polys = 0;
Cvar_RegisterVariable (&scr_centertime);
Cvar_RegisterVariable (&scr_printspeed);
Cvar_RegisterVariable (&scr_2dresolution);
+ Cvar_RegisterVariable (&scr_screenshot_jpeg);
Cvar_RegisterVariable (&cl_avidemo);
Cmd_AddCommand ("sizeup",SCR_SizeUp_f);
// HACK HACK HACK
// load the image data for the player image in the config menu
- dat = (qpic_t *)COM_LoadFile ("gfx/menuplyr.lmp", false);
+ dat = (qpic_t *)FS_LoadFile ("gfx/menuplyr.lmp", false);
if (!dat)
Sys_Error("unable to load gfx/menuplyr.lmp");
SwapPic (dat);
static int i = 0;
char filename[16];
char checkname[MAX_OSPATH];
-//
-// find a file name to save it to
-//
+ const char* extens;
+ qboolean jpeg = (scr_screenshot_jpeg.integer != 0);
+
+ if (jpeg)
+ extens = "jpg";
+ else
+ extens = "tga";
+
+ // find a file name to save it to
for (; i<=9999 ; i++)
{
- sprintf (filename, "dp%04i.tga", i);
- sprintf (checkname, "%s/%s", com_gamedir, filename);
- if (Sys_FileTime(checkname) == -1)
- break; // file doesn't exist
+ sprintf (filename, "dp%04i.%s", i, extens);
+ sprintf (checkname, "%s/%s", fs_gamedir, filename);
+ if (!FS_SysFileExists(checkname))
+ break;
}
if (i==10000)
{
- Con_Printf ("SCR_ScreenShot_f: Couldn't create a TGA file\n");
+ Con_Printf ("SCR_ScreenShot_f: Couldn't create the image file\n");
return;
}
- if (SCR_ScreenShot(filename, vid.realx, vid.realy, vid.realwidth, vid.realheight))
+ if (SCR_ScreenShot (filename, vid.realx, vid.realy, vid.realwidth, vid.realheight, jpeg))
Con_Printf ("Wrote %s\n", filename);
else
Con_Printf ("unable to write %s\n", filename);
{
char filename[32];
sprintf(filename, "dpavi%06d.tga", cl_avidemo_frame);
- if (SCR_ScreenShot(filename, vid.realx, vid.realy, vid.realwidth, vid.realheight))
+ if (SCR_ScreenShot(filename, vid.realx, vid.realy, vid.realwidth, vid.realheight, false))
cl_avidemo_frame++;
else
{
VectorCopy(envmapinfo[j].angles, r_refdef.viewangles);
R_ClearScreen();
R_RenderView ();
- SCR_ScreenShot(filename, vid.realx, vid.realy, size, size);
+ SCR_ScreenShot(filename, vid.realx, vid.realy, size, size, false);
}
envmap = false;