]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
do not allow cl_netfps to be below the server framerate (as indicated by
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 11 Sep 2009 14:38:34 +0000 (14:38 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 11 Sep 2009 14:38:34 +0000 (14:38 +0000)
sys_ticrate) if possible, to avoid jerky player movement

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9182 d7cf8633-e32d-0410-b094-e92efae38249

cl_input.c
client.h

index abe87409f180b2f771a2fe9c7f6a117d1046b76d..9b70e21e933c3e921c4534091a79a27fdd19cc8c 100644 (file)
@@ -1338,6 +1338,7 @@ void CL_UpdateMoveVars(void)
        }
        else if (cl.stats[STAT_MOVEVARS_TICRATE])
        {
        }
        else if (cl.stats[STAT_MOVEVARS_TICRATE])
        {
+               cl.movevars_ticrate = cl.statsf[STAT_MOVEVARS_TICRATE];
                cl.movevars_timescale = cl.statsf[STAT_MOVEVARS_TIMESCALE];
                cl.movevars_gravity = cl.statsf[STAT_MOVEVARS_GRAVITY];
                cl.movevars_stopspeed = cl.statsf[STAT_MOVEVARS_STOPSPEED] ;
                cl.movevars_timescale = cl.statsf[STAT_MOVEVARS_TIMESCALE];
                cl.movevars_gravity = cl.statsf[STAT_MOVEVARS_GRAVITY];
                cl.movevars_stopspeed = cl.statsf[STAT_MOVEVARS_STOPSPEED] ;
@@ -1368,6 +1369,7 @@ void CL_UpdateMoveVars(void)
        }
        else
        {
        }
        else
        {
+               cl.movevars_ticrate = slowmo.value / bound(1.0f, cl_netfps.value, 1000.0f);
                cl.movevars_timescale = slowmo.value;
                cl.movevars_gravity = sv_gravity.value;
                cl.movevars_stopspeed = cl_movement_stopspeed.value;
                cl.movevars_timescale = slowmo.value;
                cl.movevars_gravity = sv_gravity.value;
                cl.movevars_stopspeed = cl_movement_stopspeed.value;
@@ -1655,6 +1657,11 @@ void CL_SendMove(void)
        // don't send too often or else network connections can get clogged by a
        // high renderer framerate
        packettime = 1.0 / bound(1, cl_netfps.value, 1000);
        // don't send too often or else network connections can get clogged by a
        // high renderer framerate
        packettime = 1.0 / bound(1, cl_netfps.value, 1000);
+       if (cl.movevars_timescale && cl.movevars_ticrate)
+       {
+               float maxtic = cl.movevars_ticrate / cl.movevars_timescale;
+               packettime = min(packettime, maxtic);
+       }
        // send input every frame in singleplayer
        if (cl.islocalgame)
                packettime = 0;
        // send input every frame in singleplayer
        if (cl.islocalgame)
                packettime = 0;
index 4992adad087c561a367bf64375dcacacf9d19528..60e76f43c2f52c3e31b22d16d809ebc3c368ad08 100644 (file)
--- a/client.h
+++ b/client.h
@@ -1076,6 +1076,7 @@ typedef struct client_state_s
        float movevars_warsowbunny_topspeed;
        float movevars_warsowbunny_turnaccel;
        float movevars_warsowbunny_backtosideratio;
        float movevars_warsowbunny_topspeed;
        float movevars_warsowbunny_turnaccel;
        float movevars_warsowbunny_backtosideratio;
+       float movevars_ticrate;
 
        // models used by qw protocol
        int qw_modelindex_spike;
 
        // models used by qw protocol
        int qw_modelindex_spike;