- For I_GetInputFrac(), just have the caller check if input is synchronised.

This commit is contained in:
Mitchell Richters 2023-02-05 08:40:25 +11:00
parent 9961a66a1f
commit 2020860ffe
3 changed files with 7 additions and 12 deletions

View file

@ -210,17 +210,12 @@ void I_ResetFrameTime()
FirstFrameStartTime += (CurrentFrameStartTime - ft);
}
double I_GetInputFrac(bool const synchronised)
double I_GetInputFrac()
{
if (!synchronised)
{
const double now = I_msTimeF();
const double result = (now - lastinputtime) * GameTicRate * (1. / 1000.);
lastinputtime = now;
return result;
}
return 1;
}
void I_ResetInputTime()

View file

@ -42,7 +42,7 @@ uint64_t I_nsTime();
void I_ResetFrameTime();
// Return a decimal fraction to scale input operations at framerate
double I_GetInputFrac(bool const synchronised);
double I_GetInputFrac();
// Reset the last input check to after a lengthy operation
void I_ResetInputTime();

View file

@ -565,7 +565,7 @@ void TryRunTics (void)
oldentertics = entertic;
// update the scale factor for unsynchronised input here.
inputScale = I_GetInputFrac(SyncInput());
inputScale = !SyncInput() ? I_GetInputFrac() : 1.;
// get available tics
NetUpdate ();