From 936647276e872f68e8dabe5484e5c5d01ae062bf Mon Sep 17 00:00:00 2001 From: havoc Date: Fri, 22 Aug 2008 11:26:53 +0000 Subject: [PATCH] allow cl_maxfps and cl_maxidlefps to be 0, meaning unlimited (like in many QW clients) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8463 d7cf8633-e32d-0410-b094-e92efae38249 --- host.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/host.c b/host.c index 1ce67c66..70d81ae3 100644 --- a/host.c +++ b/host.c @@ -65,7 +65,7 @@ cvar_t cl_minfps_qualitymax = {CVAR_SAVE, "cl_minfps_qualitymax", "1", "highest cvar_t cl_minfps_qualitymin = {CVAR_SAVE, "cl_minfps_qualitymin", "0.25", "lowest allowed drawdistance multiplier"}; cvar_t cl_minfps_qualitypower = {CVAR_SAVE, "cl_minfps_qualitypower", "4", "raises quality value to a power of itself, higher values make quality drop more sharply in relation to framerate"}; cvar_t cl_minfps_qualityscale = {CVAR_SAVE, "cl_minfps_qualityscale", "0.5", "multiplier for quality"}; -cvar_t cl_maxfps = {CVAR_SAVE, "cl_maxfps", "1000000", "maximum fps cap, if game is running faster than this it will wait before running another frame (useful to make cpu time available to other programs)"}; +cvar_t cl_maxfps = {CVAR_SAVE, "cl_maxfps", "1000000", "maximum fps cap, 0 = unlimited, if game is running faster than this it will wait before running another frame (useful to make cpu time available to other programs)"}; cvar_t cl_maxidlefps = {CVAR_SAVE, "cl_maxidlefps", "20", "maximum fps cap when the game is not the active window (makes cpu time available to other programs"}; cvar_t developer = {0, "developer","0", "prints additional debugging messages and information (recommended for modders and level designers)"}; @@ -824,10 +824,12 @@ void Host_Main(void) cl.realframetime = max(cl_timer, clframetime); } } - else if (vid_activewindow) - clframetime = cl.realframetime = max(cl_timer, 1.0 / max(5.0f, cl_maxfps.value)); + else if (vid_activewindow && cl_maxfps.value >= 1) + clframetime = cl.realframetime = max(cl_timer, 1.0 / cl_maxfps.value); + else if (!vid_activewindow && cl_maxidlefps.value >= 1) + clframetime = cl.realframetime = max(cl_timer, 1.0 / cl_maxidlefps.value); else - clframetime = cl.realframetime = max(cl_timer, 1.0 / max(5.0f, cl_maxidlefps.value)); + clframetime = cl.realframetime = cl_timer; // apply slowmo scaling clframetime *= cl.movevars_timescale; -- 2.39.2