From ab7291bd33d731d146641b2a5f2c9dc1dc68029f Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 26 Oct 2024 16:09:49 +0200 Subject: [PATCH] move chasecam postimg stuff into own function + add comments for what stuff does lol shit got me really confused --- src/p_mobj.c | 24 +++++++++++++++--------- src/p_user.c | 1 + 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 1c516aed6..4cb707c20 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3301,19 +3301,13 @@ void P_DestroyRobots(void) } } -// P_CameraThinker -// -// Process the mobj-ish required functions of the camera -boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled) +// the below is chasecam only, if you're curious. check out P_CalcPostImg in p_user.c for first person +static void P_CalcChasePostImg(player_t *player, camera_t *thiscam) { - boolean flipcam = (player->pflags & PF_FLIPCAM && !(player->pflags & PF_NIGHTSMODE) && player->mo->eflags & MFE_VERTICALFLIP); + const boolean flipcam = (player->pflags & PF_FLIPCAM && !(player->pflags & PF_NIGHTSMODE) && player->mo->eflags & MFE_VERTICALFLIP); UINT16 postimgflags = 0; UINT8 i; - // This can happen when joining - if (thiscam->subsector == NULL || thiscam->subsector->sector == NULL) - return true; - if (encoremode) postimgflags |= POSTIMG_MIRROR; if (flipcam) @@ -3353,6 +3347,18 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled players[displayplayers[i]].postimgflags = postimgflags; break; } +} + +// P_CameraThinker +// +// Process the mobj-ish required functions of the camera +boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled) +{ + // This can happen when joining + if (thiscam->subsector == NULL || thiscam->subsector->sector == NULL) + return true; + + P_CalcChasePostImg(player, thiscam); if (thiscam->momx || thiscam->momy) { diff --git a/src/p_user.c b/src/p_user.c index 7af0d47cc..e90dc6530 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3871,6 +3871,7 @@ boolean P_SpectatorJoinGame(player_t *player) 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) { sector_t *sector = player->mo->subsector->sector;