Merge branch 'master' into back_to_basics2

# Conflicts:
#	source/blood/src/view.cpp
#	source/core/gamecontrol.cpp
This commit is contained in:
Christoph Oelckers 2020-07-14 12:57:38 +02:00
commit a93ed1e502
3 changed files with 6 additions and 10 deletions

View file

@ -3088,12 +3088,10 @@ void viewDrawScreen(bool sceneonly)
lastUpdate = totalclock;
if (!paused && (!M_Active() || gGameOptions.nGameType != 0))
{
gInterpolate = ((totalclock - gNetFifoClock) + 4) << 14;// .toScale16() / 4;
}
if (gInterpolate < 0 || gInterpolate > 65536)
{
gInterpolate = ClipRange(gInterpolate, 0, 65536);
gInterpolate = CalcSmoothRatio(totalclock, gNetFifoClock - 4, 30);
}
else gInterpolate = 65536;
if (cl_interpolate)
{
CalcInterpolations();

View file

@ -497,8 +497,7 @@ void ProcessMouseMoveInGame(NSEvent* theEvent)
if (!m_noprescale)
{
x *= 3;
y *= 2;
x <<= 2;
}
event_t event = {};

View file

@ -1030,10 +1030,9 @@ int CalcSmoothRatio(const ClockTicks &totalclk, const ClockTicks &ototalclk, int
{
const double TICRATE = 120.;
double rfreq = refreshfreq * TICRATE / timerGetClockRate();
double elapsedTime = (totalclk - ototalclk);
double elapsedFrames = elapsedTime * rfreq * (1. / TICRATE);
double ratio = (elapsedFrames * realgameticspersec) / rfreq;
double elapsedFrames = elapsedTime * (1. / TICRATE);
double ratio = (elapsedFrames * realgameticspersec);
return clamp(xs_RoundToInt(ratio * 65536), 0, 65536);
}