mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-17 01:11:45 +00:00
WOOHOO! The hardcoded framerate cap is gone! cl_maxfps 0 now allows an
unbounded frame rate (you can still set it to clamp your fps to, for example, your monitor's refresh rate), and cl_maxnetfps 0 is now based on your network rate. The NetQuake-compatible targets now also have an unbounded framerate. This is OK, because the built-in server uses its own tick rate.
This commit is contained in:
parent
7c134a6f95
commit
b2579dca98
4 changed files with 25 additions and 37 deletions
|
@ -510,7 +510,6 @@ Host_ClearMemory (void)
|
||||||
qboolean
|
qboolean
|
||||||
Host_FilterTime (float time)
|
Host_FilterTime (float time)
|
||||||
{
|
{
|
||||||
float timedifference;
|
|
||||||
float timescale = 1.0;
|
float timescale = 1.0;
|
||||||
|
|
||||||
if (cls.demoplayback) {
|
if (cls.demoplayback) {
|
||||||
|
@ -520,23 +519,13 @@ Host_FilterTime (float time)
|
||||||
|
|
||||||
realtime += time;
|
realtime += time;
|
||||||
|
|
||||||
timedifference = (timescale / 72.0) - (realtime - oldrealtime);
|
|
||||||
|
|
||||||
if (!cls.timedemo && (timedifference > 0))
|
|
||||||
return false; // framerate is too high
|
|
||||||
|
|
||||||
host_frametime = realtime - oldrealtime;
|
host_frametime = realtime - oldrealtime;
|
||||||
oldrealtime = realtime;
|
oldrealtime = realtime;
|
||||||
|
|
||||||
if (host_framerate->value > 0)
|
if (host_framerate->value > 0)
|
||||||
host_frametime = host_framerate->value;
|
host_frametime = host_framerate->value;
|
||||||
else { // don't allow really long or short
|
else // don't allow really long or short frames
|
||||||
// frames
|
host_frametime = bound (0.001, host_frametime, 0.1);
|
||||||
if (host_frametime > 0.1)
|
|
||||||
host_frametime = 0.1;
|
|
||||||
if (host_frametime < 0.001)
|
|
||||||
host_frametime = 0.001;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -313,6 +313,8 @@ extern struct cvar_s *cl_name;
|
||||||
|
|
||||||
extern struct cvar_s *cl_model_crcs;
|
extern struct cvar_s *cl_model_crcs;
|
||||||
|
|
||||||
|
extern struct cvar_s *rate;
|
||||||
|
|
||||||
extern struct cvar_s *show_ping;
|
extern struct cvar_s *show_ping;
|
||||||
extern struct cvar_s *show_pl;
|
extern struct cvar_s *show_pl;
|
||||||
|
|
||||||
|
|
|
@ -704,30 +704,27 @@ CL_SendCmd (void)
|
||||||
if (cls.demorecording)
|
if (cls.demorecording)
|
||||||
CL_WriteDemoCmd (cmd);
|
CL_WriteDemoCmd (cmd);
|
||||||
|
|
||||||
if (cl_maxnetfps->int_val) {
|
pps_balance += host_frametime;
|
||||||
pps_balance += host_frametime;
|
// never drop more than 2 messages in a row -- that'll cause PL
|
||||||
// never drop more than 2 messages in a row -- that'll cause PL
|
// and don't drop if one of the last two movemessages have an impulse
|
||||||
// and don't drop if one of the last two movemessages have an impulse
|
if (pps_balance > 0.0 || dropcount >= 2 || dontdrop) {
|
||||||
if (pps_balance > 0.0 || dropcount >= 2 || dontdrop) {
|
float pps;
|
||||||
float pps;
|
|
||||||
|
|
||||||
pps = cl_maxnetfps->int_val;
|
if (!(pps = cl_maxnetfps->int_val))
|
||||||
if (pps < 10) pps = 10;
|
pps = rate->value / 80.0;
|
||||||
if (pps > 72) pps = 72;
|
|
||||||
pps_balance -= 1.0 / pps;
|
pps = bound (1, pps, 72);
|
||||||
pps_balance = bound (-0.1, pps_balance, 0.1);
|
|
||||||
dropcount = 0;
|
pps_balance -= 1.0 / pps;
|
||||||
} else {
|
pps_balance = bound (-0.1, pps_balance, 0.1);
|
||||||
// don't count this message when calculating PL
|
|
||||||
cl.frames[i].receivedtime = -3;
|
|
||||||
// drop this message
|
|
||||||
cls.netchan.outgoing_sequence++;
|
|
||||||
dropcount++;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
pps_balance = 0;
|
|
||||||
dropcount = 0;
|
dropcount = 0;
|
||||||
|
} else {
|
||||||
|
// don't count this message when calculating PL
|
||||||
|
cl.frames[i].receivedtime = -3;
|
||||||
|
// drop this message
|
||||||
|
cls.netchan.outgoing_sequence++;
|
||||||
|
dropcount++;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// deliver the message
|
// deliver the message
|
||||||
|
|
|
@ -1458,9 +1458,9 @@ Host_SimulationTime (float time)
|
||||||
oldrealtime = 0;
|
oldrealtime = 0;
|
||||||
|
|
||||||
if (cl_maxfps->int_val)
|
if (cl_maxfps->int_val)
|
||||||
fps = bound (1, cl_maxfps->value, 72);
|
fps = max (1, cl_maxfps->value);
|
||||||
else
|
else
|
||||||
fps = bound (30, rate->value / 80.0, 72);
|
return 0;
|
||||||
|
|
||||||
timedifference = (timescale / fps) - (realtime - oldrealtime);
|
timedifference = (timescale / fps) - (realtime - oldrealtime);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue