]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
added cl_maxidlefps cvar to control the fps limiting when not the active
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 27 Aug 2007 10:50:40 +0000 (10:50 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 27 Aug 2007 10:50:40 +0000 (10:50 +0000)
window

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

host.c

diff --git a/host.c b/host.c
index cc1e80154831e0b03eb55c7629807207a6a0e89a..d773aef1debb89e62195d518a2ef581937747f2a 100644 (file)
--- a/host.c
+++ b/host.c
@@ -58,6 +58,7 @@ cvar_t host_framerate = {0, "host_framerate","0", "locks frame timing to this va
 cvar_t host_speeds = {0, "host_speeds","0", "reports how much time is used in server/graphics/sound"};
 // LordHavoc: framerate upper cap
 cvar_t cl_maxfps = {CVAR_SAVE, "cl_maxfps", "1000", "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_maxidlefps = {CVAR_SAVE, "cl_maxidlefps", "10", "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)"};
 cvar_t developer_entityparsing = {0, "developer_entityparsing", "0", "prints detailed network entities information each time a packet is received"};
@@ -199,6 +200,7 @@ static void Host_InitLocal (void)
        Cvar_RegisterVariable (&host_framerate);
        Cvar_RegisterVariable (&host_speeds);
        Cvar_RegisterVariable (&cl_maxfps);
+       Cvar_RegisterVariable (&cl_maxidlefps);
 
        Cvar_RegisterVariable (&developer);
        Cvar_RegisterVariable (&developer_entityparsing);
@@ -778,7 +780,7 @@ void Host_Main(void)
                        else if (vid_activewindow)
                                clframetime = cl.realframetime = max(cl_timer, 1.0 / cl_maxfps.value);
                        else
-                               clframetime = cl.realframetime = 0.1;
+                               clframetime = cl.realframetime = max(cl_timer, 1.0 / cl_maxidlefps.value);
 
                        // apply slowmo scaling
                        clframetime *= cl.movevars_timescale;