mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 00:41:55 +00:00
- For I_GetInputFrac()
, just have the caller check if input is synchronised.
This commit is contained in:
parent
9961a66a1f
commit
2020860ffe
3 changed files with 7 additions and 12 deletions
|
@ -210,17 +210,12 @@ void I_ResetFrameTime()
|
||||||
FirstFrameStartTime += (CurrentFrameStartTime - ft);
|
FirstFrameStartTime += (CurrentFrameStartTime - ft);
|
||||||
}
|
}
|
||||||
|
|
||||||
double I_GetInputFrac(bool const synchronised)
|
double I_GetInputFrac()
|
||||||
{
|
{
|
||||||
if (!synchronised)
|
|
||||||
{
|
|
||||||
const double now = I_msTimeF();
|
const double now = I_msTimeF();
|
||||||
const double result = (now - lastinputtime) * GameTicRate * (1. / 1000.);
|
const double result = (now - lastinputtime) * GameTicRate * (1. / 1000.);
|
||||||
lastinputtime = now;
|
lastinputtime = now;
|
||||||
return result;
|
return result;
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void I_ResetInputTime()
|
void I_ResetInputTime()
|
||||||
|
|
|
@ -42,7 +42,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 I_GetInputFrac();
|
||||||
|
|
||||||
// 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();
|
||||||
|
|
|
@ -565,7 +565,7 @@ void TryRunTics (void)
|
||||||
oldentertics = entertic;
|
oldentertics = entertic;
|
||||||
|
|
||||||
// update the scale factor for unsynchronised input here.
|
// update the scale factor for unsynchronised input here.
|
||||||
inputScale = I_GetInputFrac(SyncInput());
|
inputScale = !SyncInput() ? I_GetInputFrac() : 1.;
|
||||||
|
|
||||||
// get available tics
|
// get available tics
|
||||||
NetUpdate ();
|
NetUpdate ();
|
||||||
|
|
Loading…
Reference in a new issue