- Duke: Demonstration of a re-timed game and associated interpolation improvements that come from it.

# Conflicts:
#	source/games/duke/src/game.cpp
This commit is contained in:
Mitchell Richters 2020-08-25 15:06:29 +10:00 committed by Christoph Oelckers
parent 435e13dfa4
commit ab06235971
2 changed files with 8 additions and 4 deletions

View file

@ -350,7 +350,7 @@ static void Startup(void)
SetDispatcher();
S_InitSound();
timerInit(TICRATE);
timerInit(GameTicRate);
loadcons();
fi.initactorflags();

View file

@ -308,6 +308,8 @@ static void checkTimerActive()
//
//---------------------------------------------------------------------------
static int lastTic;
bool GameTicker()
{
if (ps[myconnectindex].gm == MODE_DEMO)
@ -327,9 +329,11 @@ bool GameTicker()
gameupdatetime.Reset();
gameupdatetime.Clock();
while (playrunning() && (int)(totalclock - ototalclock) >= TICSPERFRAME)
int currentTic = I_GetTime();
if (playrunning() && currentTic - lastTic >= 1)
{
ototalclock += TICSPERFRAME;
lastTic = currentTic;
GetInput();
auto const pPlayer = &ps[myconnectindex];
@ -356,7 +360,7 @@ bool GameTicker()
{
ototalclock = totalclock - 1;
}
double const smoothRatio = calc_smoothratio(totalclock, ototalclock);
double const smoothRatio = I_GetTimeFrac() * 65536.;
gameupdatetime.Unclock();