mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-27 06:34:11 +00:00
a couple of very minor optimisations
This commit is contained in:
parent
b2579dca98
commit
4223aaa4c0
1 changed files with 7 additions and 4 deletions
|
@ -1448,6 +1448,9 @@ Host_SimulationTime (float time)
|
|||
float fps, timedifference;
|
||||
float timescale = 1.0;
|
||||
|
||||
if (cls.timedemo)
|
||||
return 0;
|
||||
|
||||
if (cls.demoplayback) {
|
||||
timescale = max (0, cl_demospeed->value);
|
||||
time *= timescale;
|
||||
|
@ -1457,14 +1460,14 @@ Host_SimulationTime (float time)
|
|||
if (oldrealtime > realtime)
|
||||
oldrealtime = 0;
|
||||
|
||||
if (cl_maxfps->int_val)
|
||||
fps = max (1, cl_maxfps->value);
|
||||
else
|
||||
if (!cl_maxfps->int_val)
|
||||
return 0;
|
||||
|
||||
fps = max (1, cl_maxfps->value);
|
||||
|
||||
timedifference = (timescale / fps) - (realtime - oldrealtime);
|
||||
|
||||
if (!cls.timedemo && (timedifference > 0))
|
||||
if (timedifference > 0)
|
||||
return timedifference; // framerate is too high
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue