]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
moved the code that applies slowmo to demo playback so that it reacts
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 17 May 2007 18:58:54 +0000 (18:58 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 17 May 2007 18:58:54 +0000 (18:58 +0000)
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
host.c

index d0eb0098e2b406e6dc941634cf23e39c971eb623..8bea16775b5ccb42d8ecbf2dea9bd9bf91773062 100644 (file)
@@ -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 de12e31f8bd158d0680bbf3c70c4986aed9530ea..66f4fa76a5478d8a74dfe40cff4221a17959ab73 100644 (file)
--- 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)