]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
allow cl_maxfps and cl_maxidlefps to be 0, meaning unlimited (like in
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 22 Aug 2008 11:26:53 +0000 (11:26 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 22 Aug 2008 11:26:53 +0000 (11:26 +0000)
many QW clients)

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8463 d7cf8633-e32d-0410-b094-e92efae38249

host.c

diff --git a/host.c b/host.c
index 1ce67c668b1fdb6c3d248ea38a7c04f6b100d8df..70d81ae3d797b05882ac7e0c2e603d38af4317a3 100644 (file)
--- 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;