DarkPlaces
Game engine based on the Quake 1 engine by id Software, developed by LadyHavoc
 
screen.h File Reference
#include <stddef.h>
#include "qtypes.h"
+ Include dependency graph for screen.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  scr_touchscreenarea_t
 

Functions

void CL_Screen_Init (void)
 
void CL_UpdateScreen (void)
 
qbool R_Stereo_Active (void)
 
void SCR_BeginLoadingPlaque (qbool startup)
 
void SCR_CaptureVideo_SoundFrame (const struct portable_samplepair_s *paintbuffer, size_t length)
 
void SCR_CenterPrint (const char *str)
 
void SCR_ClearLoadingScreen (qbool redraw)
 
void SCR_DeferLoadingPlaque (qbool startup)
 
void SCR_EndLoadingPlaque (void)
 
void SCR_PopLoadingScreen (qbool redraw)
 
void SCR_PushLoadingScreen (const char *msg, float len_in_parent)
 

Variables

struct cvar_s cl_showdate
 
struct cvar_s cl_showfps
 
struct cvar_s cl_showtime
 
struct cvar_s crosshair
 
struct cvar_s crosshair_size
 
struct cvar_s r_letterbox
 
struct cvar_s r_stereo_angle
 
struct cvar_s r_stereo_separation
 
int r_stereo_side
 
int sb_lines
 scan lines to draw
 
unsigned int scr_con_current
 
struct cvar_s scr_conalpha
 
struct cvar_s scr_conalpha2factor
 
struct cvar_s scr_conalpha3factor
 
struct cvar_s scr_conalphafactor
 
struct cvar_s scr_conbrightness
 
struct cvar_s scr_conscroll2_x
 
struct cvar_s scr_conscroll2_y
 
struct cvar_s scr_conscroll3_x
 
struct cvar_s scr_conscroll3_y
 
struct cvar_s scr_conscroll_x
 
struct cvar_s scr_conscroll_y
 
struct cvar_s scr_fov
 
int scr_numtouchscreenareas
 
struct cvar_s scr_refresh
 
struct cvar_s scr_stipple
 
scr_touchscreenarea_t scr_touchscreenareas [128]
 
struct cvar_s scr_viewsize
 

Function Documentation

◆ CL_Screen_Init()

void CL_Screen_Init ( void )

Definition at line 804 of file cl_screen.c.

805{
806 int i;
822#ifdef CONFIG_MENU
823 Cvar_RegisterVariable (&scr_menuforcewhiledisconnected);
824#endif
854#ifdef CONFIG_VIDEO_CAPTURE
855 Cvar_RegisterVariable (&cl_capturevideo);
856 Cvar_RegisterVariable (&cl_capturevideo_demo_stop);
857 Cvar_RegisterVariable (&cl_capturevideo_printfps);
858 Cvar_RegisterVariable (&cl_capturevideo_width);
859 Cvar_RegisterVariable (&cl_capturevideo_height);
860 Cvar_RegisterVariable (&cl_capturevideo_realtime);
861 Cvar_RegisterVariable (&cl_capturevideo_fps);
862 Cvar_RegisterVariable (&cl_capturevideo_nameformat);
863 Cvar_RegisterVariable (&cl_capturevideo_number);
864 Cvar_RegisterVariable (&cl_capturevideo_ogg);
865 Cvar_RegisterVariable (&cl_capturevideo_framestep);
866#endif
879 Cvar_RegisterVirtual(&net_graph, "shownetgraph");
885 for (i = 0;i < (int)(sizeof(r_speeds_graph_filter)/sizeof(r_speeds_graph_filter[0]));i++)
895
896 // if we want no console, turn it off here too
897 if (Sys_CheckParm ("-noconsole"))
899
900 Cmd_AddCommand(CF_CLIENT, "cprint", SCR_Centerprint_f, "print something at the screen center");
901 Cmd_AddCommand(CF_CLIENT, "sizeup",SCR_SizeUp_f, "increase view size (increases viewsize cvar)");
902 Cmd_AddCommand(CF_CLIENT, "sizedown",SCR_SizeDown_f, "decrease view size (decreases viewsize cvar)");
903 Cmd_AddCommand(CF_CLIENT, "screenshot",SCR_ScreenShot_f, "takes a screenshot of the next rendered frame");
904 Cmd_AddCommand(CF_CLIENT, "envmap", R_Envmap_f, "render a cubemap (skybox) of the current scene");
905 Cmd_AddCommand(CF_CLIENT, "infobar", SCR_InfoBar_f, "display a text in the infobar (usage: infobar expiretime string)");
906
907#ifdef CONFIG_VIDEO_CAPTURE
909#endif
910
911 scr_initialized = true;
912}
void SCR_CaptureVideo_Ogg_Init(void)
Definition cap_ogg.c:577
cvar_t r_stereo_redcyan
Definition cl_screen.c:85
static void R_Envmap_f(cmd_state_t *cmd)
Definition cl_screen.c:1291
cvar_t scr_conscroll2_y
Definition cl_screen.c:31
qbool scr_initialized
Definition cl_screen.c:102
cvar_t r_stereo_angle
Definition cl_screen.c:87
cvar_t scr_loadingscreen_barcolor
Definition cl_screen.c:50
cvar_t r_stereo_redgreen
Definition cl_screen.c:86
cvar_t scr_loadingscreen_scale
Definition cl_screen.c:44
cvar_t scr_loadingscreen_background
Definition cl_screen.c:43
cvar_t scr_screenshot_name_in_mapdir
Definition cl_screen.c:90
cvar_t scr_loadingscreen_picture
Definition cl_screen.c:47
cvar_t scr_screenshot_timestamp
Definition cl_screen.c:64
cvar_t r_stereo_separation
Definition cl_screen.c:80
cvar_t scr_conbrightness
Definition cl_screen.c:25
cvar_t r_stereo_redblue
Definition cl_screen.c:84
static void SCR_ScreenShot_f(cmd_state_t *cmd)
Definition cl_screen.c:919
cvar_t scr_conscroll2_x
Definition cl_screen.c:30
cvar_t scr_fov
Definition cl_screen.c:20
cvar_t scr_stipple
Definition cl_screen.c:88
cvar_t scr_refresh
Definition cl_screen.c:89
static void SCR_SizeDown_f(cmd_state_t *cmd)
Definition cl_screen.c:789
cvar_t scr_loadingscreen_scale_base
Definition cl_screen.c:45
cvar_t scr_centertime
Definition cl_screen.c:37
cvar_t scr_conscroll3_y
Definition cl_screen.c:33
cvar_t scr_loadingscreen_barheight
Definition cl_screen.c:51
cvar_t scr_conforcewhiledisconnected
Definition cl_screen.c:26
cvar_t scr_screenshot_alpha
Definition cl_screen.c:63
cvar_t scr_conalphafactor
Definition cl_screen.c:22
cvar_t scr_screenshot_jpeg
Definition cl_screen.c:59
cvar_t cl_demo_mousegrab
Definition cl_screen.c:92
cvar_t scr_conalpha
Definition cl_screen.c:21
cvar_t scr_showturtle
Definition cl_screen.c:39
cvar_t vid_touchscreen_outlinealpha
Definition cl_screen.c:94
cvar_t scr_viewsize
Definition cl_screen.c:19
cvar_t scr_loadingscreen_count
Definition cl_screen.c:48
cvar_t vid_conwidthauto
Definition cl_screen.c:55
cvar_t r_letterbox
Definition cl_screen.c:79
cvar_t scr_infobar_height
Definition cl_screen.c:53
cvar_t vid_pixelheight
Definition cl_screen.c:58
cvar_t scr_conheight
Definition cl_screen.c:27
cvar_t scr_conscroll_x
Definition cl_screen.c:28
cvar_t net_graph
Definition cl_screen.c:91
cvar_t scr_conscroll3_x
Definition cl_screen.c:32
cvar_t scr_conalpha2factor
Definition cl_screen.c:23
cvar_t scr_conscroll_y
Definition cl_screen.c:29
cvar_t scr_sbarscale
Definition cl_screen.c:54
cvar_t scr_showpause
Definition cl_screen.c:40
cvar_t scr_screenshot_gammaboost
Definition cl_screen.c:62
cvar_t r_stereo_vertical
Definition cl_screen.c:83
cvar_t scr_conalpha3factor
Definition cl_screen.c:24
cvar_t vid_conheight
Definition cl_screen.c:57
static void SCR_InfoBar_f(cmd_state_t *cmd)
Definition cl_screen.c:692
cvar_t scr_printspeed
Definition cl_screen.c:42
cvar_t r_stereo_sidebyside
Definition cl_screen.c:81
cvar_t vid_touchscreen_overlayalpha
Definition cl_screen.c:95
cvar_t scr_screenshot_jpeg_quality
Definition cl_screen.c:60
cvar_t scr_loadingscreen_maxfps
Definition cl_screen.c:52
cvar_t scr_loadingscreen_firstforstartup
Definition cl_screen.c:49
cvar_t vid_conwidth
Definition cl_screen.c:56
cvar_t scr_loadingscreen_scale_limit
Definition cl_screen.c:46
cvar_t timedemo_screenshotframelist
Definition cl_screen.c:93
cvar_t scr_showbrand
Definition cl_screen.c:41
static void SCR_SizeUp_f(cmd_state_t *cmd)
Definition cl_screen.c:776
cvar_t r_stereo_horizontal
Definition cl_screen.c:82
cvar_t scr_showram
Definition cl_screen.c:38
cvar_t scr_screenshot_png
Definition cl_screen.c:61
static void SCR_Centerprint_f(cmd_state_t *cmd)
Definition cl_screen.c:175
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...
Definition cmd.c:1661
#define CF_CLIENT
cvar/command that only the client can change/execute
Definition cmd.h:48
void Cvar_SetQuick(cvar_t *var, const char *value)
Definition cvar.c:436
void Cvar_RegisterVariable(cvar_t *variable)
registers a cvar that already has the name, string, and optionally the archive elements set.
Definition cvar.c:599
void Cvar_RegisterVirtual(cvar_t *variable, const char *name)
Definition cvar.c:513
static int(ZEXPORT *qz_inflate)(z_stream *strm
int i
cvar_t r_speeds_graph_maxtimedelta
Definition r_stats.c:22
cvar_t r_speeds_graph_length
Definition r_stats.c:16
cvar_t r_speeds_graph_maxdefault
Definition r_stats.c:23
cvar_t r_speeds_graph
Definition r_stats.c:4
cvar_t r_speeds_graph_filter[8]
Definition r_stats.c:5
cvar_t r_speeds_graph_width
Definition r_stats.c:20
cvar_t r_speeds_graph_height
Definition r_stats.c:21
cvar_t r_speeds_graph_seconds
Definition r_stats.c:17
cvar_t r_speeds_graph_y
Definition r_stats.c:19
cvar_t r_speeds_graph_x
Definition r_stats.c:18
int Sys_CheckParm(const char *parm)
Definition sys_shared.c:327

References CF_CLIENT, cl_demo_mousegrab, Cmd_AddCommand(), Cvar_RegisterVariable(), Cvar_RegisterVirtual(), Cvar_SetQuick(), i, int(), net_graph, R_Envmap_f(), r_letterbox, r_speeds_graph, r_speeds_graph_filter, r_speeds_graph_height, r_speeds_graph_length, r_speeds_graph_maxdefault, r_speeds_graph_maxtimedelta, r_speeds_graph_seconds, r_speeds_graph_width, r_speeds_graph_x, r_speeds_graph_y, r_stereo_angle, r_stereo_horizontal, r_stereo_redblue, r_stereo_redcyan, r_stereo_redgreen, r_stereo_separation, r_stereo_sidebyside, r_stereo_vertical, SCR_CaptureVideo_Ogg_Init(), SCR_Centerprint_f(), scr_centertime, scr_conalpha, scr_conalpha2factor, scr_conalpha3factor, scr_conalphafactor, scr_conbrightness, scr_conforcewhiledisconnected, scr_conheight, scr_conscroll2_x, scr_conscroll2_y, scr_conscroll3_x, scr_conscroll3_y, scr_conscroll_x, scr_conscroll_y, scr_fov, SCR_InfoBar_f(), scr_infobar_height, scr_initialized, scr_loadingscreen_background, scr_loadingscreen_barcolor, scr_loadingscreen_barheight, scr_loadingscreen_count, scr_loadingscreen_firstforstartup, scr_loadingscreen_maxfps, scr_loadingscreen_picture, scr_loadingscreen_scale, scr_loadingscreen_scale_base, scr_loadingscreen_scale_limit, scr_printspeed, scr_refresh, scr_sbarscale, scr_screenshot_alpha, SCR_ScreenShot_f(), scr_screenshot_gammaboost, scr_screenshot_jpeg, scr_screenshot_jpeg_quality, scr_screenshot_name_in_mapdir, scr_screenshot_png, scr_screenshot_timestamp, scr_showbrand, scr_showpause, scr_showram, scr_showturtle, SCR_SizeDown_f(), SCR_SizeUp_f(), scr_stipple, scr_viewsize, Sys_CheckParm(), timedemo_screenshotframelist, vid_conheight, vid_conwidth, vid_conwidthauto, vid_pixelheight, vid_touchscreen_outlinealpha, and vid_touchscreen_overlayalpha.

Referenced by CL_Init().

◆ CL_UpdateScreen()

void CL_UpdateScreen ( void )

Definition at line 2130 of file cl_screen.c.

2131{
2132 static double cl_updatescreen_quality = 1;
2133
2134 vec3_t vieworigin;
2135 static double drawscreenstart = 0.0;
2136 double drawscreendelta;
2137 r_viewport_t viewport;
2138
2139 // TODO: Move to a better place.
2141
2142 if(drawscreenstart)
2143 {
2144 drawscreendelta = Sys_DirtyTime() - drawscreenstart;
2145#ifdef CONFIG_VIDEO_CAPTURE
2146 if (cl_minfps.value > 0 && (cl_minfps_force.integer || !(cls.timedemo || (cls.capturevideo.active && !cls.capturevideo.realtime))) && drawscreendelta >= 0 && drawscreendelta < 60)
2147#else
2148 if (cl_minfps.value > 0 && (cl_minfps_force.integer || !cls.timedemo) && drawscreendelta >= 0 && drawscreendelta < 60)
2149#endif
2150 {
2151 // quality adjustment according to render time
2152 double actualframetime;
2153 double targetframetime;
2154 double adjust;
2155 double f;
2156 double h;
2157
2158 // fade lastdrawscreentime
2160
2161 // find actual and target frame times
2162 actualframetime = r_refdef.lastdrawscreentime;
2163 targetframetime = (1.0 / cl_minfps.value);
2164
2165 // we scale hysteresis by quality
2166 h = cl_updatescreen_quality * cl_minfps_qualityhysteresis.value;
2167
2168 // calculate adjustment assuming linearity
2169 f = cl_updatescreen_quality / actualframetime * cl_minfps_qualitymultiply.value;
2170 adjust = (targetframetime - actualframetime) * f;
2171
2172 // one sided hysteresis
2173 if(adjust > 0)
2174 adjust = max(0, adjust - h);
2175
2176 // adjust > 0 if:
2177 // (targetframetime - actualframetime) * f > h
2178 // ((1.0 / cl_minfps.value) - actualframetime) * (cl_updatescreen_quality / actualframetime * cl_minfps_qualitymultiply.value) > (cl_updatescreen_quality * cl_minfps_qualityhysteresis.value)
2179 // ((1.0 / cl_minfps.value) - actualframetime) * (cl_minfps_qualitymultiply.value / actualframetime) > cl_minfps_qualityhysteresis.value
2180 // (1.0 / cl_minfps.value) * (cl_minfps_qualitymultiply.value / actualframetime) - cl_minfps_qualitymultiply.value > cl_minfps_qualityhysteresis.value
2181 // (1.0 / cl_minfps.value) * (cl_minfps_qualitymultiply.value / actualframetime) > cl_minfps_qualityhysteresis.value + cl_minfps_qualitymultiply.value
2182 // (1.0 / cl_minfps.value) / actualframetime > (cl_minfps_qualityhysteresis.value + cl_minfps_qualitymultiply.value) / cl_minfps_qualitymultiply.value
2183 // (1.0 / cl_minfps.value) / actualframetime > 1.0 + cl_minfps_qualityhysteresis.value / cl_minfps_qualitymultiply.value
2184 // cl_minfps.value * actualframetime < 1.0 / (1.0 + cl_minfps_qualityhysteresis.value / cl_minfps_qualitymultiply.value)
2185 // actualframetime < 1.0 / cl_minfps.value / (1.0 + cl_minfps_qualityhysteresis.value / cl_minfps_qualitymultiply.value)
2186 // actualfps > cl_minfps.value * (1.0 + cl_minfps_qualityhysteresis.value / cl_minfps_qualitymultiply.value)
2187
2188 // adjust < 0 if:
2189 // (targetframetime - actualframetime) * f < 0
2190 // ((1.0 / cl_minfps.value) - actualframetime) * (cl_updatescreen_quality / actualframetime * cl_minfps_qualitymultiply.value) < 0
2191 // ((1.0 / cl_minfps.value) - actualframetime) < 0
2192 // -actualframetime) < -(1.0 / cl_minfps.value)
2193 // actualfps < cl_minfps.value
2194
2195 /*
2196 Con_Printf("adjust UP if fps > %f, adjust DOWN if fps < %f\n",
2197 cl_minfps.value * (1.0 + cl_minfps_qualityhysteresis.value / cl_minfps_qualitymultiply.value),
2198 cl_minfps.value);
2199 */
2200
2201 // don't adjust too much at once
2203
2204 // adjust!
2205 cl_updatescreen_quality += adjust;
2206 cl_updatescreen_quality = bound(max(0.01, cl_minfps_qualitymin.value), cl_updatescreen_quality, cl_minfps_qualitymax.value);
2207 }
2208 else
2209 {
2210 cl_updatescreen_quality = 1;
2212 }
2213 }
2214
2215 drawscreenstart = Sys_DirtyTime();
2216
2218
2220 return; // not initialized yet
2221
2223 {
2224 // play a bit with the palette (experimental)
2225 palette_rgb_pantscolormap[15][0] = (unsigned char) (128 + 127 * sin(cl.time / exp(1.0f) + 0.0f*M_PI/3.0f));
2226 palette_rgb_pantscolormap[15][1] = (unsigned char) (128 + 127 * sin(cl.time / exp(1.0f) + 2.0f*M_PI/3.0f));
2227 palette_rgb_pantscolormap[15][2] = (unsigned char) (128 + 127 * sin(cl.time / exp(1.0f) + 4.0f*M_PI/3.0f));
2228 palette_rgb_shirtcolormap[15][0] = (unsigned char) (128 + 127 * sin(cl.time / M_PI + 5.0f*M_PI/3.0f));
2229 palette_rgb_shirtcolormap[15][1] = (unsigned char) (128 + 127 * sin(cl.time / M_PI + 3.0f*M_PI/3.0f));
2230 palette_rgb_shirtcolormap[15][2] = (unsigned char) (128 + 127 * sin(cl.time / M_PI + 1.0f*M_PI/3.0f));
2233 }
2234
2235#ifdef CONFIG_VIDEO_CAPTURE
2236 if (vid_hidden && !cls.capturevideo.active
2237 && !cl_capturevideo.integer) // so we can start capturing while hidden
2238#else
2239 if (vid_hidden)
2240#endif
2241 {
2242 VID_Finish();
2243 return;
2244 }
2245
2246 if (scr_loading)
2247 {
2250 else if (scr_loadingscreen_maxfps.value > 0)
2251 {
2252 static double lastupdate;
2253 if (host.realtime - lastupdate < min(1.0f / scr_loadingscreen_maxfps.value, 0.1))
2254 return;
2255 lastupdate = host.realtime;
2256 }
2257 }
2258
2260
2263
2265 R_HDR_UpdateIrisAdaptation(vieworigin);
2266
2267 r_refdef.view.colormask[0] = 1;
2268 r_refdef.view.colormask[1] = 1;
2269 r_refdef.view.colormask[2] = 1;
2270
2272
2273#ifndef USE_GLES2
2275 qglDrawBuffer(GL_BACK);CHECKGLERROR
2276#endif
2277
2280 R_SetViewport(&viewport);
2281 GL_ScissorTest(false);
2282 GL_ColorMask(1,1,1,1);
2283 GL_DepthMask(true);
2284
2285 R_ClearScreen(false);
2286 r_refdef.view.clear = false;
2287 r_refdef.view.isoverlay = false;
2288
2289 // calculate r_refdef.view.quality
2290 r_refdef.view.quality = cl_updatescreen_quality;
2291
2293 {
2294 Con_Print("FIXME: scr_stipple not implemented\n");
2296 }
2297
2298#ifndef USE_GLES2
2299 if (R_Stereo_Active())
2300 {
2301 r_stereo_side = 0;
2302
2304 {
2305 r_refdef.view.colormask[0] = 1;
2306 r_refdef.view.colormask[1] = 0;
2307 r_refdef.view.colormask[2] = 0;
2308 }
2309
2310 if (vid.mode.stereobuffer)
2311 qglDrawBuffer(GL_BACK_RIGHT);
2312
2314
2315 r_stereo_side = 1;
2316 r_refdef.view.clear = true;
2317
2319 {
2320 r_refdef.view.colormask[0] = 0;
2323 }
2324
2325 if (vid.mode.stereobuffer)
2326 qglDrawBuffer(GL_BACK_LEFT);
2327
2329 r_stereo_side = 0;
2330 }
2331 else
2332#endif
2333 {
2334 r_stereo_side = 0;
2336 }
2337
2338#ifdef CONFIG_VIDEO_CAPTURE
2339 SCR_CaptureVideo();
2340#endif
2341
2342 qglFlush(); // ensure that the commands are submitted to the GPU before we do other things
2343 VID_Finish();
2344}
client_state_t cl
Definition cl_main.c:117
client_static_t cls
Definition cl_main.c:116
static void SCR_DrawScreen(void)
Definition cl_screen.c:1576
cvar_t cl_minfps_qualitystepmax
Definition cl_main.c:106
int r_stereo_side
Definition cl_screen.c:1553
cvar_t cl_minfps_qualitymin
Definition cl_main.c:103
int cl_punchangle_applied
Definition view.c:149
static void SCR_UpdateVars(void)
Definition cl_screen.c:2082
void R_ClearScreen(qbool fogcolor)
Definition cl_screen.c:1534
cvar_t cl_minfps
Definition cl_main.c:100
qbool R_Stereo_Active(void)
Definition cl_screen.c:2077
void SCR_EndLoadingPlaque(void)
Definition cl_screen.c:1865
cvar_t cl_minfps_qualitymax
Definition cl_main.c:102
static void SCR_SetUpToDrawConsole(void)
Definition cl_screen.c:711
qbool scr_loading
Definition cl_screen.c:104
cvar_t cl_minfps_force
Definition cl_main.c:107
cvar_t cl_minfps_fade
Definition cl_main.c:101
static loadingscreenstack_t * loadingscreenstack
Definition cl_screen.c:1566
cvar_t cl_minfps_qualityhysteresis
Definition cl_main.c:105
cvar_t cl_minfps_qualitymultiply
Definition cl_main.c:104
@ ca_connected
Definition client.h:532
#define SIGNONS
Definition client.h:525
gamemode_t gamemode
Definition com_game.c:26
#define IS_NEXUIZ_DERIVED(g)
Definition com_game.h:71
void Con_Print(const char *msg)
Prints to all appropriate console targets, and adds timestamps.
Definition console.c:1504
qbool con_initialized
Definition console.c:97
void Cvar_SetValueQuick(cvar_t *var, float value)
Definition cvar.c:473
void GL_ColorMask(int r, int g, int b, int a)
void GL_DepthMask(int state)
void R_Mesh_SetRenderTargets(int fbo)
void R_SetViewport(const r_viewport_t *v)
Definition gl_backend.c:897
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)
Definition gl_backend.c:587
void GL_ScissorTest(int state)
void R_BufferData_NewFrame(void)
begin a new frame (recycle old buffers)
Definition gl_rmain.c:3678
void R_HDR_UpdateIrisAdaptation(const vec3_t point)
Definition gl_rmain.c:4144
void R_FrameData_NewFrame(void)
prepare for a new frame, recycles old buffers if a resize occurred previously
Definition gl_rmain.c:3521
r_refdef_t r_refdef
Definition gl_rmain.c:57
#define CHECKGLERROR
Definition glquake.h:1059
#define GL_BACK_LEFT
Definition glquake.h:130
#define GL_BACK
Definition glquake.h:133
#define GL_BACK_RIGHT
Definition glquake.h:131
host_static_t host
Definition host.c:41
#define max(A, B)
Definition mathlib.h:38
#define min(A, B)
Definition mathlib.h:37
#define bound(min, num, max)
Definition mathlib.h:34
#define M_PI
Definition mathlib.h:28
const matrix4x4_t identitymatrix
Definition matrixlib.c:9
void Matrix4x4_OriginFromMatrix(const matrix4x4_t *in, float *out)
Definition matrixlib.c:1792
float sin(float f)
unsigned char palette_rgb_pantscolormap[16][3]
Definition palette.c:8
unsigned char palette_rgb_pantsscoreboard[16][3]
Definition palette.c:10
unsigned char palette_rgb_shirtcolormap[16][3]
Definition palette.c:9
unsigned char palette_rgb_shirtscoreboard[16][3]
Definition palette.c:11
#define NULL
Definition qtypes.h:12
vec_t vec3_t[3]
Definition qtypes.h:71
void Sbar_ShowFPS_Update(void)
Definition sbar.c:1082
float f
double time
Definition client.h:868
qbool connect_trying
Definition client.h:609
qbool timedemo
Definition client.h:589
cactive_t state
Definition client.h:568
float value
Definition cvar.h:74
int integer
Definition cvar.h:73
double realtime
the accumulated mainloop time since application started (with filtering), without any slowmo or clamp...
Definition host.h:46
double lastdrawscreentime
Definition render.h:462
r_refdef_view_t view
Definition render.h:406
qbool clear
whether to call R_ClearScreen before rendering stuff
Definition render.h:305
float quality
render quality (0 to 1) - affects r_drawparticles_drawdistance and others
Definition render.h:321
qbool isoverlay
if true, don't clear or do any post process effects (bloom, etc)
Definition render.h:307
int colormask[4]
which color components to allow (for anaglyph glasses)
Definition render.h:299
matrix4x4_t matrix
Definition render.h:266
qbool stereobuffer
Definition vid.h:64
int width
Definition vid.h:60
int height
Definition vid.h:61
viddef_mode_t mode
currently active video mode
Definition vid.h:73
double Sys_DirtyTime(void)
Definition sys_shared.c:417
void VID_Finish(void)
Definition vid_null.c:32
viddef_t vid
global video state
Definition vid_shared.c:64
qbool vid_hidden
Definition vid_shared.c:74

