reset cam interpolation on P_ResetCamera

This commit is contained in:
Eidolon 2022-08-20 13:42:34 -05:00
parent a3bc32f7a0
commit ca5884cf5e
3 changed files with 22 additions and 0 deletions

View file

@ -86,6 +86,7 @@ typedef struct camera_s
// Camera demobjerization // Camera demobjerization
// Info for drawing: position. // Info for drawing: position.
fixed_t x, y, z; fixed_t x, y, z;
boolean reset;
//More drawing info: to determine current sprite. //More drawing info: to determine current sprite.
angle_t angle; // orientation angle_t angle; // orientation

View file

@ -7392,6 +7392,7 @@ void P_ResetCamera(player_t *player, camera_t *thiscam)
thiscam->x = x; thiscam->x = x;
thiscam->y = y; thiscam->y = y;
thiscam->z = z; thiscam->z = z;
thiscam->reset = true;
if (!(thiscam == &camera[0] && (cv_cam_still.value || cv_analog.value)) if (!(thiscam == &camera[0] && (cv_cam_still.value || cv_analog.value))
&& !(thiscam == &camera[1] && (cv_cam2_still.value || cv_analog2.value)) && !(thiscam == &camera[1] && (cv_cam2_still.value || cv_analog2.value))

View file

@ -1045,24 +1045,44 @@ void R_SetupFrame(player_t *player, boolean skybox)
thiscam = &camera[3]; thiscam = &camera[3];
chasecam = (cv_chasecam4.value != 0); chasecam = (cv_chasecam4.value != 0);
R_SetViewContext(VIEWCONTEXT_PLAYER4); R_SetViewContext(VIEWCONTEXT_PLAYER4);
if (thiscam->reset)
{
R_ResetViewInterpolation(4);
thiscam->reset = false;
}
} }
else if (splitscreen > 1 && player == &players[displayplayers[2]]) else if (splitscreen > 1 && player == &players[displayplayers[2]])
{ {
thiscam = &camera[2]; thiscam = &camera[2];
chasecam = (cv_chasecam3.value != 0); chasecam = (cv_chasecam3.value != 0);
R_SetViewContext(VIEWCONTEXT_PLAYER3); R_SetViewContext(VIEWCONTEXT_PLAYER3);
if (thiscam->reset)
{
R_ResetViewInterpolation(3);
thiscam->reset = false;
}
} }
else if (splitscreen && player == &players[displayplayers[1]]) else if (splitscreen && player == &players[displayplayers[1]])
{ {
thiscam = &camera[1]; thiscam = &camera[1];
chasecam = (cv_chasecam2.value != 0); chasecam = (cv_chasecam2.value != 0);
R_SetViewContext(VIEWCONTEXT_PLAYER2); R_SetViewContext(VIEWCONTEXT_PLAYER2);
if (thiscam->reset)
{
R_ResetViewInterpolation(2);
thiscam->reset = false;
}
} }
else else
{ {
thiscam = &camera[0]; thiscam = &camera[0];
chasecam = (cv_chasecam.value != 0); chasecam = (cv_chasecam.value != 0);
R_SetViewContext(VIEWCONTEXT_PLAYER1); R_SetViewContext(VIEWCONTEXT_PLAYER1);
if (thiscam->reset)
{
R_ResetViewInterpolation(1);
thiscam->reset = false;
}
} }
if (player->spectator) // no spectator chasecam if (player->spectator) // no spectator chasecam