diff --git a/source/blood/src/view.cpp b/source/blood/src/view.cpp index 4c76b35b6..f70e717f2 100644 --- a/source/blood/src/view.cpp +++ b/source/blood/src/view.cpp @@ -3088,7 +3088,7 @@ void viewDrawScreen(bool sceneonly) lastUpdate = totalclock; if (!paused && (!M_Active() || gGameOptions.nGameType != 0)) { - gInterpolate = ((totalclock-gNetFifoClock)+4).toScale16()/4; + gInterpolate = ((totalclock - gNetFifoClock) + 4) << 14;// .toScale16() / 4; } if (gInterpolate < 0 || gInterpolate > 65536) { diff --git a/source/build/include/clockticks.hpp b/source/build/include/clockticks.hpp index d4a6948dd..d74075c5c 100644 --- a/source/build/include/clockticks.hpp +++ b/source/build/include/clockticks.hpp @@ -17,6 +17,7 @@ // (so we might as well check it). EDUKE32_STATIC_ASSERT(-1 >> 1 == -1); +#if 0 class ClockTicks { public: @@ -159,5 +160,8 @@ private: ticksS32 &= VALUE_MASK; } }; +#else +using ClockTicks = int; +#endif #endif /* CLOCKTICKS_HPP_ */ diff --git a/source/build/src/timer.cpp b/source/build/src/timer.cpp index 8fc00ade3..5cba8cd21 100644 --- a/source/build/src/timer.cpp +++ b/source/build/src/timer.cpp @@ -45,7 +45,6 @@ ATTRIBUTE((flatten)) void timerUpdateClock(void) uint64_t numerator = (elapsedTime.count() * (uint64_t) timerticspersec * steady_clock::period::num); uint64_t freq = timerGetFreqU64(); int n = tabledivide64(numerator, freq); - totalclock.setFraction(tabledivide64((numerator - n*timerGetFreqU64()) * 65536, freq)); if (n <= 0) return; diff --git a/source/core/gamecontrol.cpp b/source/core/gamecontrol.cpp index 118bd98b0..cee6208c3 100644 --- a/source/core/gamecontrol.cpp +++ b/source/core/gamecontrol.cpp @@ -1031,13 +1031,12 @@ int CalcSmoothRatio(const ClockTicks &totalclk, const ClockTicks &ototalclk, int const double TICRATE = 120.; double rfreq = refreshfreq * TICRATE / timerGetClockRate(); - double elapsedTime = (totalclk - ototalclk).toScale16F(); + double elapsedTime = (totalclk - ototalclk); double elapsedFrames = elapsedTime * rfreq * (1. / TICRATE); double ratio = (elapsedFrames * realgameticspersec) / rfreq; return clamp(xs_RoundToInt(ratio * 65536), 0, 65536); } - FString G_GetDemoPath() { FString path = M_GetDemoPath();