References bound, ca_connected, CHECKGLERROR, cl, cl_minfps, cl_minfps_fade, cl_minfps_force, cl_minfps_qualityhysteresis, cl_minfps_qualitymax, cl_minfps_qualitymin, cl_minfps_qualitymultiply, cl_minfps_qualitystepmax, cl_punchangle_applied, r_refdef_view_t::clear, cls, r_refdef_view_t::colormask, con_initialized, Con_Print(), client_static_t::connect_trying, Cvar_SetValueQuick(), f, gamemode, GL_BACK, GL_BACK_LEFT, GL_BACK_RIGHT, GL_ColorMask(), GL_DepthMask(), GL_ScissorTest(), viddef_mode_t::height, host, identitymatrix, cvar_t::integer, IS_NEXUIZ_DERIVED, r_refdef_view_t::isoverlay, r_refdef_t::lastdrawscreentime, loadingscreenstack, M_PI, r_refdef_view_t::matrix, Matrix4x4_OriginFromMatrix(), max, min, viddef_t::mode, NULL, palette_rgb_pantscolormap, palette_rgb_pantsscoreboard, palette_rgb_shirtcolormap, palette_rgb_shirtscoreboard, r_refdef_view_t::quality, R_BufferData_NewFrame(), R_ClearScreen(), R_FrameData_NewFrame(), R_HDR_UpdateIrisAdaptation(), R_Mesh_SetRenderTargets(), r_refdef, R_SetViewport(), R_Stereo_Active(), r_stereo_redblue, r_stereo_redcyan, r_stereo_redgreen, r_stereo_side, R_Viewport_InitOrtho(), host_static_t::realtime, Sbar_ShowFPS_Update(), SCR_DrawScreen(), SCR_EndLoadingPlaque(), scr_initialized, scr_loading, scr_loadingscreen_maxfps, scr_refresh, SCR_SetUpToDrawConsole(), scr_stipple, SCR_UpdateVars(), client_static_t::signon, SIGNONS, sin(), client_static_t::state, viddef_mode_t::stereobuffer, Sys_DirtyTime(), client_state_t::time, client_static_t::timedemo, cvar_t::value, vid, vid_conheight, vid_conwidth, VID_Finish(), vid_hidden, r_refdef_t::view, and viddef_mode_t::width.

