mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-23 19:31:05 +00:00
Run anti-lag chasecam at tic frequency
Fixes jittery and unstable chasecam in high latency netgames
This commit is contained in:
parent
8908dcccde
commit
6dd27af26e
1 changed files with 11 additions and 4 deletions
15
src/d_main.c
15
src/d_main.c
|
@ -825,10 +825,17 @@ void D_SRB2Loop(void)
|
|||
// Lagless camera! Yay!
|
||||
if (gamestate == GS_LEVEL && netgame)
|
||||
{
|
||||
if (splitscreen && camera2.chase)
|
||||
P_MoveChaseCamera(&players[secondarydisplayplayer], &camera2, false);
|
||||
if (camera.chase)
|
||||
P_MoveChaseCamera(&players[displayplayer], &camera, false);
|
||||
// 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++)
|
||||
{
|
||||
if (splitscreen && camera2.chase)
|
||||
P_MoveChaseCamera(&players[secondarydisplayplayer], &camera2, false);
|
||||
if (camera.chase)
|
||||
P_MoveChaseCamera(&players[displayplayer], &camera, false);
|
||||
}
|
||||
R_UpdateViewInterpolation();
|
||||
|
||||
}
|
||||
// (Only display if not already done for frame interp)
|
||||
cv_frameinterpolation.value == 0 ? D_Display() : 0;
|
||||
|
|
Loading…
Reference in a new issue