Try putting lagless camera stuff back

This commit is contained in:
Sally Coolatta 2022-05-19 16:51:26 -04:00
parent 76b4804e44
commit 5ae8664b70
3 changed files with 29 additions and 6 deletions

View file

@ -814,6 +814,18 @@ void D_SRB2Loop(void)
}
else if (rendertimeout < entertic) // in case the server hang or netsplit
{
// Lagless camera! Yay!
if (gamestate == GS_LEVEL && netgame)
{
// Evaluate the chase cam once for every local realtic
// This might actually be better suited inside G_Ticker or TryRunTics
for (tic_t chasecamtics = 0; chasecamtics < realtics; chasecamtics++)
{
P_RunChaseCameras();
}
R_UpdateViewInterpolation();
}
doDisplay = true;
}

View file

@ -493,6 +493,19 @@ static inline void P_DoTeamStuff(void)
}
}
void P_RunChaseCameras(void)
{
UINT8 i;
for (i = 0; i <= r_splitscreen; i++)
{
if (camera[i].chase)
{
P_MoveChaseCamera(&players[displayplayers[i]], &camera[i], false);
}
}
}
//
// P_Ticker
//
@ -733,12 +746,9 @@ void P_Ticker(boolean run)
K_UpdateDirector();
// Always move the camera.
for (i = 0; i <= r_splitscreen; i++)
{
if (camera[i].chase)
P_MoveChaseCamera(&players[displayplayers[i]], &camera[i], false);
LUAh_PostThinkFrame();
}
P_RunChaseCameras();
LUAh_PostThinkFrame();
if (run)
{

View file

@ -24,6 +24,7 @@ extern tic_t leveltime;
void Command_Numthinkers_f(void);
void Command_CountMobjs_f(void);
void P_RunChaseCameras(void);
void P_Ticker(boolean run);
void P_PreTicker(INT32 frames);
void P_DoTeamscrambling(void);