mirror of
https://github.com/blendogames/thirtyflightsofloving.git
synced 2025-02-07 07:41:10 +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 ("weapnext", NULL);
|
||||||
Cmd_AddCommand ("weapprev", 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
|
// Chat Ignore from R1Q2/Q2Pro
|
||||||
// Init list pointers
|
// Init list pointers
|
||||||
cl_chatNickIgnores.next = NULL;
|
cl_chatNickIgnores.next = NULL;
|
||||||
|
@ -2340,6 +2345,36 @@ void CL_AdvertiseVersion (void)
|
||||||
|
|
||||||
|
|
||||||
#ifdef CLIENT_SPLIT_NETFRAME
|
#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
|
CL_RefreshInputs
|
||||||
|
@ -2404,14 +2439,14 @@ void CL_Frame_Async (int msec)
|
||||||
qboolean miscFrame = true;
|
qboolean miscFrame = true;
|
||||||
|
|
||||||
// Don't allow setting maxfps too low or too high
|
// Don't allow setting maxfps too low or too high
|
||||||
if (net_maxfps->value < 10)
|
if (net_maxfps->integer < 10)
|
||||||
Cvar_SetValue("net_maxfps", 10);
|
Cvar_SetInteger ("net_maxfps", 10);
|
||||||
if (net_maxfps->value > 100)
|
if (net_maxfps->integer > 100)
|
||||||
Cvar_SetValue("net_maxfps", 100);
|
Cvar_SetInteger ("net_maxfps", 100);
|
||||||
if (r_maxfps->value < 10)
|
if (r_maxfps->integer < 10)
|
||||||
Cvar_SetValue("r_maxfps", 10);
|
Cvar_SetInteger ("r_maxfps", 10);
|
||||||
if (r_maxfps->value > 1000)
|
if (r_maxfps->integer > 1000)
|
||||||
Cvar_SetValue("r_maxfps", 1000);
|
Cvar_SetInteger ("r_maxfps", 1000);
|
||||||
|
|
||||||
packetDelta += msec;
|
packetDelta += msec;
|
||||||
renderDelta += 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 setting maxfps too low (or game could stop responding)
|
||||||
// don't allow too high, either
|
// don't allow too high, either
|
||||||
if (cl_maxfps->value < 10)
|
if (cl_maxfps->integer < 10)
|
||||||
Cvar_SetValue("cl_maxfps", 10);
|
Cvar_SetInteger ("cl_maxfps", 10);
|
||||||
if (cl_maxfps->value > 500)
|
if (cl_maxfps->integer > 500)
|
||||||
Cvar_SetValue("cl_maxfps", 500);
|
Cvar_SetInteger ("cl_maxfps", 500);
|
||||||
|
|
||||||
// if (!cl_timedemo->value)
|
// if (!cl_timedemo->value)
|
||||||
if (!cl_timedemo->integer)
|
if (!cl_timedemo->integer)
|
||||||
|
@ -2681,15 +2716,15 @@ void CL_Frame (int msec)
|
||||||
|
|
||||||
// clamp this to acceptable values (don't allow infinite particles)
|
// clamp this to acceptable values (don't allow infinite particles)
|
||||||
if (cl_particle_scale->value < 1.0f)
|
if (cl_particle_scale->value < 1.0f)
|
||||||
Cvar_SetValue("cl_particle_scale", 1);
|
Cvar_SetValue ("cl_particle_scale", 1);
|
||||||
|
|
||||||
// clamp this to acceptable minimum length
|
// clamp this to acceptable minimum length
|
||||||
if (cl_rail_length->value < MIN_RAIL_LENGTH)
|
if (cl_rail_length->value < MIN_RAIL_LENGTH)
|
||||||
Cvar_SetValue("cl_rail_length", MIN_RAIL_LENGTH);
|
Cvar_SetValue ("cl_rail_length", MIN_RAIL_LENGTH);
|
||||||
|
|
||||||
// clamp this to acceptable minimum duration
|
// clamp this to acceptable minimum duration
|
||||||
if (r_decal_life->value < MIN_DECAL_LIFE)
|
if (r_decal_life->value < MIN_DECAL_LIFE)
|
||||||
Cvar_SetValue("r_decal_life", MIN_DECAL_LIFE);
|
Cvar_SetValue ("r_decal_life", MIN_DECAL_LIFE);
|
||||||
|
|
||||||
// if in the debugger last frame, don't timeout
|
// if in the debugger last frame, don't timeout
|
||||||
if (msec > 5000)
|
if (msec > 5000)
|
||||||
|
|
|
@ -816,8 +816,9 @@ void CL_GetChallengePacket (void);
|
||||||
void CL_PingServers_f (void);
|
void CL_PingServers_f (void);
|
||||||
void CL_Snd_Restart_f (void);
|
void CL_Snd_Restart_f (void);
|
||||||
void CL_WriteConfig_f (void);
|
void CL_WriteConfig_f (void);
|
||||||
|
#ifdef CLIENT_SPLIT_NETFRAME
|
||||||
void vectoangles2 (vec3_t value1, vec3_t angles);
|
void CL_SetFramerateCap (void);
|
||||||
|
#endif // CLIENT_SPLIT_NETFRAME
|
||||||
|
|
||||||
//
|
//
|
||||||
// cl_input
|
// cl_input
|
||||||
|
|
|
@ -6,6 +6,8 @@ Changes as of v0.20 update 8:
|
||||||
|
|
||||||
- Added 160Hz and 240Hz refresh rates.
|
- 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.
|
- 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.
|
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.
|
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( "vid_ref", "gl" );
|
||||||
Cvar_Set( "gl_driver", "opengl32" );
|
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
|
// tell them they're modified so they refresh
|
||||||
vid_ref->modified = true;
|
vid_ref->modified = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue