From 1d1b21efb222f91ce3bb373b54cae2c121a4d161 Mon Sep 17 00:00:00 2001 From: havoc Date: Thu, 17 May 2007 18:58:54 +0000 Subject: [PATCH] moved the code that applies slowmo to demo playback so that it reacts immediately to changes, not at the next packet read (which may never come if slowmo was set to 0 at any point) made pausedemo command freeze demo playback in a way that time does not advance, preventing the problem where it fast forwards to catch up with where it would have been if not paused after unpausing the demo git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7306 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_input.c | 9 --------- host.c | 8 ++++++++ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/cl_input.c b/cl_input.c index d0eb0098..8bea1677 100644 --- a/cl_input.c +++ b/cl_input.c @@ -1048,13 +1048,7 @@ extern cvar_t slowmo; void CL_UpdateMoveVars(void) { if (cls.protocol == PROTOCOL_QUAKEWORLD) - { - cl.movevars_timescale = 1; cl.movevars_ticrate = 1.0 / bound(1, cl_netinputpacketspersecond.value, 100); - // scale playback speed of demos by slowmo cvar - if (cls.demoplayback) - cl.movevars_timescale *= slowmo.value; - } else if (cl.stats[STAT_MOVEVARS_TICRATE]) { cl.movevars_ticrate = cl.statsf[STAT_MOVEVARS_TICRATE]; @@ -1076,9 +1070,6 @@ void CL_UpdateMoveVars(void) cl.movevars_friction = cl.statsf[STAT_MOVEVARS_FRICTION]; cl.movevars_wallfriction = cl.statsf[STAT_MOVEVARS_WALLFRICTION]; cl.movevars_waterfriction = cl.statsf[STAT_MOVEVARS_WATERFRICTION]; - // scale playback speed of demos by slowmo cvar - if (cls.demoplayback) - cl.movevars_timescale *= slowmo.value; } else { diff --git a/host.c b/host.c index de12e31f..66f4fa76 100644 --- a/host.c +++ b/host.c @@ -723,6 +723,14 @@ void Host_Main(void) // apply slowmo scaling clframetime *= cl.movevars_timescale; + // scale playback speed of demos by slowmo cvar + if (cls.demoplayback) + { + clframetime *= slowmo.value; + // if demo playback is paused, don't advance time at all + if (cls.demopaused) + clframetime = 0; + } // host_framerate overrides all else if (host_framerate.value) -- 2.39.2