X-Git-Url: https://git.xonotic.org/?p=voretournament%2Fvoretournament.git;a=blobdiff_plain;f=misc%2Fsource%2Fdarkplaces-src%2Fcl_screen.c;fp=misc%2Fsource%2Fdarkplaces-src%2Fcl_screen.c;h=1f5f7dbc5cdb0400621f6f38b2fa3d03289478a5;hp=f1ae56690bc8dac6392aac19e08c7f93dfa67e9e;hb=045633c16560b0d75e3670d753c8898d5d4dda95;hpb=887cea3dc4674191cd6fe9900fa1ddc84f31d6ee diff --git a/misc/source/darkplaces-src/cl_screen.c b/misc/source/darkplaces-src/cl_screen.c index f1ae5669..1f5f7dbc 100644 --- a/misc/source/darkplaces-src/cl_screen.c +++ b/misc/source/darkplaces-src/cl_screen.c @@ -38,10 +38,12 @@ cvar_t scr_loadingscreen_background = {0, "scr_loadingscreen_background","0", "s cvar_t scr_loadingscreen_scale = {0, "scr_loadingscreen_scale","1", "scale factor of the background"}; cvar_t scr_loadingscreen_scale_base = {0, "scr_loadingscreen_scale_base","0", "0 = console pixels, 1 = video pixels"}; cvar_t scr_loadingscreen_scale_limit = {0, "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"}; +cvar_t scr_loadingscreen_picture = {CVAR_SAVE, "scr_loadingscreen_picture", "gfx/loading", "picture shown during loading"}; cvar_t scr_loadingscreen_count = {0, "scr_loadingscreen_count","1", "number of loading screen files to use randomly (named loading.tga, loading2.tga, loading3.tga, ...)"}; cvar_t scr_loadingscreen_firstforstartup = {0, "scr_loadingscreen_firstforstartup","0", "remove loading.tga from random scr_loadingscreen_count selection and only display it on client startup, 0 = normal, 1 = firstforstartup"}; cvar_t scr_loadingscreen_barcolor = {0, "scr_loadingscreen_barcolor", "0 0 1", "rgb color of loadingscreen progress bar"}; cvar_t scr_loadingscreen_barheight = {0, "scr_loadingscreen_barheight", "8", "the height of the loadingscreen progress bar"}; +cvar_t scr_loadingscreen_maxfps = {0, "scr_loadingscreen_maxfps", "10", "restrict maximal FPS for loading screen so it will not update very often (this will make lesser loading times on a maps loading large number of models)"}; cvar_t scr_infobar_height = {0, "scr_infobar_height", "8", "the height of the infobar items"}; cvar_t vid_conwidth = {CVAR_SAVE, "vid_conwidth", "640", "virtual width of 2D graphics system"}; cvar_t vid_conheight = {CVAR_SAVE, "vid_conheight", "480", "virtual height of 2D graphics system"}; @@ -55,6 +57,7 @@ cvar_t scr_screenshot_alpha = {CVAR_SAVE, "scr_screenshot_alpha","0", "try to wr cvar_t scr_screenshot_timestamp = {CVAR_SAVE, "scr_screenshot_timestamp", "1", "use a timestamp based number of the type YYYYMMDDHHMMSSsss instead of sequential numbering"}; // scr_screenshot_name is defined in fs.c cvar_t cl_capturevideo = {0, "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)"}; +cvar_t cl_capturevideo_demo_stop = {CVAR_SAVE, "cl_capturevideo_demo_stop", "1", "automatically stops video recording when demo ends"}; cvar_t cl_capturevideo_printfps = {CVAR_SAVE, "cl_capturevideo_printfps", "1", "prints the frames per second captured in capturevideo (is only written to the log file, not to the console, as that would be visible on the video)"}; cvar_t cl_capturevideo_width = {CVAR_SAVE, "cl_capturevideo_width", "0", "scales all frames to this resolution before saving the video"}; cvar_t cl_capturevideo_height = {CVAR_SAVE, "cl_capturevideo_height", "0", "scales all frames to this resolution before saving the video"}; @@ -236,9 +239,6 @@ static void SCR_DrawNetGraph_DrawGraph (int graphx, int graphy, int graphwidth, float *c; DrawQ_Fill(graphx, graphy, graphwidth, graphheight + textsize * 2, 0, 0, 0, 0.5, 0); // draw the bar graph itself - // advance the packet counter because it is the latest packet column being - // built up and should come last - packetcounter = (packetcounter + 1) % NETGRAPH_PACKETS; memset(g, 0, sizeof(g)); for (j = 0;j < NETGRAPH_PACKETS;j++) { @@ -916,10 +916,12 @@ void CL_Screen_Init(void) Cvar_RegisterVariable (&scr_loadingscreen_scale); Cvar_RegisterVariable (&scr_loadingscreen_scale_base); Cvar_RegisterVariable (&scr_loadingscreen_scale_limit); + Cvar_RegisterVariable (&scr_loadingscreen_picture); Cvar_RegisterVariable (&scr_loadingscreen_count); Cvar_RegisterVariable (&scr_loadingscreen_firstforstartup); Cvar_RegisterVariable (&scr_loadingscreen_barcolor); Cvar_RegisterVariable (&scr_loadingscreen_barheight); + Cvar_RegisterVariable (&scr_loadingscreen_maxfps); Cvar_RegisterVariable (&scr_infobar_height); Cvar_RegisterVariable (&scr_showram); Cvar_RegisterVariable (&scr_showturtle); @@ -939,6 +941,7 @@ void CL_Screen_Init(void) Cvar_RegisterVariable (&scr_screenshot_alpha); Cvar_RegisterVariable (&scr_screenshot_timestamp); Cvar_RegisterVariable (&cl_capturevideo); + Cvar_RegisterVariable (&cl_capturevideo_demo_stop); Cvar_RegisterVariable (&cl_capturevideo_printfps); Cvar_RegisterVariable (&cl_capturevideo_width); Cvar_RegisterVariable (&cl_capturevideo_height); @@ -2048,7 +2051,7 @@ static void SCR_DrawLoadingScreen_SharedSetup (qboolean clear) R_Mesh_Start(); R_EntityMatrix(&identitymatrix); // draw the loading plaque - loadingscreenpic = Draw_CachePic_Flags (loadingscreenpic_number ? va(vabuf, sizeof(vabuf), "gfx/loading%d", loadingscreenpic_number+1) : "gfx/loading", loadingscreenpic_number ? CACHEPICFLAG_NOTPERSISTENT : 0); + loadingscreenpic = Draw_CachePic_Flags (loadingscreenpic_number ? va(vabuf, sizeof(vabuf), "%s%d", scr_loadingscreen_picture.string, loadingscreenpic_number+1) : scr_loadingscreen_picture.string, loadingscreenpic_number ? CACHEPICFLAG_NOTPERSISTENT : 0); w = loadingscreenpic->width; h = loadingscreenpic->height; @@ -2130,6 +2133,8 @@ static void SCR_DrawLoadingScreen_SharedFinish (qboolean clear) VID_Finish(); } +static double loadingscreen_lastupdate; + void SCR_UpdateLoadingScreen (qboolean clear, qboolean startup) { keydest_t old_key_dest; @@ -2139,6 +2144,15 @@ void SCR_UpdateLoadingScreen (qboolean clear, qboolean startup) if (vid_hidden || cls.state == ca_dedicated) return; + // limit update rate + if (scr_loadingscreen_maxfps.value) + { + double t = Sys_DirtyTime(); + if ((t - loadingscreen_lastupdate) < 1.0f/scr_loadingscreen_maxfps.value) + return; + loadingscreen_lastupdate = t; + } + if(!scr_loadingscreen_background.integer) clear = true;