mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-22 20:02:03 +00:00
Merge branch 'camrea-fiz' into 'next'
Fix Camera Interpolation Never Being Reset (Resolves #1026 and #976) Closes #976 and #1026 See merge request STJr/SRB2!2008
This commit is contained in:
commit
9d0389811b
1 changed files with 30 additions and 33 deletions
61
src/r_main.c
61
src/r_main.c
|
@ -1092,34 +1092,12 @@ subsector_t *R_PointInSubsectorOrNull(fixed_t x, fixed_t y)
|
||||||
void R_SetupFrame(player_t *player)
|
void R_SetupFrame(player_t *player)
|
||||||
{
|
{
|
||||||
camera_t *thiscam;
|
camera_t *thiscam;
|
||||||
boolean chasecam = false;
|
boolean chasecam = R_ViewpointHasChasecam(player);
|
||||||
|
|
||||||
if (splitscreen && player == &players[secondarydisplayplayer]
|
if (splitscreen && player == &players[secondarydisplayplayer] && player != &players[consoleplayer])
|
||||||
&& player != &players[consoleplayer])
|
|
||||||
{
|
|
||||||
thiscam = &camera2;
|
thiscam = &camera2;
|
||||||
chasecam = (cv_chasecam2.value != 0);
|
|
||||||
R_SetViewContext(VIEWCONTEXT_PLAYER2);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
thiscam = &camera;
|
thiscam = &camera;
|
||||||
chasecam = (cv_chasecam.value != 0);
|
|
||||||
R_SetViewContext(VIEWCONTEXT_PLAYER1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (player->climbing || (player->powers[pw_carry] == CR_NIGHTSMODE) || player->playerstate == PST_DEAD || gamestate == GS_TITLESCREEN || tutorialmode)
|
|
||||||
chasecam = true; // force chasecam on
|
|
||||||
else if (player->spectator) // no spectator chasecam
|
|
||||||
chasecam = false; // force chasecam off
|
|
||||||
|
|
||||||
if (chasecam && !thiscam->chase)
|
|
||||||
{
|
|
||||||
P_ResetCamera(player, thiscam);
|
|
||||||
thiscam->chase = true;
|
|
||||||
}
|
|
||||||
else if (!chasecam)
|
|
||||||
thiscam->chase = false;
|
|
||||||
|
|
||||||
newview->sky = false;
|
newview->sky = false;
|
||||||
|
|
||||||
|
@ -1348,11 +1326,37 @@ boolean R_ViewpointHasChasecam(player_t *player)
|
||||||
{
|
{
|
||||||
camera_t *thiscam;
|
camera_t *thiscam;
|
||||||
boolean chasecam = false;
|
boolean chasecam = false;
|
||||||
|
boolean isplayer2 = (splitscreen && player == &players[secondarydisplayplayer] && player != &players[consoleplayer]);
|
||||||
|
|
||||||
if (splitscreen && player == &players[secondarydisplayplayer] && player != &players[consoleplayer])
|
if (isplayer2)
|
||||||
{
|
{
|
||||||
thiscam = &camera2;
|
thiscam = &camera2;
|
||||||
chasecam = (cv_chasecam2.value != 0);
|
chasecam = (cv_chasecam2.value != 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
thiscam = &camera;
|
||||||
|
chasecam = (cv_chasecam.value != 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player->climbing || (player->powers[pw_carry] == CR_NIGHTSMODE) || player->playerstate == PST_DEAD || gamestate == GS_TITLESCREEN || tutorialmode)
|
||||||
|
chasecam = true; // force chasecam on
|
||||||
|
else if (player->spectator) // no spectator chasecam
|
||||||
|
chasecam = false; // force chasecam off
|
||||||
|
|
||||||
|
if (chasecam && !thiscam->chase)
|
||||||
|
{
|
||||||
|
P_ResetCamera(player, thiscam);
|
||||||
|
thiscam->chase = true;
|
||||||
|
}
|
||||||
|
else if (!chasecam && thiscam->chase)
|
||||||
|
{
|
||||||
|
P_ResetCamera(player, thiscam);
|
||||||
|
thiscam->chase = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isplayer2)
|
||||||
|
{
|
||||||
R_SetViewContext(VIEWCONTEXT_PLAYER2);
|
R_SetViewContext(VIEWCONTEXT_PLAYER2);
|
||||||
if (thiscam->reset)
|
if (thiscam->reset)
|
||||||
{
|
{
|
||||||
|
@ -1362,8 +1366,6 @@ boolean R_ViewpointHasChasecam(player_t *player)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
thiscam = &camera;
|
|
||||||
chasecam = (cv_chasecam.value != 0);
|
|
||||||
R_SetViewContext(VIEWCONTEXT_PLAYER1);
|
R_SetViewContext(VIEWCONTEXT_PLAYER1);
|
||||||
if (thiscam->reset)
|
if (thiscam->reset)
|
||||||
{
|
{
|
||||||
|
@ -1372,11 +1374,6 @@ boolean R_ViewpointHasChasecam(player_t *player)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player->climbing || (player->powers[pw_carry] == CR_NIGHTSMODE) || player->playerstate == PST_DEAD || gamestate == GS_TITLESCREEN || tutorialmode)
|
|
||||||
chasecam = true; // force chasecam on
|
|
||||||
else if (player->spectator) // no spectator chasecam
|
|
||||||
chasecam = false; // force chasecam off
|
|
||||||
|
|
||||||
return chasecam;
|
return chasecam;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue