diff --git a/src/p_local.h b/src/p_local.h index 8a918917615bc6bfa460bc294f3b24fb18c0ed46..49af03f3666a29ec703beb7dc4a0ae8fa673b297 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -91,6 +91,7 @@ typedef struct camera_s // Camera demobjerization // Info for drawing: position. fixed_t x, y, z; + boolean reset; //More drawing info: to determine current sprite. angle_t angle; // orientation diff --git a/src/p_user.c b/src/p_user.c index 444da6fea8ded4dc5f2da6d6dd6f06f5cc3c7140..802c061553ff310e66cd9c620da96d283bf3fd03 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9656,6 +9656,7 @@ void P_ResetCamera(player_t *player, camera_t *thiscam) thiscam->x = x; thiscam->y = y; thiscam->z = z; + thiscam->reset = true; if ((thiscam == &camera && G_ControlStyle(1) == CS_SIMPLE) || (thiscam == &camera2 && G_ControlStyle(2) == CS_SIMPLE)) diff --git a/src/r_main.c b/src/r_main.c index b1ba1505068936c5a242f8d10ab8db2af5ce6c04..cd5e255ed4059ef0680e782298284f422dc27611 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -1346,12 +1346,31 @@ void R_SkyboxFrame(player_t *player) boolean R_ViewpointHasChasecam(player_t *player) { + camera_t *thiscam; boolean chasecam = false; if (splitscreen && player == &players[secondarydisplayplayer] && player != &players[consoleplayer]) + { + thiscam = &camera2; chasecam = (cv_chasecam2.value != 0); + R_SetViewContext(VIEWCONTEXT_PLAYER2); + if (thiscam->reset) + { + R_ResetViewInterpolation(2); + thiscam->reset = false; + } + } else + { + thiscam = &camera; chasecam = (cv_chasecam.value != 0); + R_SetViewContext(VIEWCONTEXT_PLAYER1); + if (thiscam->reset) + { + R_ResetViewInterpolation(1); + thiscam->reset = false; + } + } if (player->climbing || (player->powers[pw_carry] == CR_NIGHTSMODE) || player->playerstate == PST_DEAD || gamestate == GS_TITLESCREEN || tutorialmode) chasecam = true; // force chasecam on