- Remove the ability to set a custom ticrate in calls to I_GetInputFrac(). There's no real world need for this.

This commit is contained in:
Mitchell Richters 2022-06-06 18:26:24 +10:00
parent 20dde9fabc
commit 47aa110441
2 changed files with 4 additions and 4 deletions

View file

@ -198,12 +198,12 @@ void I_ResetFrameTime()
FirstFrameStartTime += (CurrentFrameStartTime - ft); FirstFrameStartTime += (CurrentFrameStartTime - ft);
} }
double I_GetInputFrac(bool const synchronised, double const ticrate) double I_GetInputFrac(bool const synchronised)
{ {
if (!synchronised) if (!synchronised)
{ {
const double now = I_msTimeF(); const double now = I_msTimeF();
const double result = (now - lastinputtime) * ticrate * (1. / 1000.); const double result = (now - lastinputtime) * GameTicRate * (1. / 1000.);
lastinputtime = now; lastinputtime = now;
if (result < 1) if (result < 1)
@ -213,7 +213,7 @@ double I_GetInputFrac(bool const synchronised, double const ticrate)
// This rectifies a deviation of 100+ ms or more depending on the length // This rectifies a deviation of 100+ ms or more depending on the length
// of the operation to be within 1-2 ms of synchronised input // of the operation to be within 1-2 ms of synchronised input
// from 60 fps to at least 1000 fps at ticrates of 30 and 40 Hz. // from 60 fps to at least 1000 fps at ticrates of 30 and 40 Hz.
return result * (1. + 0.35 * (1. - ticrate * (1. / 50.)) * (1. - result)); return result * (1. + 0.35 * (1. - GameTicRate * (1. / 50.)) * (1. - result));
} }
} }

View file

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