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:
Jeff Teunissen 2002-04-25 16:50:56 +00:00
parent 7c134a6f95
commit b2579dca98
4 changed files with 25 additions and 37 deletions

View file

@ -510,7 +510,6 @@ Host_ClearMemory (void)
qboolean
Host_FilterTime (float time)
{
float timedifference;
float timescale = 1.0;
if (cls.demoplayback) {
@ -520,23 +519,13 @@ Host_FilterTime (float time)
realtime += time;
timedifference = (timescale / 72.0) - (realtime - oldrealtime);
if (!cls.timedemo && (timedifference > 0))
return false; // framerate is too high
host_frametime = realtime - oldrealtime;
oldrealtime = realtime;
if (host_framerate->value > 0)
host_frametime = host_framerate->value;
else { // don't allow really long or short
// frames
if (host_frametime > 0.1)
host_frametime = 0.1;
if (host_frametime < 0.001)
host_frametime = 0.001;
}
else // don't allow really long or short frames
host_frametime = bound (0.001, host_frametime, 0.1);
return true;
}

View file

@ -313,6 +313,8 @@ extern struct cvar_s *cl_name;
extern struct cvar_s *cl_model_crcs;
extern struct cvar_s *rate;
extern struct cvar_s *show_ping;
extern struct cvar_s *show_pl;

View file

@ -704,30 +704,27 @@ CL_SendCmd (void)
if (cls.demorecording)
CL_WriteDemoCmd (cmd);
if (cl_maxnetfps->int_val) {
pps_balance += host_frametime;
// 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
if (pps_balance > 0.0 || dropcount >= 2 || dontdrop) {
float pps;
pps_balance += host_frametime;
// 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
if (pps_balance > 0.0 || dropcount >= 2 || dontdrop) {
float pps;
pps = cl_maxnetfps->int_val;
if (pps < 10) pps = 10;
if (pps > 72) pps = 72;
pps_balance -= 1.0 / pps;
pps_balance = bound (-0.1, pps_balance, 0.1);
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;
}
} else {
pps_balance = 0;
if (!(pps = cl_maxnetfps->int_val))
pps = rate->value / 80.0;
pps = bound (1, pps, 72);
pps_balance -= 1.0 / pps;
pps_balance = bound (-0.1, pps_balance, 0.1);
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

View file

@ -1458,9 +1458,9 @@ Host_SimulationTime (float time)
oldrealtime = 0;
if (cl_maxfps->int_val)
fps = bound (1, cl_maxfps->value, 72);
fps = max (1, cl_maxfps->value);
else
fps = bound (30, rate->value / 80.0, 72);
return 0;
timedifference = (timescale / fps) - (realtime - oldrealtime);