mirror of
https://github.com/nzp-team/dquakeplus.git
synced 2025-02-27 13:41:32 +00:00
Implement host_timescale; replace host_frametime
This commit is contained in:
parent
a2ce78450d
commit
8558301901
2 changed files with 11 additions and 14 deletions
|
@ -83,6 +83,8 @@ cvar_t pausable = {"pausable","1"};
|
||||||
|
|
||||||
cvar_t temp1 = {"temp1","0"};
|
cvar_t temp1 = {"temp1","0"};
|
||||||
|
|
||||||
|
cvar_t host_timescale = {"host_timescale", "0"}; //johnfitz
|
||||||
|
|
||||||
qboolean bmg_type_changed = false;
|
qboolean bmg_type_changed = false;
|
||||||
|
|
||||||
|
|
||||||
|
@ -239,6 +241,7 @@ void Host_InitLocal (void)
|
||||||
Cvar_RegisterVariable (&pausable);
|
Cvar_RegisterVariable (&pausable);
|
||||||
|
|
||||||
Cvar_RegisterVariable (&temp1);
|
Cvar_RegisterVariable (&temp1);
|
||||||
|
Cvar_RegisterVariable (&host_timescale);
|
||||||
|
|
||||||
Host_FindMaxClients ();
|
Host_FindMaxClients ();
|
||||||
|
|
||||||
|
@ -537,11 +540,6 @@ qboolean Host_FilterTime (float time)
|
||||||
{
|
{
|
||||||
realtime += time;
|
realtime += time;
|
||||||
|
|
||||||
/* dr_mabuse1981: old dquake values commented out
|
|
||||||
if (!cls.timedemo && realtime - oldrealtime < 1.0/250.0)
|
|
||||||
return false; // framerate is too high
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (cl_maxfps.value < 1) Cvar_SetValue("cl_maxfps", 30);
|
if (cl_maxfps.value < 1) Cvar_SetValue("cl_maxfps", 30);
|
||||||
if (!cls.timedemo && realtime - oldrealtime < 1.0/cl_maxfps.value)
|
if (!cls.timedemo && realtime - oldrealtime < 1.0/cl_maxfps.value)
|
||||||
return false; // framerate is too high
|
return false; // framerate is too high
|
||||||
|
@ -549,15 +547,14 @@ qboolean Host_FilterTime (float time)
|
||||||
host_frametime = realtime - oldrealtime;
|
host_frametime = realtime - oldrealtime;
|
||||||
oldrealtime = realtime;
|
oldrealtime = realtime;
|
||||||
|
|
||||||
if (host_framerate.value > 0)
|
//johnfitz -- host_timescale is more intuitive than host_framerate
|
||||||
|
if (host_timescale.value > 0)
|
||||||
|
host_frametime *= host_timescale.value;
|
||||||
|
//johnfitz
|
||||||
|
else if (host_framerate.value > 0)
|
||||||
host_frametime = host_framerate.value;
|
host_frametime = host_framerate.value;
|
||||||
else
|
else // don't allow really long or short frames
|
||||||
{ // don't allow really long or short frames
|
host_frametime = CLAMP (0.001, host_frametime, 0.1); //johnfitz -- use CLAMP
|
||||||
if (host_frametime > 0.1)
|
|
||||||
host_frametime = 0.1;
|
|
||||||
if (host_frametime < 0.001)
|
|
||||||
host_frametime = 0.001;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -494,6 +494,6 @@ byte *W_GetTextureHL(char *name)
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
tex->width = tex->width = 0;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue