mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
- fix interpolation stutters when opening console for RR.
This commit is contained in:
parent
d8e3d60e85
commit
e0e06284a5
1 changed files with 45 additions and 38 deletions
|
@ -7291,48 +7291,55 @@ MAIN_LOOP_RESTART:
|
|||
|
||||
char gameUpdate = false;
|
||||
double const gameUpdateStartTime = timerGetHiTicks();
|
||||
|
||||
while (((g_netClient || g_netServer) || !(g_player[myconnectindex].ps->gm & (MODE_MENU|MODE_DEMO))) && (int)(totalclock - ototalclock) >= TICSPERFRAME)
|
||||
|
||||
if (M_Active() || GUICapture || ud.pause_on != 0)
|
||||
{
|
||||
ototalclock += TICSPERFRAME;
|
||||
|
||||
if (RRRA && g_player[myconnectindex].ps->on_motorcycle)
|
||||
P_GetInputMotorcycle(myconnectindex);
|
||||
else if (RRRA && g_player[myconnectindex].ps->on_boat)
|
||||
P_GetInputBoat(myconnectindex);
|
||||
else
|
||||
P_GetInput(myconnectindex);
|
||||
|
||||
// this is where we fill the input_t struct that is actually processed by P_ProcessInput()
|
||||
auto const pPlayer = g_player[myconnectindex].ps;
|
||||
auto const q16ang = fix16_to_int(pPlayer->q16ang);
|
||||
auto & input = inputfifo[g_player[myconnectindex].movefifoend&(MOVEFIFOSIZ-1)][myconnectindex];
|
||||
|
||||
input = localInput;
|
||||
input.fvel = mulscale9(localInput.fvel, sintable[(q16ang + 2560) & 2047]) +
|
||||
mulscale9(localInput.svel, sintable[(q16ang + 2048) & 2047]) +
|
||||
pPlayer->fric.x;
|
||||
input.svel = mulscale9(localInput.fvel, sintable[(q16ang + 2048) & 2047]) +
|
||||
mulscale9(localInput.svel, sintable[(q16ang + 1536) & 2047]) +
|
||||
pPlayer->fric.y;
|
||||
localInput = {};
|
||||
|
||||
g_player[myconnectindex].movefifoend++;
|
||||
|
||||
if (((!GUICapture && (g_player[myconnectindex].ps->gm&MODE_MENU) != MODE_MENU) || ud.recstat == 2 || (g_netServer || ud.multimode > 1)) &&
|
||||
(g_player[myconnectindex].ps->gm&MODE_GAME))
|
||||
{
|
||||
G_MoveLoop();
|
||||
}
|
||||
totalclock = ototalclock + TICSPERFRAME;
|
||||
}
|
||||
else
|
||||
{
|
||||
while (((g_netClient || g_netServer) || !(g_player[myconnectindex].ps->gm & (MODE_MENU|MODE_DEMO))) && (int)(totalclock - ototalclock) >= TICSPERFRAME)
|
||||
{
|
||||
ototalclock += TICSPERFRAME;
|
||||
|
||||
gameUpdate = true;
|
||||
g_gameUpdateTime = timerGetHiTicks()-gameUpdateStartTime;
|
||||
if (g_gameUpdateAvgTime < 0.f)
|
||||
g_gameUpdateAvgTime = g_gameUpdateTime;
|
||||
g_gameUpdateAvgTime = ((GAMEUPDATEAVGTIMENUMSAMPLES-1.f)*g_gameUpdateAvgTime+g_gameUpdateTime)/((float) GAMEUPDATEAVGTIMENUMSAMPLES);
|
||||
if (RRRA && g_player[myconnectindex].ps->on_motorcycle)
|
||||
P_GetInputMotorcycle(myconnectindex);
|
||||
else if (RRRA && g_player[myconnectindex].ps->on_boat)
|
||||
P_GetInputBoat(myconnectindex);
|
||||
else
|
||||
P_GetInput(myconnectindex);
|
||||
|
||||
G_DoCheats();
|
||||
// this is where we fill the input_t struct that is actually processed by P_ProcessInput()
|
||||
auto const pPlayer = g_player[myconnectindex].ps;
|
||||
auto const q16ang = fix16_to_int(pPlayer->q16ang);
|
||||
auto & input = inputfifo[g_player[myconnectindex].movefifoend&(MOVEFIFOSIZ-1)][myconnectindex];
|
||||
|
||||
input = localInput;
|
||||
input.fvel = mulscale9(localInput.fvel, sintable[(q16ang + 2560) & 2047]) +
|
||||
mulscale9(localInput.svel, sintable[(q16ang + 2048) & 2047]) +
|
||||
pPlayer->fric.x;
|
||||
input.svel = mulscale9(localInput.fvel, sintable[(q16ang + 2048) & 2047]) +
|
||||
mulscale9(localInput.svel, sintable[(q16ang + 1536) & 2047]) +
|
||||
pPlayer->fric.y;
|
||||
localInput = {};
|
||||
|
||||
g_player[myconnectindex].movefifoend++;
|
||||
|
||||
if (((g_player[myconnectindex].ps->gm&MODE_MENU) != MODE_MENU || ud.recstat == 2 || (g_netServer || ud.multimode > 1)) &&
|
||||
(g_player[myconnectindex].ps->gm&MODE_GAME))
|
||||
{
|
||||
G_MoveLoop();
|
||||
}
|
||||
}
|
||||
|
||||
gameUpdate = true;
|
||||
g_gameUpdateTime = timerGetHiTicks()-gameUpdateStartTime;
|
||||
if (g_gameUpdateAvgTime < 0.f)
|
||||
g_gameUpdateAvgTime = g_gameUpdateTime;
|
||||
g_gameUpdateAvgTime = ((GAMEUPDATEAVGTIMENUMSAMPLES-1.f)*g_gameUpdateAvgTime+g_gameUpdateTime)/((float) GAMEUPDATEAVGTIMENUMSAMPLES);
|
||||
|
||||
G_DoCheats();
|
||||
}
|
||||
|
||||
if (g_player[myconnectindex].ps->gm & (MODE_EOL|MODE_RESTART))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue