implemented sv_fixedframeratesingleplayer cvar
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 4 Nov 2005 13:24:15 +0000 (13:24 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 4 Nov 2005 13:24:15 +0000 (13:24 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5788 d7cf8633-e32d-0410-b094-e92efae38249

cl_input.c
cl_main.c
cl_parse.c
host.c
server.h
sv_main.c

index 3c8a514..6cd5315 100644 (file)
@@ -56,8 +56,6 @@ kbutton_t     in_button3, in_button4, in_button5, in_button6, in_button7, in_button8
 
 int                    in_impulse;
 
-extern cvar_t sys_ticrate;
-
 
 void KeyDown (kbutton_t *b)
 {
index ca17674..4b0ab04 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -426,7 +426,7 @@ static float CL_LerpPoint(void)
 
        // LordHavoc: lerp in listen games as the server is being capped below the client (usually)
        f = cl.mtime[0] - cl.mtime[1];
-       if (!f || cl_nolerp.integer || cls.timedemo || cl.islocalgame)
+       if (!f || cl_nolerp.integer || cls.timedemo || (cl.islocalgame && !sv_fixedframeratesingleplayer.integer))
        {
                cl.time = cl.mtime[0];
                return 1;
index 2ecbd6d..a5aea07 100644 (file)
@@ -574,7 +574,7 @@ void CL_MoveLerpEntityStates(entity_t *ent)
                // not a monster
                ent->persistent.lerpstarttime = ent->state_previous.time;
                // no lerp if it's singleplayer
-               if (cl.islocalgame)
+               if (cl.islocalgame && !sv_fixedframeratesingleplayer.integer)
                        ent->persistent.lerpdeltatime = 0;
                else
                        ent->persistent.lerpdeltatime = bound(0, ent->state_current.time - ent->state_previous.time, 0.1);
diff --git a/host.c b/host.c
index ae8f61b..67ee4c1 100644 (file)
--- a/host.c
+++ b/host.c
@@ -71,6 +71,7 @@ cvar_t cl_maxfps = {CVAR_SAVE, "cl_maxfps", "1000"};
 cvar_t sv_echobprint = {CVAR_SAVE, "sv_echobprint", "1"};
 
 cvar_t sys_ticrate = {CVAR_SAVE, "sys_ticrate","0.05"};
+cvar_t sv_fixedframeratesingleplayer = {0, "sv_fixedframeratesingleplayer", "0"};
 cvar_t serverprofile = {0, "serverprofile","0"};
 
 cvar_t fraglimit = {CVAR_NOTIFY, "fraglimit","0"};
@@ -225,6 +226,7 @@ void Host_InitLocal (void)
        Cvar_RegisterVariable (&sv_echobprint);
 
        Cvar_RegisterVariable (&sys_ticrate);
+       Cvar_RegisterVariable (&sv_fixedframeratesingleplayer);
        Cvar_RegisterVariable (&serverprofile);
 
        Cvar_RegisterVariable (&fraglimit);
@@ -670,7 +672,7 @@ void Host_ServerFrame (void)
                // setup the VM frame
                SV_VM_Begin();
 
-               if (cl.islocalgame)
+               if (cl.islocalgame && !sv_fixedframeratesingleplayer.integer)
                        advancetime = min(sv.timer, sys_ticrate.value);
                else
                        advancetime = sys_ticrate.value;
index bbe9315..f71a1f1 100644 (file)
--- a/server.h
+++ b/server.h
@@ -276,6 +276,9 @@ extern cvar_t sv_gameplayfix_setmodelrealbox;
 extern cvar_t sv_gameplayfix_blowupfallenzombies;
 extern cvar_t sv_gameplayfix_findradiusdistancetobox;
 
+extern cvar_t sys_ticrate;
+extern cvar_t sv_fixedframeratesingleplayer;
+
 extern mempool_t *sv_mempool;
 
 // persistant server info
index 7afb4cb..99ece14 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -34,8 +34,6 @@ static cvar_t sv_cullentities_trace = {0, "sv_cullentities_trace", "0"}; // tend
 static cvar_t sv_cullentities_stats = {0, "sv_cullentities_stats", "0"};
 static cvar_t sv_entpatch = {0, "sv_entpatch", "1"};
 
-extern cvar_t sys_ticrate;
-
 cvar_t sv_gameplayfix_grenadebouncedownslopes = {0, "sv_gameplayfix_grenadebouncedownslopes", "1"};
 cvar_t sv_gameplayfix_noairborncorpse = {0, "sv_gameplayfix_noairborncorpse", "1"};
 cvar_t sv_gameplayfix_stepdown = {0, "sv_gameplayfix_stepdown", "1"};