mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-15 20:20:54 +00:00
- 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:
parent
435e13dfa4
commit
ab06235971
2 changed files with 8 additions and 4 deletions
|
@ -350,7 +350,7 @@ static void Startup(void)
|
|||
SetDispatcher();
|
||||
S_InitSound();
|
||||
|
||||
timerInit(TICRATE);
|
||||
timerInit(GameTicRate);
|
||||
|
||||
loadcons();
|
||||
fi.initactorflags();
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue