Oops, i've missed do while here

# Conflicts:
#	source/rr/src/game.cpp
This commit is contained in:
nukeykt 2019-12-15 10:48:04 +09:00 committed by Christoph Oelckers
parent d23b4a7e33
commit 1719b70559
1 changed files with 44 additions and 41 deletions

View File

@ -7624,54 +7624,57 @@ MAIN_LOOP_RESTART:
double const gameUpdateStartTime = timerGetHiTicks();
if (((g_netClient || g_netServer) || !(g_player[myconnectindex].ps->gm & (MODE_MENU|MODE_DEMO))) && totalclock >= ototalclock+TICSPERFRAME)
{
//if (g_networkMode != NET_DEDICATED_SERVER)
//{
// 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);
//}
//Bmemcpy(&inputfifo[0][myconnectindex], &localInput, sizeof(input_t));
if (!frameJustDrawn)
break;
frameJustDrawn = false;
do
{
if (ready2send == 0) break;
Net_GetInput();
//if (g_networkMode != NET_DEDICATED_SERVER)
//{
// 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);
//}
ototalclock += TICSPERFRAME;
//Bmemcpy(&inputfifo[0][myconnectindex], &localInput, sizeof(input_t));
int const moveClock = (int) totalclock;
if (!frameJustDrawn)
break;
if (((ud.show_help == 0 && !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();
S_Update();
}
frameJustDrawn = false;
if (totalclock - moveClock >= TICSPERFRAME)
{
// computing a tic takes longer than a tic, so we're slowing
// the game down. rather than tightly spinning here, go draw
// a frame since we're fucked anyway
break;
}
}
while (((g_netClient || g_netServer) || !(g_player[myconnectindex].ps->gm & (MODE_MENU|MODE_DEMO))) && totalclock >= ototalclock+TICSPERFRAME);
do
{
if (ready2send == 0) break;
Net_GetInput();
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);
ototalclock += TICSPERFRAME;
int const moveClock = (int) totalclock;
if (((ud.show_help == 0 && !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();
S_Update();
}
if (totalclock - moveClock >= TICSPERFRAME)
{
// computing a tic takes longer than a tic, so we're slowing
// the game down. rather than tightly spinning here, go draw
// a frame since we're fucked anyway
break;
}
}
while (((g_netClient || g_netServer) || !(g_player[myconnectindex].ps->gm & (MODE_MENU|MODE_DEMO))) && totalclock >= 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);
} while(0);
}
G_DoCheats();