From f275ae98f56a80a026d20c8e5a1be4c16036b73a Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 25 Oct 2024 20:12:06 +0200 Subject: [PATCH] this is needed for postimg stuff in first person MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit lol also adds break in splitscreen lööp --- src/p_mobj.c | 1 + src/p_user.c | 56 +++++++++++++++++++++++++--------------------------- 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 9592d0a47..793680cae 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3308,6 +3308,7 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled continue; players[displayplayers[i]].postimgflags = postimgflags; + break; } if (thiscam->momx || thiscam->momy) diff --git a/src/p_user.c b/src/p_user.c index d359ce6be..1a29f4a56 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4103,11 +4103,11 @@ boolean P_SpectatorJoinGame(player_t *player) return false; } -/*static void P_CalcPostImg(player_t *player) +static void P_CalcPostImg(player_t *player) { sector_t *sector = player->mo->subsector->sector; - postimg_t *type = NULL; - INT32 *param; + INT16 typeflag = 0; + //INT32 *param; fixed_t pviewheight; UINT8 i; @@ -4122,20 +4122,19 @@ boolean P_SpectatorJoinGame(player_t *player) pviewheight = player->awayviewmobj->z + 20*FRACUNIT; } - for (i = 0; i <= splitscreen; i++) + /*for (i = 0; i <= splitscreen; i++) { if (player == &players[displayplayers[i]]) { - type = &postimgtype[i]; param = &postimgparam[i]; break; } - } + }*/ // see if we are in heat (no, not THAT kind of heat...) if (P_FindSpecialLineFromTag(13, sector->tag, -1) != -1) - *type = postimg_heat; + typeflag |= POSTIMG_HEAT; else if (sector->ffloors) { ffloor_t *rover; @@ -4154,7 +4153,7 @@ boolean P_SpectatorJoinGame(player_t *player) continue; if (P_FindSpecialLineFromTag(13, rover->master->frontsector->tag, -1) != -1) - *type = postimg_heat; + typeflag |= POSTIMG_HEAT; } } @@ -4176,37 +4175,36 @@ boolean P_SpectatorJoinGame(player_t *player) if (pviewheight >= topheight || pviewheight <= bottomheight) continue; - *type = postimg_water; + typeflag |= POSTIMG_WATER; } } - if (!encoremode) // srb2kart - { - if (player->mo->eflags & MFE_VERTICALFLIP) - *type = postimg_flip; - } - else - { - if (player->mo->eflags & MFE_VERTICALFLIP) - *type = postimg_mirrorflip; - else - *type = postimg_mirror; - } + if (encoremode) // srb2kart + typeflag |= POSTIMG_MIRROR; + + if (player->mo->eflags & MFE_VERTICALFLIP) + typeflag |= POSTIMG_FLIP; -#if 1 - (void)param; -#else // Motion blur - if (player->speed > (35<speed > (35<speed - 32)/4; if (*param > 5) *param = 5; + }*/ + + for (i = 0; i <= splitscreen; i++) + { + if (player != &players[displayplayers[i]]) + continue; + + players[displayplayers[i]].postimgflags = typeflag; + break; } -#endif -}*/ +} void P_DoTimeOver(player_t *player) { @@ -4992,7 +4990,7 @@ void P_PlayerAfterThink(player_t *player) if (!thiscam->chase) // bob view only if looking through the player's eyes { P_CalcHeight(player); - //P_CalcPostImg(player); + P_CalcPostImg(player); } else {