Referenced by CL_Frame(), CL_TimeRefresh_f(), Key_Console(), SCR_BeginLoadingPlaque(), SCR_PopLoadingScreen(), and SCR_PushLoadingScreen().

◆ R_Stereo_Active()

◆ SCR_BeginLoadingPlaque()

void SCR_BeginLoadingPlaque ( qbool startup)

Definition at line 1838 of file cl_screen.c.

1839{
1840 loadingscreenstack_t dummy_status;
1841
1842 // we need to push a dummy status so CL_UpdateScreen knows we have things to load...
1843 if (!loadingscreenstack)
1844 {
1845 dummy_status.msg[0] = '\0';
1846 dummy_status.absolute_loading_amount_min = 0;
1847 loadingscreenstack = &dummy_status;
1848 }
1849
1850 SCR_DeferLoadingPlaque(startup);
1854
1855 if (loadingscreenstack == &dummy_status)
1857}
void CL_UpdateScreen(void)
Definition cl_screen.c:2130
static void SCR_SetLoadingScreenTexture(void)
Definition cl_screen.c:1794
void SCR_DeferLoadingPlaque(qbool startup)
Definition cl_screen.c:1859
float absolute_loading_amount_min
Definition cl_screen.c:1561
char msg[MAX_QPATH]
Definition cl_screen.c:1560

