#include "quakedef.h"
#include "cl_video.h"
#include "jpeg.h"
+#include "cl_collision.h"
cvar_t scr_viewsize = {CVAR_SAVE, "viewsize","100"};
cvar_t scr_fov = {CVAR_SAVE, "fov","90"}; // 10 - 170
cvar_t scr_showturtle = {CVAR_SAVE, "showturtle","0"};
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 vid_conwidth = {CVAR_SAVE, "vid_conwidth", "640"};
+cvar_t vid_conheight = {CVAR_SAVE, "vid_conheight", "480"};
cvar_t scr_screenshot_jpeg = {CVAR_SAVE, "scr_screenshot_jpeg","0"};
cvar_t cl_avidemo = {0, "cl_avidemo", "0"};
Cvar_RegisterVariable (&scr_showpause);
Cvar_RegisterVariable (&scr_centertime);
Cvar_RegisterVariable (&scr_printspeed);
- Cvar_RegisterVariable (&scr_2dresolution);
+ Cvar_RegisterVariable (&vid_conwidth);
+ Cvar_RegisterVariable (&vid_conheight);
Cvar_RegisterVariable (&scr_screenshot_jpeg);
Cvar_RegisterVariable (&cl_avidemo);
if (cl.worldmodel)
{
Mod_CheckLoaded(cl.worldmodel);
- contents = cl.worldmodel ? cl.worldmodel->PointContents(cl.worldmodel, r_refdef.vieworg) : CONTENTS_EMPTY;
- if (contents != CONTENTS_EMPTY && contents != CONTENTS_SOLID)
+ contents = CL_PointSuperContents(r_refdef.vieworg);
+ if (contents & SUPERCONTENTS_LIQUIDSMASK)
{
r_refdef.fov_x *= (sin(cl.time * 4.7) * 0.015 + 0.985);
r_refdef.fov_y *= (sin(cl.time * 3.0) * 0.015 + 0.985);
void SCR_CaptureAVIDemo(void)
{
char filename[32];
- sprintf(filename, "dpavi%06d.tga", cl_avidemo_frame);
- if (SCR_ScreenShot(filename, vid.realx, vid.realy, vid.realwidth, vid.realheight, false))
+ qboolean jpeg = (scr_screenshot_jpeg.integer != 0);
+
+ if (jpeg)
+ sprintf(filename, "dpavi%06d.jpg", cl_avidemo_frame);
+ else
+ sprintf(filename, "dpavi%06d.tga", cl_avidemo_frame);
+
+ if (SCR_ScreenShot(filename, vid.realx, vid.realy, vid.realwidth, vid.realheight, jpeg))
cl_avidemo_frame++;
else
{
void CL_SetupScreenSize(void)
{
- static float old2dresolution = -1;
+ float conwidth, conheight;
VID_GetWindowSize (&vid.realx, &vid.realy, &vid.realwidth, &vid.realheight);
VID_UpdateGamma(false);
- if (scr_2dresolution.value != old2dresolution)
- {
- Cvar_SetValue("scr_2dresolution", bound(0.0f, scr_2dresolution.value, 1.0f));
- old2dresolution = scr_2dresolution.value;
- }
+ conwidth = bound(320, vid_conwidth.value, 2048);
+ conheight = bound(200, vid_conheight.value, 1536);
+ if (vid_conwidth.value != conwidth)
+ Cvar_SetValue("vid_conwidth", conwidth);
+ if (vid_conheight.value != conheight)
+ Cvar_SetValue("vid_conheight", conheight);
- if (vid.realwidth > 320)
- {
- vid.conwidth = (vid.realwidth - 320) * scr_2dresolution.value + 320;
- vid.conwidth = bound(320, vid.conwidth, vid.realwidth);
- }
- else
- vid.conwidth = 320;
-
- if (vid.realheight > 240)
- {
- vid.conheight = (vid.realheight - 240) * scr_2dresolution.value + 240;
- vid.conheight = bound(240, vid.conheight, vid.realheight);
- }
- else
- vid.conheight = 240;
+ vid.conwidth = vid_conwidth.integer;
+ vid.conheight = vid_conheight.integer;
SCR_SetUpToDrawConsole();
DrawQ_Clear();
- if (!intimerefresh)
- V_CalcRefdef();
-
if (cls.signon == SIGNONS)
R_TimeReport("setup");