a couple of very minor optimisations

This commit is contained in:
Bill Currie 2002-04-25 17:16:40 +00:00
parent b2579dca98
commit 4223aaa4c0

View file

@ -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;
} }