References loadingscreenstack_t::absolute_loading_amount_min, CL_UpdateScreen(), cvar_t::integer, loadingscreenstack, loadingscreenstack_t::msg, NULL, SCR_DeferLoadingPlaque(), scr_loadingscreen_background, and SCR_SetLoadingScreenTexture().

Referenced by CL_EstablishConnection(), CL_ParseServerInfo(), Host_Init(), R_Modules_Restart_f(), and SV_SpawnServer().

◆ SCR_CaptureVideo_SoundFrame()

void SCR_CaptureVideo_SoundFrame ( const struct portable_samplepair_s * paintbuffer,
size_t length )

◆ SCR_CenterPrint()

void SCR_CenterPrint ( const char * str)

Definition at line 144 of file cl_screen.c.

145{
148
149 // Print the message to the console and update the scr buffer
150 // but only if it's different to the previous message
151 if (strcmp(str, scr_centerstring) == 0)
152 return;
155 if (str[0] == '\0') // happens when stepping out of a centreprint trigger on alk1.2 start.bsp
156 return;
157 Con_CenterPrint(str);
158
159// count the number of lines for centering
160 while (*str)
161 {
162 if (*str == '\n')
164 str++;
165 }
166}
float scr_centertime_start
Definition cl_screen.c:128
int scr_center_lines
Definition cl_screen.c:130
char scr_centerstring[MAX_INPUTLINE]
Definition cl_screen.c:127
float scr_centertime_off
Definition cl_screen.c:129
#define dp_strlcpy(dst, src, dsize)
Definition common.h:303
void Con_CenterPrint(const char *str)
Prints a center-aligned message to the console.
Definition console.c:1655

References cl, Con_CenterPrint(), dp_strlcpy, scr_center_lines, scr_centerstring, scr_centertime, scr_centertime_off, scr_centertime_start, client_state_t::time, and cvar_t::value.

Referenced by CL_ParseServerMessage(), CL_VM_Parse_CenterPrint(), SCR_Centerprint_f(), and VM_centerprint().

◆ SCR_ClearLoadingScreen()

void SCR_ClearLoadingScreen ( qbool redraw)

Definition at line 1918 of file cl_screen.c.

1919{
1920 while(loadingscreenstack)
1922}
void SCR_PopLoadingScreen(qbool redraw)
Definition cl_screen.c:1899
struct loadingscreenstack_s * prev
Definition cl_screen.c:1559

References loadingscreenstack, loadingscreenstack_t::prev, and SCR_PopLoadingScreen().

Referenced by CL_DisconnectEx().

◆ SCR_DeferLoadingPlaque()

void SCR_DeferLoadingPlaque ( qbool startup)

Definition at line 1859 of file cl_screen.c.

1860{
1861 SCR_ChooseLoadingPic(startup);
1862 scr_loading = true;
1863}
static void SCR_ChooseLoadingPic(qbool startup)
Definition cl_screen.c:1819

References SCR_ChooseLoadingPic(), and scr_loading.

Referenced by SCR_BeginLoadingPlaque(), and VID_Restart_f().

◆ SCR_EndLoadingPlaque()

void SCR_EndLoadingPlaque ( void )

Definition at line 1865 of file cl_screen.c.

1866{
1867 scr_loading = false;
1869}
static void SCR_ClearLoadingScreenTexture(void)
Definition cl_screen.c:1786

References SCR_ClearLoadingScreenTexture(), and scr_loading.

Referenced by CL_UpdateScreen().

◆ SCR_PopLoadingScreen()

void SCR_PopLoadingScreen ( qbool redraw)

Definition at line 1899 of file cl_screen.c.

1900{
1902
1903 if(!s)
1904 {
1905 Con_DPrintf("Popping a loading screen item from an empty stack!\n");
1906 return;
1907 }
1908
1910 if(s->prev)
1911 s->prev->relative_completion = (s->absolute_loading_amount_min + s->absolute_loading_amount_len - s->prev->absolute_loading_amount_min) / s->prev->absolute_loading_amount_len;
1912 Z_Free(s);
1913
1914 if (scr_loading && redraw)
1916}
void Con_DPrintf(const char *fmt,...)
A Con_Printf that only shows up if the "developer" cvar is set.
Definition console.c:1544
float absolute_loading_amount_len
Definition cl_screen.c:1562
#define Z_Free(data)
Definition zone.h:164

◆ SCR_PushLoadingScreen()

void SCR_PushLoadingScreen ( const char * msg,
float len_in_parent )

Definition at line 1873 of file cl_screen.c.

1874{
1878
1879 dp_strlcpy(s->msg, msg, sizeof(s->msg));
1880 s->relative_completion = 0;
1881
1882 if(s->prev)
1883 {
1884 s->absolute_loading_amount_min = s->prev->absolute_loading_amount_min + s->prev->absolute_loading_amount_len * s->prev->relative_completion;
1885 s->absolute_loading_amount_len = s->prev->absolute_loading_amount_len * len_in_parent;
1886 if(s->absolute_loading_amount_len > s->prev->absolute_loading_amount_min + s->prev->absolute_loading_amount_len - s->absolute_loading_amount_min)
1887 s->absolute_loading_amount_len = s->prev->absolute_loading_amount_min + s->prev->absolute_loading_amount_len - s->absolute_loading_amount_min;
1888 }
1889 else
1890 {
1893 }
1894
1895 if (scr_loading)
1897}
#define Z_Malloc(size)
Definition zone.h:161

Variable Documentation

◆ cl_showdate

struct cvar_s cl_showdate
extern

Definition at line 96 of file sbar.c.

96{CF_CLIENT | CF_ARCHIVE, "cl_showdate", "0", "shows current date (useful on screenshots)"};
#define CF_ARCHIVE
cvar should have its set value saved to config.cfg and persist across sessions
Definition cmd.h:53

Referenced by M_Menu_Options_AdjustSliders(), M_Options_Draw(), Sbar_Init(), and Sbar_ShowFPS().

◆ cl_showfps

struct cvar_s cl_showfps
extern

Definition at line 88 of file sbar.c.

88{CF_CLIENT | CF_ARCHIVE, "cl_showfps", "0", "shows your rendered fps (frames per second)"};

Referenced by M_Menu_Options_AdjustSliders(), M_Options_Draw(), Sbar_Init(), and Sbar_ShowFPS().

◆ cl_showtime

struct cvar_s cl_showtime
extern

Definition at line 94 of file sbar.c.

94{CF_CLIENT | CF_ARCHIVE, "cl_showtime", "0", "shows current time of day (useful on screenshots)"};

Referenced by M_Menu_Options_AdjustSliders(), M_Options_Draw(), Sbar_Init(), and Sbar_ShowFPS().

◆ crosshair

struct cvar_s crosshair
extern

Definition at line 121 of file view.c.

121{CF_CLIENT | CF_ARCHIVE, "crosshair", "0", "selects crosshair to use (0 is none)"};

Referenced by M_Menu_Options_AdjustSliders(), M_Options_Draw(), Sbar_Draw(), and V_Init().

◆ crosshair_size

struct cvar_s crosshair_size
extern

Definition at line 116 of file sbar.c.

116{CF_CLIENT | CF_ARCHIVE, "crosshair_size", "1", "adjusts size of the crosshair on the screen"};

Referenced by Sbar_Draw(), and Sbar_Init().

◆ r_letterbox

struct cvar_s r_letterbox
extern

Definition at line 79 of file cl_screen.c.

79{CF_CLIENT, "r_letterbox", "0", "reduces vertical height of view to simulate a letterboxed movie effect (can be used by mods for cutscenes)"};

Referenced by CL_Screen_Init(), Sbar_Draw(), and SCR_DrawScreen().

◆ r_stereo_angle

struct cvar_s r_stereo_angle
extern

Definition at line 87 of file cl_screen.c.

87{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)"};

Referenced by CL_Screen_Init(), and R_RenderView().

◆ r_stereo_separation

struct cvar_s r_stereo_separation
extern

Definition at line 80 of file cl_screen.c.

80{CF_CLIENT, "r_stereo_separation", "4", "separation distance of eyes in the world (negative values are only useful for cross-eyed viewing)"};

Referenced by CL_Screen_Init(), and R_RenderView().

◆ r_stereo_side

int r_stereo_side
extern

Definition at line 1553 of file cl_screen.c.

Referenced by CL_UpdateScreen(), R_RenderView(), and SCR_DrawScreen().

◆ sb_lines

int sb_lines
extern

scan lines to draw

Definition at line 58 of file sbar.c.

Referenced by R_TimeReport_EndFrame(), Sbar_Draw(), and SCR_UpdateVars().

◆ scr_con_current

unsigned int scr_con_current
extern

◆ scr_conalpha

struct cvar_s scr_conalpha
extern

Definition at line 21 of file cl_screen.c.

21{CF_CLIENT | CF_ARCHIVE, "scr_conalpha", "0.9", "opacity of console background gfx/conback (when console isn't forced fullscreen)"};

Referenced by CL_Screen_Init(), and Con_DrawConsole().

◆ scr_conalpha2factor

struct cvar_s scr_conalpha2factor
extern

Definition at line 23 of file cl_screen.c.

23{CF_CLIENT | CF_ARCHIVE, "scr_conalpha2factor", "0", "opacity of console background gfx/conback2 relative to scr_conalpha; when 0, gfx/conback2 is not drawn"};

Referenced by CL_Screen_Init(), and Con_DrawConsole().

◆ scr_conalpha3factor

struct cvar_s scr_conalpha3factor
extern

Definition at line 24 of file cl_screen.c.

24{CF_CLIENT | CF_ARCHIVE, "scr_conalpha3factor", "0", "opacity of console background gfx/conback3 relative to scr_conalpha; when 0, gfx/conback3 is not drawn"};

Referenced by CL_Screen_Init(), and Con_DrawConsole().

◆ scr_conalphafactor

struct cvar_s scr_conalphafactor
extern

Definition at line 22 of file cl_screen.c.

22{CF_CLIENT | CF_ARCHIVE, "scr_conalphafactor", "1", "opacity of console background gfx/conback relative to scr_conalpha; when 0, gfx/conback is not drawn"};

Referenced by CL_Screen_Init(), and Con_DrawConsole().

◆ scr_conbrightness

struct cvar_s scr_conbrightness
extern

Definition at line 25 of file cl_screen.c.

25{CF_CLIENT | CF_ARCHIVE, "scr_conbrightness", "1", "brightness of console background (0 = black, 1 = image)"};

Referenced by CL_Screen_Init(), and Con_DrawConsole().

◆ scr_conscroll2_x

struct cvar_s scr_conscroll2_x
extern

Definition at line 30 of file cl_screen.c.

30{CF_CLIENT | CF_ARCHIVE, "scr_conscroll2_x", "0", "scroll speed of gfx/conback2 in x direction"};

Referenced by CL_Screen_Init(), and Con_DrawConsole().

◆ scr_conscroll2_y

struct cvar_s scr_conscroll2_y
extern

Definition at line 31 of file cl_screen.c.

31{CF_CLIENT | CF_ARCHIVE, "scr_conscroll2_y", "0", "scroll speed of gfx/conback2 in y direction"};

Referenced by CL_Screen_Init(), and Con_DrawConsole().

◆ scr_conscroll3_x

struct cvar_s scr_conscroll3_x
extern

Definition at line 32 of file cl_screen.c.

32{CF_CLIENT | CF_ARCHIVE, "scr_conscroll3_x", "0", "scroll speed of gfx/conback3 in x direction"};

Referenced by CL_Screen_Init(), and Con_DrawConsole().

◆ scr_conscroll3_y

struct cvar_s scr_conscroll3_y
extern

Definition at line 33 of file cl_screen.c.

33{CF_CLIENT | CF_ARCHIVE, "scr_conscroll3_y", "0", "scroll speed of gfx/conback3 in y direction"};

Referenced by CL_Screen_Init(), and Con_DrawConsole().

◆ scr_conscroll_x

struct cvar_s scr_conscroll_x
extern

Definition at line 28 of file cl_screen.c.

28{CF_CLIENT | CF_ARCHIVE, "scr_conscroll_x", "0", "scroll speed of gfx/conback in x direction"};

Referenced by CL_Screen_Init(), and Con_DrawConsole().

◆ scr_conscroll_y

struct cvar_s scr_conscroll_y
extern

Definition at line 29 of file cl_screen.c.

29{CF_CLIENT | CF_ARCHIVE, "scr_conscroll_y", "0", "scroll speed of gfx/conback in y direction"};

Referenced by CL_Screen_Init(), and Con_DrawConsole().

◆ scr_fov

struct cvar_s scr_fov
extern

Definition at line 20 of file cl_screen.c.

20{CF_CLIENT | CF_ARCHIVE, "fov","90", "field of vision, 1-170 degrees, default 90, some players use 110-130"};

Referenced by CL_Screen_Init(), M_Menu_Options_AdjustSliders(), M_Options_Draw(), SCR_DrawScreen(), and SCR_UpdateVars().

◆ scr_numtouchscreenareas

int scr_numtouchscreenareas
extern

◆ scr_refresh

struct cvar_s scr_refresh
extern

Definition at line 89 of file cl_screen.c.

89{CF_CLIENT, "scr_refresh", "1", "allows you to completely shut off rendering for benchmarking purposes"};

Referenced by CL_Screen_Init(), and CL_UpdateScreen().

◆ scr_stipple

struct cvar_s scr_stipple
extern

Definition at line 88 of file cl_screen.c.

88{CF_CLIENT, "scr_stipple", "0", "interlacing-like stippling of the display"};

Referenced by CL_DrawVideo(), CL_Screen_Init(), and CL_UpdateScreen().

◆ scr_touchscreenareas

scr_touchscreenarea_t scr_touchscreenareas[128]
extern

◆ scr_viewsize

struct cvar_s scr_viewsize
extern

Definition at line 19 of file cl_screen.c.

19{CF_CLIENT | CF_ARCHIVE, "viewsize","100", "how large the view should be, 110 disables inventory bar, 120 disables status bar"};

Referenced by CL_Screen_Init(), SCR_DrawScreen(), SCR_SizeDown_f(), SCR_SizeUp_f(), SCR_UpdateVars(), and V_CalcRefdefUsing().