From 610df0fcf5511340613b1c182dae8f52938f30a8 Mon Sep 17 00:00:00 2001 From: havoc Date: Mon, 27 Aug 2007 10:50:40 +0000 Subject: [PATCH] added cl_maxidlefps cvar to control the fps limiting when not the active window git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7540 d7cf8633-e32d-0410-b094-e92efae38249 --- host.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/host.c b/host.c index cc1e8015..d773aef1 100644 --- 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; -- 2.39.2