mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 12:52:46 +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 fps, timedifference;
|
||||||
float timescale = 1.0;
|
float timescale = 1.0;
|
||||||
|
|
||||||
|
if (cls.timedemo)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (cls.demoplayback) {
|
if (cls.demoplayback) {
|
||||||
timescale = max (0, cl_demospeed->value);
|
timescale = max (0, cl_demospeed->value);
|
||||||
time *= timescale;
|
time *= timescale;
|
||||||
|
@ -1457,14 +1460,14 @@ Host_SimulationTime (float time)
|
||||||
if (oldrealtime > realtime)
|
if (oldrealtime > realtime)
|
||||||
oldrealtime = 0;
|
oldrealtime = 0;
|
||||||
|
|
||||||
if (cl_maxfps->int_val)
|
if (!cl_maxfps->int_val)
|
||||||
fps = max (1, cl_maxfps->value);
|
|
||||||
else
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
fps = max (1, cl_maxfps->value);
|
||||||
|
|
||||||
timedifference = (timescale / fps) - (realtime - oldrealtime);
|
timedifference = (timescale / fps) - (realtime - oldrealtime);
|
||||||
|
|
||||||
if (!cls.timedemo && (timedifference > 0))
|
if (timedifference > 0)
|
||||||
return timedifference; // framerate is too high
|
return timedifference; // framerate is too high
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue