Fix camera not being flipped when camera is stopped due to game design hack reasons (resolves #383).
This commit is contained in:
parent
bcbf5e7c38
commit
ae84246721
|
@ -323,6 +323,7 @@ SINT8 P_MobjFlip(mobj_t *mobj);
|
||||||
fixed_t P_GetMobjGravity(mobj_t *mo);
|
fixed_t P_GetMobjGravity(mobj_t *mo);
|
||||||
FUNCMATH boolean P_WeaponOrPanel(mobjtype_t type);
|
FUNCMATH boolean P_WeaponOrPanel(mobjtype_t type);
|
||||||
|
|
||||||
|
void P_CalcChasePostImg(player_t *player, camera_t *thiscam);
|
||||||
boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled);
|
boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled);
|
||||||
|
|
||||||
void P_Attract(mobj_t *source, mobj_t *enemy, boolean nightsgrab);
|
void P_Attract(mobj_t *source, mobj_t *enemy, boolean nightsgrab);
|
||||||
|
|
29
src/p_mobj.c
29
src/p_mobj.c
|
@ -3724,17 +3724,10 @@ void P_DestroyRobots(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// P_CameraThinker
|
// the below is chasecam only, if you're curious. check out P_CalcPostImg in p_user.c for first person
|
||||||
//
|
void P_CalcChasePostImg(player_t *player, camera_t *thiscam)
|
||||||
// Process the mobj-ish required functions of the camera
|
|
||||||
boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled)
|
|
||||||
{
|
{
|
||||||
boolean itsatwodlevel = false;
|
|
||||||
postimg_t postimg = postimg_none;
|
postimg_t postimg = postimg_none;
|
||||||
if (twodlevel
|
|
||||||
|| (thiscam == &camera && players[displayplayer].mo && (players[displayplayer].mo->flags2 & MF2_TWOD))
|
|
||||||
|| (thiscam == &camera2 && players[secondarydisplayplayer].mo && (players[secondarydisplayplayer].mo->flags2 & MF2_TWOD)))
|
|
||||||
itsatwodlevel = true;
|
|
||||||
|
|
||||||
if (player->pflags & PF_FLIPCAM && !(player->powers[pw_carry] == CR_NIGHTSMODE) && player->mo->eflags & MFE_VERTICALFLIP)
|
if (player->pflags & PF_FLIPCAM && !(player->powers[pw_carry] == CR_NIGHTSMODE) && player->mo->eflags & MFE_VERTICALFLIP)
|
||||||
postimg = postimg_flip;
|
postimg = postimg_flip;
|
||||||
|
@ -3762,14 +3755,28 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled
|
||||||
postimg = postimg_heat;
|
postimg = postimg_heat;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (postimg != postimg_none)
|
if (postimg == postimg_none)
|
||||||
{
|
return;
|
||||||
|
|
||||||
if (splitscreen && player == &players[secondarydisplayplayer])
|
if (splitscreen && player == &players[secondarydisplayplayer])
|
||||||
postimgtype2 = postimg;
|
postimgtype2 = postimg;
|
||||||
else
|
else
|
||||||
postimgtype = postimg;
|
postimgtype = postimg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// P_CameraThinker
|
||||||
|
//
|
||||||
|
// Process the mobj-ish required functions of the camera
|
||||||
|
boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled)
|
||||||
|
{
|
||||||
|
boolean itsatwodlevel = false;
|
||||||
|
if (twodlevel
|
||||||
|
|| (thiscam == &camera && players[displayplayer].mo && (players[displayplayer].mo->flags2 & MF2_TWOD))
|
||||||
|
|| (thiscam == &camera2 && players[secondarydisplayplayer].mo && (players[secondarydisplayplayer].mo->flags2 & MF2_TWOD)))
|
||||||
|
itsatwodlevel = true;
|
||||||
|
|
||||||
|
P_CalcChasePostImg(player, thiscam);
|
||||||
|
|
||||||
if (thiscam->momx || thiscam->momy)
|
if (thiscam->momx || thiscam->momy)
|
||||||
{
|
{
|
||||||
if (!P_TryCameraMove(thiscam->x + thiscam->momx, thiscam->y + thiscam->momy, thiscam)) // Thanks for the greatly improved camera, Lach -- Sev
|
if (!P_TryCameraMove(thiscam->x + thiscam->momx, thiscam->y + thiscam->momy, thiscam)) // Thanks for the greatly improved camera, Lach -- Sev
|
||||||
|
|
12
src/p_user.c
12
src/p_user.c
|
@ -9665,11 +9665,17 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||||
fixed_t f1, f2;
|
fixed_t f1, f2;
|
||||||
|
|
||||||
// We probably shouldn't move the camera if there is no player or player mobj somehow
|
// We probably shouldn't move the camera if there is no player or player mobj somehow
|
||||||
if (!player || !player->mo || player->playerstate == PST_REBORN)
|
if (!player || !player->mo)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
mo = player->mo;
|
mo = player->mo;
|
||||||
|
|
||||||
|
if (player->playerstate == PST_REBORN)
|
||||||
|
{
|
||||||
|
P_CalcChasePostImg(player, thiscam);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (player->exiting)
|
if (player->exiting)
|
||||||
{
|
{
|
||||||
if (mo->target && mo->target->type == MT_SIGN && mo->target->spawnpoint
|
if (mo->target && mo->target->type == MT_SIGN && mo->target->spawnpoint
|
||||||
|
@ -9678,8 +9684,11 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||||
else if ((player->powers[pw_carry] == CR_NIGHTSMODE)
|
else if ((player->powers[pw_carry] == CR_NIGHTSMODE)
|
||||||
&& !(player->mo->state >= &states[S_PLAY_NIGHTS_TRANS1]
|
&& !(player->mo->state >= &states[S_PLAY_NIGHTS_TRANS1]
|
||||||
&& player->mo->state <= &states[S_PLAY_NIGHTS_TRANS6]))
|
&& player->mo->state <= &states[S_PLAY_NIGHTS_TRANS6]))
|
||||||
|
{
|
||||||
|
P_CalcChasePostImg(player, thiscam);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
cameranoclip = (player->powers[pw_carry] == CR_NIGHTSMODE || player->pflags & PF_NOCLIP) || (mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)); // Noclipping player camera noclips too!!
|
cameranoclip = (player->powers[pw_carry] == CR_NIGHTSMODE || player->pflags & PF_NOCLIP) || (mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)); // Noclipping player camera noclips too!!
|
||||||
|
|
||||||
|
@ -10419,6 +10428,7 @@ boolean P_SpectatorJoinGame(player_t *player)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// the below is first person only, if you're curious. check out P_CalcChasePostImg in p_mobj.c for chasecam
|
||||||
static void P_CalcPostImg(player_t *player)
|
static void P_CalcPostImg(player_t *player)
|
||||||
{
|
{
|
||||||
sector_t *sector = player->mo->subsector->sector;
|
sector_t *sector = player->mo->subsector->sector;
|
||||||
|
|
Loading…
Reference in New Issue