mirror of
https://github.com/blendogames/thirtyflightsofloving.git
synced 2025-01-31 04:30:39 +00:00
Added automatic setting of r_maxfps based on r_displayrefresh.
This commit is contained in:
parent
b281dd23ca
commit
70759acf65
4 changed files with 61 additions and 18 deletions
|
@ -2221,6 +2221,11 @@ void CL_InitLocal (void)
|
|||
Cmd_AddCommand ("weapnext", NULL);
|
||||
Cmd_AddCommand ("weapprev", NULL);
|
||||
|
||||
#ifdef CLIENT_SPLIT_NETFRAME
|
||||
// auto-set r_maxfps based on r_displayrefresh
|
||||
CL_SetFramerateCap ();
|
||||
#endif // CLIENT_SPLIT_NETFRAME
|
||||
|
||||
// Chat Ignore from R1Q2/Q2Pro
|
||||
// Init list pointers
|
||||
cl_chatNickIgnores.next = NULL;
|
||||
|
@ -2340,6 +2345,36 @@ void CL_AdvertiseVersion (void)
|
|||
|
||||
|
||||
#ifdef CLIENT_SPLIT_NETFRAME
|
||||
/*
|
||||
==================
|
||||
CL_SetFramerateCap
|
||||
|
||||
Auto-sets r_maxfps based on r_displayrefresh.
|
||||
Does nothing if r_displayrefresh is not set.
|
||||
==================
|
||||
*/
|
||||
void CL_SetFramerateCap (void)
|
||||
{
|
||||
int displayFreq = Cvar_VariableInteger("r_displayrefresh");
|
||||
|
||||
// if no refresh set, leave framerate cap at default
|
||||
if (displayFreq <= 0) {
|
||||
// Cvar_SetInteger ("r_maxfps", 125); // 8ms frame interval
|
||||
return;
|
||||
}
|
||||
|
||||
// isn't 250 fps enough for any display?
|
||||
if (displayFreq > 200)
|
||||
Cvar_SetInteger ("r_maxfps", 250); // 4ms frame interval
|
||||
else if (displayFreq > 167)
|
||||
Cvar_SetInteger ("r_maxfps", 200); // 5ms frame interval
|
||||
else if (displayFreq > 125)
|
||||
Cvar_SetInteger ("r_maxfps", 167); // 6ms frame interval
|
||||
else // 125 fps is default cap
|
||||
Cvar_SetInteger ("r_maxfps", 125); // 8ms frame interval
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
==================
|
||||
CL_RefreshInputs
|
||||
|
@ -2404,14 +2439,14 @@ void CL_Frame_Async (int msec)
|
|||
qboolean miscFrame = true;
|
||||
|
||||
// Don't allow setting maxfps too low or too high
|
||||
if (net_maxfps->value < 10)
|
||||
Cvar_SetValue("net_maxfps", 10);
|
||||
if (net_maxfps->value > 100)
|
||||
Cvar_SetValue("net_maxfps", 100);
|
||||
if (r_maxfps->value < 10)
|
||||
Cvar_SetValue("r_maxfps", 10);
|
||||
if (r_maxfps->value > 1000)
|
||||
Cvar_SetValue("r_maxfps", 1000);
|
||||
if (net_maxfps->integer < 10)
|
||||
Cvar_SetInteger ("net_maxfps", 10);
|
||||
if (net_maxfps->integer > 100)
|
||||
Cvar_SetInteger ("net_maxfps", 100);
|
||||
if (r_maxfps->integer < 10)
|
||||
Cvar_SetInteger ("r_maxfps", 10);
|
||||
if (r_maxfps->integer > 1000)
|
||||
Cvar_SetInteger ("r_maxfps", 1000);
|
||||
|
||||
packetDelta += msec;
|
||||
renderDelta += msec;
|
||||
|
@ -2633,10 +2668,10 @@ void CL_Frame (int msec)
|
|||
|
||||
// don't allow setting maxfps too low (or game could stop responding)
|
||||
// don't allow too high, either
|
||||
if (cl_maxfps->value < 10)
|
||||
Cvar_SetValue("cl_maxfps", 10);
|
||||
if (cl_maxfps->value > 500)
|
||||
Cvar_SetValue("cl_maxfps", 500);
|
||||
if (cl_maxfps->integer < 10)
|
||||
Cvar_SetInteger ("cl_maxfps", 10);
|
||||
if (cl_maxfps->integer > 500)
|
||||
Cvar_SetInteger ("cl_maxfps", 500);
|
||||
|
||||
// if (!cl_timedemo->value)
|
||||
if (!cl_timedemo->integer)
|
||||
|
|
|
@ -816,8 +816,9 @@ void CL_GetChallengePacket (void);
|
|||
void CL_PingServers_f (void);
|
||||
void CL_Snd_Restart_f (void);
|
||||
void CL_WriteConfig_f (void);
|
||||
|
||||
void vectoangles2 (vec3_t value1, vec3_t angles);
|
||||
#ifdef CLIENT_SPLIT_NETFRAME
|
||||
void CL_SetFramerateCap (void);
|
||||
#endif // CLIENT_SPLIT_NETFRAME
|
||||
|
||||
//
|
||||
// cl_input
|
||||
|
|
|
@ -6,6 +6,8 @@ Changes as of v0.20 update 8:
|
|||
|
||||
- Added 160Hz and 240Hz refresh rates.
|
||||
|
||||
- Added automatic setting of r_maxfps based on refresh rate set in video menu (r_displayrefresh).
|
||||
|
||||
- Added support for triple-monitor surround modes via custom resolutions. Monitors must be bound as a single logical display.
|
||||
Keeps all menu/HUD elements on the center screen, set the cvar scr_surroundlayout to 0 to disable this.
|
||||
Cvars scr_surroundleft and scr_surroundright set placement of left and right of center screen.
|
||||
|
|
|
@ -145,6 +145,11 @@ static void prepareVideoRefresh( void )
|
|||
Cvar_Set( "vid_ref", "gl" );
|
||||
Cvar_Set( "gl_driver", "opengl32" );
|
||||
|
||||
#ifdef CLIENT_SPLIT_NETFRAME
|
||||
// auto-set r_maxfps based on r_displayrefresh
|
||||
CL_SetFramerateCap ();
|
||||
#endif // CLIENT_SPLIT_NETFRAME
|
||||
|
||||
// tell them they're modified so they refresh
|
||||
vid_ref->modified = true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue