11#ifdef CONFIG_VIDEO_CAPTURE
35cvar_t scr_menuforcewhiledisconnected = {
CF_CLIENT,
"scr_menuforcewhiledisconnected",
"0",
"forces menu while disconnected"};
41cvar_t scr_showbrand = {
CF_CLIENT,
"showbrand",
"0",
"shows gfx/brand.tga in a corner of the screen (different values select different positions, including centered)"};
42cvar_t scr_printspeed = {
CF_CLIENT,
"scr_printspeed",
"0",
"speed of intermission printing (episode end texts), a value of 0 disables the slow printing"};
46cvar_t scr_loadingscreen_scale_limit = {
CF_CLIENT,
"scr_loadingscreen_scale_limit",
"0",
"0 = no limit, 1 = until first edge hits screen edge, 2 = until last edge hits screen edge, 3 = until width hits screen width, 4 = until height hits screen height"};
54cvar_t scr_sbarscale = {
CF_CLIENT |
CF_READONLY,
"scr_sbarscale",
"1",
"current vid_height/vid_conheight, for compatibility with csprogs that read this cvar (found in Fitzquake-derived engines and FTEQW; despite the name it's not specific to the status bar)"};
66#ifdef CONFIG_VIDEO_CAPTURE
67cvar_t cl_capturevideo = {
CF_CLIENT,
"cl_capturevideo",
"0",
"enables saving of video to a .avi file using uncompressed I420 colorspace and PCM audio, note that scr_screenshot_gammaboost affects the brightness of the output)"};
68cvar_t cl_capturevideo_demo_stop = {
CF_CLIENT |
CF_ARCHIVE,
"cl_capturevideo_demo_stop",
"1",
"automatically stops video recording when demo ends"};
69cvar_t cl_capturevideo_printfps = {
CF_CLIENT |
CF_ARCHIVE,
"cl_capturevideo_printfps",
"1",
"prints the frames per second captured in capturevideo (is only written to stdout and any log file, not to the console as that would be visible on the video), value is seconds of wall time between prints"};
70cvar_t cl_capturevideo_width = {
CF_CLIENT |
CF_ARCHIVE,
"cl_capturevideo_width",
"0",
"scales all frames to this resolution before saving the video"};
71cvar_t cl_capturevideo_height = {
CF_CLIENT |
CF_ARCHIVE,
"cl_capturevideo_height",
"0",
"scales all frames to this resolution before saving the video"};
72cvar_t cl_capturevideo_realtime = {
CF_CLIENT,
"cl_capturevideo_realtime",
"0",
"causes video saving to operate in realtime (mostly useful while playing, not while capturing demos), this can produce a much lower quality video due to poor sound/video sync and will abort saving if your machine stalls for over a minute"};
73cvar_t cl_capturevideo_fps = {
CF_CLIENT |
CF_ARCHIVE,
"cl_capturevideo_fps",
"30",
"how many frames per second to save (29.97 for NTSC, 30 for typical PC video, 15 can be useful)"};
74cvar_t cl_capturevideo_nameformat = {
CF_CLIENT |
CF_ARCHIVE,
"cl_capturevideo_nameformat",
"dpvideo",
"prefix for saved videos (the date is encoded using strftime escapes)"};
75cvar_t cl_capturevideo_number = {
CF_CLIENT |
CF_ARCHIVE,
"cl_capturevideo_number",
"1",
"number to append to video filename, incremented each time a capture begins"};
76cvar_t cl_capturevideo_ogg = {
CF_CLIENT |
CF_ARCHIVE,
"cl_capturevideo_ogg",
"1",
"save captured video data as Ogg/Vorbis/Theora streams"};
77cvar_t cl_capturevideo_framestep = {
CF_CLIENT |
CF_ARCHIVE,
"cl_capturevideo_framestep",
"1",
"when set to n >= 1, render n frames to capture one (useful for motion blur like effects)"};
79cvar_t r_letterbox = {
CF_CLIENT,
"r_letterbox",
"0",
"reduces vertical height of view to simulate a letterboxed movie effect (can be used by mods for cutscenes)"};
81cvar_t r_stereo_sidebyside = {
CF_CLIENT,
"r_stereo_sidebyside",
"0",
"side by side views for those who can't afford glasses but can afford eye strain (note: use a negative r_stereo_separation if you want cross-eyed viewing)"};
84cvar_t r_stereo_redblue = {
CF_CLIENT,
"r_stereo_redblue",
"0",
"red/blue anaglyph stereo glasses (note: most of these glasses are actually red/cyan, try that one too)"};
85cvar_t r_stereo_redcyan = {
CF_CLIENT,
"r_stereo_redcyan",
"0",
"red/cyan anaglyph stereo glasses, the kind given away at drive-in movies like Creature From The Black Lagoon In 3D"};
87cvar_t r_stereo_angle = {
CF_CLIENT,
"r_stereo_angle",
"0",
"separation angle of eyes (makes the views look different directions, as an example, 90 gives a 90 degree separation where the views are 45 degrees left and 45 degrees right)"};
91cvar_t net_graph = {
CF_CLIENT |
CF_ARCHIVE,
"net_graph",
"0",
"shows a graph of packet sizes and other information, 0 = off, 1 = show client netgraph, 2 = show client and server netgraphs (when hosting a server)"};
92cvar_t cl_demo_mousegrab = {
CF_CLIENT,
"cl_demo_mousegrab",
"0",
"Allows reading the mouse input while playing demos. Useful for camera mods developed in csqc. (0: never, 1: always)"};
178 unsigned int i, c, p;
185 for(
i = 2;
i < c; ++
i)
192 for(p = 0,
i = 0;
i < c; ++
i)
198 else if(msg[
i+1] ==
'\\')
249 char *newline = strchr(start,
'\n');
250 int l = newline ? (newline - start) : (
int)
strlen(start);
258 DrawQ_String(
x,
y, start, l, 8, 8, 1, 1, 1, 1, 0, &
color,
false,
FONT_CENTERPRINT);
296 char bytesstring[128];
300 DrawQ_Fill(graphx, graphy, graphwidth, graphheight + textsize * 2, 0, 0, 0, 0.5, 0);
302 memset(
g, 0,
sizeof(
g));
305 graph = netgraph + j;
324 g[j][5] =
g[j][4] - graph->
ackbytes * graphscale;
331 g[j][1] =
bound(0.0f,
g[j][1], 1.0f);
332 g[j][2] =
bound(0.0f,
g[j][2], 1.0f);
333 g[j][3] =
bound(0.0f,
g[j][3], 1.0f);
334 g[j][4] =
bound(0.0f,
g[j][4], 1.0f);
335 g[j][5] =
bound(0.0f,
g[j][5], 1.0f);
336 g[j][6] =
bound(0.0f,
g[j][6], 1.0f);
343 if (
a[0] < 0.0f ||
b[0] > 1.0f ||
b[0] <
a[0])
345 DrawQ_Line(1, graphx + graphwidth *
a[0], graphy + graphheight *
a[2], graphx + graphwidth *
b[0], graphy + graphheight *
b[2], 1.0f, 1.0f, 1.0f, 1.0f, 0);
346 DrawQ_Line(1, graphx + graphwidth *
a[0], graphy + graphheight *
a[1], graphx + graphwidth *
b[0], graphy + graphheight *
b[1], 1.0f, 0.0f, 0.0f, 1.0f, 0);
347 DrawQ_Line(1, graphx + graphwidth *
a[0], graphy + graphheight *
a[5], graphx + graphwidth *
b[0], graphy + graphheight *
b[5], 0.0f, 1.0f, 0.0f, 1.0f, 0);
348 DrawQ_Line(1, graphx + graphwidth *
a[0], graphy + graphheight *
a[4], graphx + graphwidth *
b[0], graphy + graphheight *
b[4], 1.0f, 1.0f, 1.0f, 1.0f, 0);
349 DrawQ_Line(1, graphx + graphwidth *
a[0], graphy + graphheight *
a[3], graphx + graphwidth *
b[0], graphy + graphheight *
b[3], 1.0f, 0.5f, 0.0f, 1.0f, 0);
350 DrawQ_Line(1, graphx + graphwidth *
a[0], graphy + graphheight *
a[6], graphx + graphwidth *
b[0], graphy + graphheight *
b[6], 0.0f, 0.0f, 1.0f, 1.0f, 0);
353 y = graphy + graphheight;
354 dpsnprintf(bytesstring,
sizeof(bytesstring),
"%i", totalbytes);
355 DrawQ_String(
x,
y, label , 0, textsize, textsize, 1.0f, 1.0f, 1.0f, 1.0f, 0,
NULL,
false,
FONT_DEFAULT);
y += textsize;
356 DrawQ_String(
x,
y, bytesstring, 0, textsize, textsize, 1.0f, 1.0f, 1.0f, 1.0f, 0,
NULL,
false,
FONT_DEFAULT);
y += textsize;
366 int i, separator1, separator2, graphwidth, graphheight, netgraph_x, netgraph_y, textsize,
index, netgraphsperrow, graphlimit;
383 graphscale = 1.0f / 1500.0f;
386 netgraphsperrow = (
vid_conwidth.
integer + separator2) / (graphwidth * 2 + separator1 + separator2);
387 netgraphsperrow =
max(netgraphsperrow, 1);
390 netgraph_x = (
vid_conwidth.
integer + separator2) - (1 + (
index % netgraphsperrow)) * (graphwidth * 2 + separator1 + separator2);
404 netgraph_x = (
vid_conwidth.
integer + separator2) - (1 + (
index % netgraphsperrow)) * (graphwidth * 2 + separator1 + separator2);
405 netgraph_y = (
vid_conheight.
integer - 48 + separator2) - (1 + (
index / netgraphsperrow)) * (graphheight + textsize + separator2);
406 SCR_DrawNetGraph_DrawGraph(netgraph_x , netgraph_y, graphwidth, graphheight, graphscale, graphlimit,
va(vabuf,
sizeof(vabuf),
"%s",
svs.
clients[
i].name), textsize, c->
outgoing_packetcounter, c->
outgoing_netgraph);
570 DrawQ_String(
x,
y, temp, len,
size,
size, 1, 1, 1, 1, 0,
NULL,
true,
FONT_INFOBAR);
588 DrawQ_String(
x,
y,
scr_infobarstring, len,
size,
size, 1, 1, 1, 1, 0,
NULL,
false,
FONT_INFOBAR);
607 char addinfobuf[128];
621 DrawQ_String(
x,
y -
size, addinfo, len,
size,
size, 0, 0, 0, 1, 0,
NULL,
true,
FONT_INFOBAR);
624 for(
i = 0;
i != nDownloads; ++
i)
626 if(downinfo[
i].queued)
627 dpsnprintf(temp,
sizeof(temp),
"Still in queue: %s", downinfo[
i].filename);
628 else if(downinfo[
i].progress <= 0)
629 dpsnprintf(temp,
sizeof(temp),
"Downloading %s ... ???.?%% @ %.1f KiB/s", downinfo[
i].filename, downinfo[
i].speed / 1024.0);
631 dpsnprintf(temp,
sizeof(temp),
"Downloading %s ... %5.1f%% @ %.1f KiB/s", downinfo[
i].filename, 100.0 * downinfo[
i].progress, downinfo[
i].speed / 1024.0);
635 DrawQ_String(
x,
y +
i *
size, temp, len,
size,
size, 1, 1, 1, 1, 0,
NULL,
true,
FONT_INFOBAR);
640 return size * (nDownloads + (addinfo ? 1 : 0));
667 char addinfobuf[128];
679 offset += (nDownloads + (addinfo ? 1 : 0));
701 Con_Printf(
"usage:\ninfobar expiretime \"string\"\n");
714 static int framecounter = 0;
722 if (framecounter >= 2)
794#ifdef CONFIG_VIDEO_CAPTURE
795void SCR_CaptureVideo_EndVideo(
void);
799#ifdef CONFIG_VIDEO_CAPTURE
800 SCR_CaptureVideo_EndVideo();
854#ifdef CONFIG_VIDEO_CAPTURE
907#ifdef CONFIG_VIDEO_CAPTURE
921 static int shotnumber;
925 unsigned char *buffer1;
926 unsigned char *buffer2;
936 if (!strcasecmp(ext,
"jpg"))
941 else if (!strcasecmp(ext,
"tga"))
946 else if (!strcasecmp(ext,
"png"))
953 Con_Printf(
"screenshot: supplied filename must end in .jpg or .tga or .png\n");
969 for (shotnumber100 = 0;shotnumber100 < 100;shotnumber100++)
974 if (shotnumber100 >= 100)
976 Con_Print(
"Couldn't create the image file - already 100 shots taken this second!\n");
980 dpsnprintf(filename,
sizeof(filename),
"screenshots/%s-%02d.%s", prefix_name, shotnumber100, jpeg ?
"jpg" : png ?
"png" :
"tga");
989 dpsnprintf(prefix_name,
sizeof(prefix_name),
"%s", vabuf);
994 if (strcmp(old_prefix_name, prefix_name))
996 dpsnprintf(old_prefix_name,
sizeof(old_prefix_name),
"%s", prefix_name );
1001 for (;shotnumber < 1000000;shotnumber++)
1006 if (shotnumber >= 1000000)
1008 Con_Print(
"Couldn't create the image file - you already have 1000000 screenshots!\n");
1012 dpsnprintf(filename,
sizeof(filename),
"screenshots/%s%06d.%s", prefix_name, shotnumber, jpeg ?
"jpg" : png ?
"png" :
"tga");
1020 if (
SCR_ScreenShot (filename, buffer1, buffer2, 0, 0,
vid.
mode.
width,
vid.
mode.
height,
false,
false,
false, jpeg, png,
true,
scr_screenshot_alpha.
integer != 0))
1027 if(
SCR_ScreenShot (filename, buffer1, buffer2, 0, 0,
vid.
mode.
width,
vid.
mode.
height,
false,
false,
false,
false,
false,
true,
scr_screenshot_alpha.
integer != 0))
1039#ifdef CONFIG_VIDEO_CAPTURE
1040static void SCR_CaptureVideo_BeginVideo(
void)
1045 char timestring[128];
1047 if (
cls.capturevideo.active)
1049 memset(&
cls.capturevideo, 0,
sizeof(
cls.capturevideo));
1070 cls.capturevideo.active =
true;
1071 cls.capturevideo.framerate =
bound(1, cl_capturevideo_fps.
value, 1001) *
bound(1, cl_capturevideo_framestep.
integer, 64);
1072 cls.capturevideo.framestep = cl_capturevideo_framestep.
integer;
1076 cls.capturevideo.frame =
cls.capturevideo.lastfpsframe = 0;
1078 cls.capturevideo.soundsampleframe = 0;
1079 cls.capturevideo.realtime = cl_capturevideo_realtime.
integer != 0;
1082 dpsnprintf(
cls.capturevideo.basename,
sizeof(
cls.capturevideo.basename),
"video/%s%03i", timestring, cl_capturevideo_number.
integer);
1113 for (
i = 0;
i < 256 * 3;
i++)
1114 cls.capturevideo.vidramp[
i] = (
unsigned short) (0.5 +
pow(
cls.capturevideo.vidramp[
i] * (1.0 / 65535.0), igamma) * 65535.0);
1117 for (
i = 0;
i < 256;
i++)
1119 r = 255*
cls.capturevideo.vidramp[
i]/65535.0;
1120 g = 255*
cls.capturevideo.vidramp[
i+256]/65535.0;
1121 b = 255*
cls.capturevideo.vidramp[
i+512]/65535.0;
1124 cls.capturevideo.rgbtoyuvscaletable[0][0][
i] = (short)(
r * 0.299);
1125 cls.capturevideo.rgbtoyuvscaletable[0][1][
i] = (short)(
g * 0.587);
1126 cls.capturevideo.rgbtoyuvscaletable[0][2][
i] = (short)(
b * 0.114);
1128 cls.capturevideo.rgbtoyuvscaletable[1][0][
i] = (short)(
r * -0.169);
1129 cls.capturevideo.rgbtoyuvscaletable[1][1][
i] = (short)(
g * -0.332);
1130 cls.capturevideo.rgbtoyuvscaletable[1][2][
i] = (short)(
b * 0.500);
1132 cls.capturevideo.rgbtoyuvscaletable[2][0][
i] = (short)(
r * 0.500);
1133 cls.capturevideo.rgbtoyuvscaletable[2][1][
i] = (short)(
g * -0.419);
1134 cls.capturevideo.rgbtoyuvscaletable[2][2][
i] = (short)(
b * -0.0813);
1136 cls.capturevideo.yuvnormalizetable[0][
i] = 16 +
i * (236-16) / 256;
1137 cls.capturevideo.yuvnormalizetable[1][
i] = 16 +
i * (240-16) / 256;
1138 cls.capturevideo.yuvnormalizetable[2][
i] = 16 +
i * (240-16) / 256;
1143 if (cl_capturevideo_ogg.
integer)
1151 Con_Print(
"cl_capturevideo_ogg: libraries not available. Capturing in AVI instead.\n");
1157void SCR_CaptureVideo_EndVideo(
void)
1159 if (!
cls.capturevideo.active)
1161 cls.capturevideo.active =
false;
1164 Con_Printf(
"Finishing capture of %s.%s (%d frames, %d audio frames)\n",
cls.capturevideo.basename,
cls.capturevideo.formatextension,
cls.capturevideo.frame,
cls.capturevideo.soundsampleframe);
1168 if (
cls.capturevideo.videofile)
1169 cls.capturevideo.writeEndVideo();
1171 if (
cls.capturevideo.outbuffer)
1174 cls.capturevideo.outbuffer =
NULL;
1182 memset(&
cls.capturevideo, 0,
sizeof(
cls.capturevideo));
1191static void SCR_CaptureVideo(
void)
1194 int newframestepframenum;
1198 if (!
cls.capturevideo.active)
1199 SCR_CaptureVideo_BeginVideo();
1200 if (
cls.capturevideo.error)
1204 SCR_CaptureVideo_EndVideo();
1208 if (
cls.capturevideo.framerate != cl_capturevideo_fps.
value * cl_capturevideo_framestep.
integer)
1210 Con_Printf(
CON_WARN "You can not change the video framerate while recording a video.\n");
1214 if (
cls.capturevideo.soundrate && !
cls.capturevideo.soundsampleframe)
1216 if (
cls.capturevideo.realtime)
1222 newframenum =
cls.capturevideo.frame + 1;
1224 if (newframenum -
cls.capturevideo.frame > 60 * (
int)
ceil(
cls.capturevideo.framerate))
1227 Con_Printf(
CON_ERROR "video saving failed on frame %i, your machine is too slow for this capture speed.\n",
cls.capturevideo.frame);
1228 SCR_CaptureVideo_EndVideo();
1232 newframestepframenum = newframenum /
cls.capturevideo.framestep;
1233 if (newframestepframenum !=
cls.capturevideo.framestepframe)
1235 cls.capturevideo.framestepframe = newframestepframenum;
1239 double fps1 = (
cls.capturevideo.frame -
cls.capturevideo.lastfpsframe) / (
host.
realtime -
cls.capturevideo.lastfpstime + 0.0000001);
1240 double fps = (
cls.capturevideo.frame ) / (
host.
realtime -
cls.capturevideo.starttime + 0.0000001);
1241 Sys_Printf(
"captured %.1fs of video, last second %.3ffps (%.1fx), total %.3ffps (%.1fx)\n",
1242 cls.capturevideo.frame /
cls.capturevideo.framerate,
1243 fps1, fps1 /
cls.capturevideo.framerate,
1244 fps, fps /
cls.capturevideo.framerate);
1246 cls.capturevideo.lastfpsframe =
cls.capturevideo.frame;
1248 cls.capturevideo.frame = newframenum;
1249 if (
cls.capturevideo.error)
1252 Con_Printf(
CON_ERROR "video saving failed on frame %i, out of disk space? stopping video capture.\n",
cls.capturevideo.frame);
1253 SCR_CaptureVideo_EndVideo();
1256 else if (
cls.capturevideo.active)
1257 SCR_CaptureVideo_EndVideo();
1276 {{ 0, 0, 0},
"rt",
false,
false,
false},
1277 {{ 0, 270, 0},
"ft",
false,
false,
false},
1278 {{ 0, 180, 0},
"lf",
false,
false,
false},
1279 {{ 0, 90, 0},
"bk",
false,
false,
false},
1280 {{-90, 180, 0},
"up",
true,
true,
false},
1281 {{ 90, 180, 0},
"dn",
true,
true,
false},
1283 {{ 0, 0, 0},
"px",
true,
true,
true},
1284 {{ 0, 90, 0},
"py",
false,
true,
false},
1285 {{ 0, 180, 0},
"nx",
false,
false,
true},
1286 {{ 0, 270, 0},
"ny",
true,
false,
false},
1287 {{-90, 180, 0},
"pz",
false,
false,
true},
1288 {{ 90, 180, 0},
"nz",
false,
false,
true}
1295 unsigned char *buffer1;
1296 unsigned char *buffer2;
1301 Con_Print(
"envmap <basename> <size>: save out 6 cubic environment map images, usable with loadsky, note that size must one of 128, 256, 512, or 1024 and can't be bigger than your current resolution\n");
1314 Con_Print(
"envmap: size must be one of 128, 256, 512, or 1024\n");
1319 Con_Print(
"envmap: your resolution is not big enough to render that size\n");
1348 for (j = 0;j < 12;j++)
1357 SCR_ScreenShot(filename, buffer1, buffer2, 0,
vid.
mode.
height - (
r_refdef.
view.
y +
r_refdef.
view.
height),
size,
size,
envmapinfo[j].
flipx,
envmapinfo[j].
flipy,
envmapinfo[j].
flipdiagonaly,
false,
false,
false,
false);
1384 char lmplabel[256], picname[256];
1430 DrawQ_Pic(
cl.
showlmps[
i].
x,
cl.
showlmps[
i].
y,
Draw_CachePic_Flags (
cl.
showlmps[
i].
pic,
CACHEPICFLAG_NOTPERSISTENT), 0, 0, 1, 1, 1, 1, 0);
1443qbool SCR_ScreenShot(
char *filename,
unsigned char *buffer1,
unsigned char *buffer2,
int x,
int y,
int width,
int height,
qbool flipx,
qbool flipy,
qbool flipdiagonal,
qbool jpeg,
qbool png,
qbool gammacorrect,
qbool keep_alpha)
1454 unsigned short vidramp[256 * 3];
1461 for (
i = 0;
i < 256 * 3;
i++)
1462 vidramp[
i] = (
unsigned short) (0.5 +
pow(vidramp[
i] * (1.0 / 65535.0), igamma) * 65535.0);
1466 buffer1[
i] = (
unsigned char) (vidramp[buffer1[
i] + 512] * 255.0 / 65535.0 + 0.5);
1467 buffer1[
i+1] = (
unsigned char) (vidramp[buffer1[
i+1] + 256] * 255.0 / 65535.0 + 0.5);
1468 buffer1[
i+2] = (
unsigned char) (vidramp[buffer1[
i+2]] * 255.0 / 65535.0 + 0.5);
1473 if(keep_alpha && !jpeg)
1526 if (
a->text &&
a->text[0])
1529 DrawQ_String(
a->rect[0] + (
a->rect[2] - textwidth) * 0.5f,
a->rect[1] + (
a->rect[3] -
a->textheight) * 0.5f,
a->text, 0,
a->textheight,
a->textheight, 1.0f, 1.0f, 1.0f,
vid_touchscreen_overlayalpha.
value, 0,
NULL,
false,
FONT_CHAT);
1536 float clearcolor[4];
1539 Vector4Set(clearcolor, 0.0f, 0.0f, 0.0f, 0.0f);
1542 Vector4Set(clearcolor, 0.0f, 0.0f, 0.0f, 1.0f);
1557typedef struct loadingscreenstack_s
1696 while (*t && *t !=
' ')
1703 unsigned char *buffer1;
1704 unsigned char *buffer2;
1708 SCR_ScreenShot(filename, buffer1, buffer2, 0, 0,
vid.
mode.
width,
vid.
mode.
height,
false,
false,
false,
false,
false,
true,
false);
1797 float loadingscreentexture_w;
1798 float loadingscreentexture_h;
1803 loadingscreentexture_w = loadingscreentexture_h = 1;
1845 dummy_status.
msg[0] =
'\0';
1905 Con_DPrintf(
"Popping a loading screen item from an empty stack!\n");
1941 DrawQ_String(
x,
y, s->
msg, len,
size,
size, 1, 1, 1, 1, 0,
NULL,
true,
FONT_INFOBAR);
1951 DrawQ_String(
x,
y, s->
msg, len,
size,
size, 1, 1, 1, 1, 0,
NULL,
true,
FONT_INFOBAR);
1972 verts[2] = verts[5] = verts[8] = verts[11] = 0;
1973 verts[0] = verts[9] = 0;
1979#define sscanf sscanf_s
1981 colors[0] = 0; colors[1] = 0; colors[2] = 0; colors[3] = 1;
1982 colors[4] = 0; colors[5] = 0; colors[6] = 0; colors[7] = 1;
1994 cachepic_t *loadingscreenpic;
1995 float loadingscreenpic_vertex3f[12];
1996 float loadingscreenpic_texcoord2f[8];
1997 float x,
y,
w, h,
sw, sh,
f;
2055 loadingscreenpic_vertex3f[2] = loadingscreenpic_vertex3f[5] = loadingscreenpic_vertex3f[8] = loadingscreenpic_vertex3f[11] = 0;
2056 loadingscreenpic_vertex3f[0] = loadingscreenpic_vertex3f[9] =
x;
2057 loadingscreenpic_vertex3f[1] = loadingscreenpic_vertex3f[4] =
y;
2058 loadingscreenpic_vertex3f[3] = loadingscreenpic_vertex3f[6] =
x +
w;
2059 loadingscreenpic_vertex3f[7] = loadingscreenpic_vertex3f[10] =
y + h;
2060 loadingscreenpic_texcoord2f[0] = 0;loadingscreenpic_texcoord2f[1] = 0;
2061 loadingscreenpic_texcoord2f[2] = 1;loadingscreenpic_texcoord2f[3] = 0;
2062 loadingscreenpic_texcoord2f[4] = 1;loadingscreenpic_texcoord2f[5] = 1;
2063 loadingscreenpic_texcoord2f[6] = 0;loadingscreenpic_texcoord2f[7] = 1;
2132 static double cl_updatescreen_quality = 1;
2135 static double drawscreenstart = 0.0;
2136 double drawscreendelta;
2145#ifdef CONFIG_VIDEO_CAPTURE
2152 double actualframetime;
2153 double targetframetime;
2170 adjust = (targetframetime - actualframetime) *
f;
2174 adjust =
max(0, adjust - h);
2205 cl_updatescreen_quality += adjust;
2210 cl_updatescreen_quality = 1;
2235#ifdef CONFIG_VIDEO_CAPTURE
2252 static double lastupdate;
2278 R_Viewport_InitOrtho(&viewport, &
identitymatrix, 0, 0,
vid.
mode.
width,
vid.
mode.
height, 0, 0,
vid_conwidth.
integer,
vid_conheight.
integer, -10, 100,
NULL);
2294 Con_Print(
"FIXME: scr_stipple not implemented\n");
2338#ifdef CONFIG_VIDEO_CAPTURE
void SCR_CaptureVideo_Avi_BeginVideo(void)
void SCR_CaptureVideo_Ogg_Init(void)
void SCR_CaptureVideo_Ogg_BeginVideo(void)
qbool SCR_CaptureVideo_Ogg_Available(void)
void CL_MeshEntities_Scene_FinalizeRenderEntity(void)
void CL_UpdateEntityShading(void)
char scr_infobarstring[MAX_INPUTLINE]
rtexturepool_t * r_main_texturepool
static void R_Envmap_f(cmd_state_t *cmd)
void CL_Screen_NewMap(void)
static void SCR_DrawScreen(void)
cvar_t cl_minfps_qualitystepmax
void SCR_BeginLoadingPlaque(qbool startup)
cvar_t cl_minfps_qualitymin
unsigned int scr_con_current
int cl_punchangle_applied
static void SCR_ClearLoadingScreenTexture(void)
float scr_centertime_start
cvar_t scr_loadingscreen_barcolor
static void SCR_UpdateVars(void)
void SCR_CenterPrint(const char *str)
cvar_t v_isometric_verticalfov
static void SCR_DrawLoadingStack(void)
cvar_t scr_loadingscreen_scale
qbool R_Stereo_ColorMasking(void)
void R_ClearScreen(qbool fogcolor)
struct envmapinfo_s envmapinfo[12]
static void SCR_ChooseLoadingPic(qbool startup)
cvar_t scr_loadingscreen_background
cvar_t scr_screenshot_name_in_mapdir
cvar_t scr_loadingscreen_picture
qbool R_Stereo_Active(void)
static void SCR_DrawBrand(void)
cvar_t scr_screenshot_timestamp
static void SCR_DrawInfobar(void)
cvar_t r_stereo_separation
void SCR_EndLoadingPlaque(void)
static void SCR_ScreenShot_f(cmd_state_t *cmd)
static void SCR_DrawTurtle(void)
void CL_Screen_Init(void)
cvar_t cl_minfps_qualitymax
static float loadingscreentexture_texcoord2f[8]
static void SCR_SizeDown_f(cmd_state_t *cmd)
static unsigned int scr_con_margin_bottom
void SHOWLMP_decodehide(void)
static void SCR_DrawNetGraph(void)
static float loadingscreentexture_vertex3f[12]
void SCR_PopLoadingScreen(qbool redraw)
void CL_UpdateScreen(void)
cvar_t scr_loadingscreen_scale_base
cvar_t scr_loadingscreen_barheight
cvar_t scr_conforcewhiledisconnected
static void SCR_SetLoadingScreenTexture(void)
void SCR_DrawConsole(void)
void SHOWLMP_decodeshow(void)
cvar_t scr_screenshot_alpha
cvar_t scr_conalphafactor
cvar_t scr_screenshot_jpeg
void SCR_PushLoadingScreen(const char *msg, float len_in_parent)
static void SCR_CheckDrawCenterString(void)
float scr_infobartime_off
static int SCR_InfobarHeight(void)
int scr_numtouchscreenareas
void SCR_ClearLoadingScreen(qbool redraw)
cvar_t vid_touchscreen_outlinealpha
static void SCR_DrawLoadingScreen(void)
cvar_t scr_loadingscreen_count
cvar_t scr_infobar_height
static int SCR_DrawQWDownload(int offset)
void SHOWLMP_drawall(void)
void CL_Screen_Shutdown(void)
static void SCR_DrawNet(void)
char scr_centerstring[MAX_INPUTLINE]
cvar_t scr_conalpha2factor
static void SCR_SetUpToDrawConsole(void)
cvar_t scr_screenshot_gammaboost
qbool SCR_ScreenShot(char *filename, unsigned char *buffer1, unsigned char *buffer2, int x, int y, int width, int height, qbool flipx, qbool flipy, qbool flipdiagonal, qbool jpeg, qbool png, qbool gammacorrect, qbool keep_alpha)
static float SCR_DrawLoadingStack_r(loadingscreenstack_t *s, float y, float size)
scr_touchscreenarea_t scr_touchscreenareas[128]
cvar_t scr_conalpha3factor
static void SCR_InfoBar_f(cmd_state_t *cmd)
void SCR_DeferLoadingPlaque(qbool startup)
static int SCR_DrawInfobarString(int offset)
rtexture_t * loadingscreentexture
static void SCR_DrawTouchscreenOverlay(void)
char cl_connect_status[MAX_QPATH]
User-friendly connection status for the menu and/or loading screen, colours and not supported.
cvar_t r_stereo_sidebyside
cvar_t vid_touchscreen_overlayalpha
cvar_t scr_screenshot_jpeg_quality
cvar_t scr_loadingscreen_maxfps
cvar_t scr_loadingscreen_firstforstartup
static loadingscreenstack_t * loadingscreenstack
cvar_t scr_loadingscreen_scale_limit
cvar_t timedemo_screenshotframelist
static void SCR_DrawNetGraph_DrawGraph(int graphx, int graphy, int graphwidth, int graphheight, float graphscale, int graphlimit, const char *label, float textsize, int packetcounter, netgraphitem_t *netgraph)
static void SCR_DrawPause(void)
static void SCR_SizeUp_f(cmd_state_t *cmd)
cvar_t cl_minfps_qualityhysteresis
static void SCR_DrawCenterString(void)
static int loadingscreenpic_number
cvar_t cl_minfps_qualitymultiply
cvar_t r_stereo_horizontal
static int SCR_DrawCurlDownload(int offset)
cvar_t scr_screenshot_png
static void SCR_Centerprint_f(cmd_state_t *cmd)
struct cvar_s scr_screenshot_name
void Cmd_AddCommand(unsigned flags, const char *cmd_name, xcommand_t function, const char *description)
called by the init functions of other parts of the program to register commands and functions to call...
#define CF_READONLY
cvar cannot be changed from the console or the command buffer, and is considered CF_PERSISTENT
static int Cmd_Argc(cmd_state_t *cmd)
static const char * Cmd_Argv(cmd_state_t *cmd, int arg)
Cmd_Argv(cmd, ) will return an empty string (not a NULL) if arg > argc, so string operations are alwa...
#define CF_CLIENT
cvar/command that only the client can change/execute
#define CF_ARCHIVE
cvar should have its set value saved to config.cfg and persist across sessions
#define IS_NEXUIZ_DERIVED(g)
char * MSG_ReadString(sizebuf_t *sb, char *string, size_t maxstring)
char * va(char *buf, size_t buflen, const char *format,...)
int dpsnprintf(char *buffer, size_t buffersize, const char *format,...)
Returns the number of printed characters, excluding the final '\0' or returns -1 if the buffer isn't ...
@ PROTOCOL_QUAKEWORLD
quakeworld protocol
#define dp_strlcat(dst, src, dsize)
#define dp_strlcpy(dst, src, dsize)
void Con_CenterPrint(const char *str)
Prints a center-aligned message to the console.
void Con_Print(const char *msg)
Prints to all appropriate console targets, and adds timestamps.
void Con_DPrintf(const char *fmt,...)
A Con_Printf that only shows up if the "developer" cvar is set.
void Con_DrawNotify(void)
void Con_Printf(const char *fmt,...)
Prints to all appropriate console targets.
void Con_DrawConsole(int lines, qbool forcedfullscreen)
void Con_CheckResize(void)
If the line width has changed, reformat the buffer.
void CL_VM_DrawHud(double frametime)
qbool CL_VM_UpdateView(double frametime)
void Cvar_SetValueQuick(cvar_t *var, float value)
void Cvar_SetQuick(cvar_t *var, const char *value)
void Cvar_RegisterVariable(cvar_t *variable)
registers a cvar that already has the name, string, and optionally the archive elements set.
void Cvar_RegisterVirtual(cvar_t *variable, const char *name)
cachepic_t * Draw_CachePic(const char *path)
@ CACHEPICFLAG_FAILONMISSING
@ CACHEPICFLAG_NOTPERSISTENT
void DrawQ_Fill(float x, float y, float width, float height, float red, float green, float blue, float alpha, int flags)
void DrawQ_Pic(float x, float y, cachepic_t *pic, float width, float height, float red, float green, float blue, float alpha, int flags)
float DrawQ_String(float x, float y, const char *text, size_t maxlen, float scalex, float scaley, float basered, float basegreen, float baseblue, float basealpha, int flags, int *outcolor, qbool ignorecolorcodes, const dp_font_t *fnt)
void DrawQ_Line(float width, float x1, float y1, float x2, float y2, float r, float g, float b, float alpha, int flags)
cachepic_t * Draw_CachePic_Flags(const char *path, unsigned int cachepicflags)
int Draw_GetPicWidth(cachepic_t *pic)
float DrawQ_TextWidth(const char *text, size_t maxlen, float w, float h, qbool ignorecolorcodes, const dp_font_t *fnt)
rtexture_t * Draw_GetPicTexture(cachepic_t *pic)
int Draw_GetPicHeight(cachepic_t *pic)
qbool Draw_IsPicLoaded(cachepic_t *pic)
const char * FS_FileExtension(const char *in)
char fs_gamedir[MAX_OSPATH]
static int(ZEXPORT *qz_inflate)(z_stream *strm
qbool FS_SysFileExists(const char *path)
Look for a file in the filesystem only.
void GL_Clear(int mask, const float *colorvalue, float depthvalue, int stencilvalue)
void R_Mesh_CopyToTexture(rtexture_t *tex, int tx, int ty, int sx, int sy, int width, int height)
void GL_ColorMask(int r, int g, int b, int a)
unsigned short polygonelement3s[(POLYGONELEMENTS_MAXPOINTS-2) *3]
void GL_DepthMask(int state)
void GL_ReadPixelsBGRA(int x, int y, int width, int height, unsigned char *outpixels)
int polygonelement3i[(POLYGONELEMENTS_MAXPOINTS-2) *3]
void R_Mesh_Draw(int firstvertex, int numvertices, int firsttriangle, int numtriangles, const int *element3i, const r_meshbuffer_t *element3i_indexbuffer, int element3i_bufferoffset, const unsigned short *element3s, const r_meshbuffer_t *element3s_indexbuffer, int element3s_bufferoffset)
void GL_DepthTest(int state)
void GL_DepthRange(float nearfrac, float farfrac)
void R_Mesh_SetRenderTargets(int fbo)
void GL_PolygonOffset(float planeoffset, float depthoffset)
void R_SetViewport(const r_viewport_t *v)
void R_Viewport_InitOrtho(r_viewport_t *v, const matrix4x4_t *cameramatrix, int x, int y, int width, int height, float x1, float y1, float x2, float y2, float nearclip, float farclip, const float *nearplane)
void GL_Color(float cr, float cg, float cb, float ca)
void GL_BlendFunc(int blendfunc1, int blendfunc2)
void R_Mesh_PrepareVertices_Generic_Arrays(int numvertices, const float *vertex3f, const float *color4f, const float *texcoord2f)
void GL_ScissorTest(int state)
void GL_CaptureVideo_BeginVideo(void)
void GL_CaptureVideo_EndVideo(void)
void GL_CaptureVideo_VideoFrame(int newframestepframenum)
void R_SetupShader_Generic_NoTexture(qbool usegamma, qbool notrippy)
void R_RenderView(int fbo, rtexture_t *depthtexture, rtexture_t *colortexture, int x, int y, int width, int height)
r_rendertarget_t * R_RenderTarget_Get(int texturewidth, int textureheight, textype_t depthtextype, qbool depthisrenderbuffer, textype_t colortextype0, textype_t colortextype1, textype_t colortextype2, textype_t colortextype3)
void R_SetupShader_Generic(rtexture_t *t, qbool usegamma, qbool notrippy, qbool suppresstexalpha)
void R_BufferData_NewFrame(void)
begin a new frame (recycle old buffers)
void R_HDR_UpdateIrisAdaptation(const vec3_t point)
void R_UpdateVariables(void)
void R_RenderTarget_FreeUnused(qbool force)
void R_FrameData_NewFrame(void)
prepare for a new frame, recycles old buffers if a resize occurred previously
void R_FreeTexture(rtexture_t *rt)
rtexture_t * R_LoadTexture2D(rtexturepool_t *rtexturepool, const char *identifier, int width, int height, const unsigned char *data, textype_t textype, int flags, int miplevel, const unsigned int *palette)
GLenum GLsizei GLsizei height
GLubyte GLubyte GLubyte GLubyte w
GLenum GLuint GLenum GLsizei length
GLenum GLenum GLsizei count
GLint GLenum GLint GLint y
#define GL_COLOR_BUFFER_BIT
GLsizei GLenum const GLvoid * indices
GLuint GLuint GLintptr offset
#define GL_ONE_MINUS_SRC_ALPHA
#define GL_STENCIL_BUFFER_BIT
#define GL_DEPTH_BUFFER_BIT
@ host_shutdown
states >= host_shutdown cause graceful shutdown, see Sys_HandleCrash() comments
qbool Image_WriteTGABGR_preflipped(const char *filename, int width, int height, const unsigned char *data)
void Image_CopyMux(unsigned char *outpixels, const unsigned char *inpixels, int inputwidth, int inputheight, qbool inputflipx, qbool inputflipy, qbool inputflipdiagonal, int numoutputcomponents, int numinputcomponents, int *outputinputcomponentindices)
qbool Image_WriteTGABGRA(const char *filename, int width, int height, const unsigned char *data)
qbool PNG_SaveImage_preflipped(const char *filename, int width, int height, qbool has_alpha, unsigned char *data)
qbool JPEG_SaveImage_preflipped(const char *filename, int width, int height, unsigned char *data)
#define KEY_CONSOLEACTIVE_USER
#define KEY_CONSOLEACTIVE_FORCED
Curl_downloadinfo_t * Curl_GetDownloadInfo(int *nDownloads, const char **additional_info, char *addinfo, size_t addinfolength)
#define bound(min, num, max)
#define Vector4Set(vec, r, g, b, a)
#define VectorCopy(in, out)
void Matrix4x4_CreateFromQuakeEntity(matrix4x4_t *out, double x, double y, double z, double pitch, double yaw, double roll, double scale)
const matrix4x4_t identitymatrix
void Matrix4x4_OriginFromMatrix(const matrix4x4_t *in, float *out)
char cl_readstring[MAX_INPUTLINE]
#define NETGRAPH_CHOKEDPACKET
#define NETGRAPH_LOSTPACKET
unsigned char palette_rgb_pantscolormap[16][3]
unsigned char palette_rgb_pantsscoreboard[16][3]
unsigned char palette_rgb_shirtcolormap[16][3]
unsigned char palette_rgb_shirtscoreboard[16][3]
void BuildGammaTable16(float prescale, float gamma, float scale, float base, float contrastboost, unsigned short *out, int rampsize)
#define MAX_INPUTLINE
maximum size of console commandline, QuakeC strings, and many other text processing buffers
#define MAX_QPATH
max length of a quake game pathname
void R_Shadow_EditLights_DrawSelectedLightProperties(void)
cvar_t r_speeds_graph_maxtimedelta
cvar_t r_speeds_graph_length
cvar_t r_speeds_graph_maxdefault
cvar_t r_speeds_graph_filter[8]
void R_TimeReport(const char *desc)
cvar_t r_speeds_graph_width
cvar_t r_speeds_graph_height
cvar_t r_speeds_graph_seconds
void R_TimeReport_BeginFrame(void)
void R_TimeReport_EndFrame(void)
#define TEXF_FORCENEAREST
@ TEXTYPE_DEPTHBUFFER24STENCIL8
#define TEXF_RENDERTARGET
void Sbar_Draw(void)
called every frame by screen
int sb_lines
scan lines to draw
void Sbar_ShowFPS_Update(void)
void SCR_CaptureVideo_SoundFrame(const struct portable_samplepair_s *paintbuffer, size_t length)
server_static_t svs
persistant server info
int S_GetSoundChannels(void)
static portable_sampleframe_t paintbuffer[PAINTBUFFER_SIZE]
float last_received_message
char worldbasename[MAX_QPATH]
int qw_downloadspeedcount
int qw_downloadmemorymaxsize
int qw_downloadmemorycursize
double qw_downloadspeedtime
protocolversion_t protocol
char qw_downloadname[MAX_QPATH]
command interpreter state - the tokenizing and execution of commands, as well as pointers to which cv...
qbool restless
don't sleep
double realtime
the accumulated mainloop time since application started (with filtering), without any slowmo or clamp...
qbool paused
global paused state, pauses both client and server
float absolute_loading_amount_min
float absolute_loading_amount_len
float relative_completion
struct loadingscreenstack_s * prev
int incoming_packetcounter
int outgoing_packetcounter
netgraphitem_t incoming_netgraph[NETGRAPH_PACKETS]
netgraphitem_t outgoing_netgraph[NETGRAPH_PACKETS]
exported for capturevideo so ogg can see all channels
double lastdrawscreentime
qbool clear
whether to call R_ClearScreen before rendering stuff
float quality
render quality (0 to 1) - affects r_drawparticles_drawdistance and others
int useperspective
if turned off it renders an ortho view
qbool isoverlay
if true, don't clear or do any post process effects (bloom, etc)
qbool ismain
if true, this is the MAIN view (which is, after CSQC, copied into the scene for use e....
int colormask[4]
which color components to allow (for anaglyph glasses)
rtexture_t * depthtexture
rtexture_t * colortexture[4]
struct client_s * clients
client slots
int maxclients
number of svs.clients slots (updated by maxplayers command)
qbool active
false if only a net client
viddef_mode_t mode
currently active video mode
size_t Sys_TimeString(char buf[], size_t bufsize, const char *timeformat)
void Sys_Printf(const char *fmt,...)
used to report failures inside Con_Printf()
double Sys_DirtyTime(void)
int Sys_CheckParm(const char *parm)
viddef_t vid
global video state
#define Mem_Alloc(pool, size)