MCPcopy Create free account
hub / github.com/ddnet/ddnet / GetSmoothTick

Method GetSmoothTick

src/engine/client/client.cpp:5134–5142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5132}
5133
5134void CClient::GetSmoothTick(int *pSmoothTick, float *pSmoothIntraTick, float MixAmount)
5135{
5136 int64_t GameTime = m_aGameTime[g_Config.m_ClDummy].Get(time_get());
5137 int64_t PredTime = m_PredictedTime.Get(time_get());
5138 int64_t SmoothTime = std::clamp(GameTime + (int64_t)(MixAmount * (PredTime - GameTime)), GameTime, PredTime);
5139
5140 *pSmoothTick = (int)(SmoothTime * GameTickSpeed() / time_freq()) + 1;
5141 *pSmoothIntraTick = (SmoothTime - (*pSmoothTick - 1) * time_freq() / GameTickSpeed()) / (float)(time_freq() / GameTickSpeed());
5142}
5143
5144void CClient::AddWarning(const SWarning &Warning)
5145{

Callers 1

GetSmoothPosMethod · 0.80

Calls 3

time_getFunction · 0.85
time_freqFunction · 0.85
GetMethod · 0.45

Tested by

no test coverage detected