cl_demospeed for nq

This commit is contained in:
Bill Currie 2001-09-06 04:35:02 +00:00
parent 4c7e60e73a
commit c2c0353e60

View file

@ -112,6 +112,8 @@ cvar_t *pausable;
cvar_t *temp1;
cvar_t *cl_demospeed;
extern cvar_t *cl_writecfg;
extern int fps_count;
@ -249,6 +251,10 @@ Host_InitLocal (void)
pausable = Cvar_Get ("pausable", "1", CVAR_NONE, NULL, "None");
temp1 = Cvar_Get ("temp1", "0", CVAR_NONE, NULL, "None");
cl_demospeed = Cvar_Get ("cl_demospeed", "1.0", CVAR_NONE, NULL,
"adjust demo playback speed. 1.0 = normal, "
"< 1 slow-mo, > 1 timelapse");
Host_FindMaxClients ();
host_time = 1.0; // so a think at time 0 won't get called
@ -495,9 +501,19 @@ Host_ClearMemory (void)
qboolean
Host_FilterTime (float time)
{
float timedifference;
float timescale = 1.0;
if (cls.demoplayback) {
timescale = max (0, cl_demospeed->value);
time *= timescale;
}
realtime += time;
if (!cls.timedemo && realtime - oldrealtime < 1.0 / 72.0)
timedifference = (timescale / 72.0) - (realtime - oldrealtime);
if (!cls.timedemo && (timedifference > 0))
return false; // framerate is too high
host_frametime = realtime - oldrealtime;