From 4223aaa4c006702cb74f9c8988e40389dcb7d309 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 25 Apr 2002 17:16:40 +0000 Subject: [PATCH] a couple of very minor optimisations --- qw/source/cl_main.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/qw/source/cl_main.c b/qw/source/cl_main.c index 0dbea4575..8e5400d61 100644 --- a/qw/source/cl_main.c +++ b/qw/source/cl_main.c @@ -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; }