From 0201f276b6e30a2183a95f45ac4e1b2659bbb820 Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 29 Jul 2025 02:35:48 +0200 Subject: [PATCH] camera noclip sec special is effectively unused in kart its not even in the kart zb config so mark it with unlikely --- src/p_map.c | 8 ++++---- src/p_maputl.c | 4 ++-- src/p_user.c | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index df97df852..77f3644cf 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2004,7 +2004,7 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam) mapcampointer = thiscam; - if (GETSECSPECIAL(newsec->special, 4) == 12) + if (UNLIKELY(GETSECSPECIAL(newsec->special, 4) == 12)) { // Camera noclip on entire sector. tmfloorz = tmdropoffz = thiscam->z; tmceilingz = tmdrpoffceilz = thiscam->z + thiscam->height; @@ -2045,10 +2045,10 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam) { fixed_t topheight, bottomheight; - if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERALL) || GETSECSPECIAL(rover->master->frontsector->special, 4) == 12) + if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERALL) || UNLIKELY(GETSECSPECIAL(rover->master->frontsector->special, 4) == 12)) continue; - topheight = P_CameraGetFOFTopZ(thiscam, newsec, rover, x, y, NULL); + topheight = P_CameraGetFOFTopZ(thiscam, newsec, rover, x, y, NULL); bottomheight = P_CameraGetFOFBottomZ(thiscam, newsec, rover, x, y, NULL); delta1 = thiscam->z - (bottomheight @@ -2120,7 +2120,7 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam) // We're inside it! Yess... polysec = po->lines[0]->backsector; - if (GETSECSPECIAL(polysec->special, 4) == 12) + if (UNLIKELY(GETSECSPECIAL(polysec->special, 4) == 12)) { // Camera noclip polyobj. plink = (polymaplink_t *)(plink->link.next); continue; diff --git a/src/p_maputl.c b/src/p_maputl.c index 11e7a1050..baab10b0a 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -366,7 +366,7 @@ void P_CameraLineOpening(line_t *linedef) { fixed_t topheight, bottomheight; - if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_RENDERALL) || !(rover->flags & FF_EXISTS) || GETSECSPECIAL(rover->master->frontsector->special, 4) == 12) + if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_RENDERALL) || !(rover->flags & FF_EXISTS) || UNLIKELY(GETSECSPECIAL(rover->master->frontsector->special, 4) == 12)) continue; topheight = P_CameraGetFOFTopZ(mapcampointer, front, rover, tmx, tmy, linedef); @@ -394,7 +394,7 @@ void P_CameraLineOpening(line_t *linedef) { fixed_t topheight, bottomheight; - if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_RENDERALL) || !(rover->flags & FF_EXISTS) || GETSECSPECIAL(rover->master->frontsector->special, 4) == 12) + if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_RENDERALL) || !(rover->flags & FF_EXISTS) || UNLIKELY(GETSECSPECIAL(rover->master->frontsector->special, 4) == 12)) continue; topheight = P_CameraGetFOFTopZ(mapcampointer, back, rover, tmx, tmy, linedef); diff --git a/src/p_user.c b/src/p_user.c index 362dccabd..b3da2b5d5 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3516,7 +3516,7 @@ static boolean P_CheckNoclipCameraPosition(player_t *player, camera_t *thiscam, for (rover = newsubsec->sector->ffloors; rover; rover = rover->next) { fixed_t topheight, bottomheight; - if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERALL) || GETSECSPECIAL(rover->master->frontsector->special, 4) == 12) + if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERALL) || UNLIKELY(UNLIKELY(GETSECSPECIAL(rover->master->frontsector->special, 4) == 12))) continue; topheight = P_CameraGetFOFTopZ(thiscam, newsubsec->sector, rover, midx, midy, NULL); @@ -3581,7 +3581,7 @@ static boolean P_CheckNoclipCameraPosition(player_t *player, camera_t *thiscam, // We're inside it! Yess... polysec = po->lines[0]->backsector; - if (GETSECSPECIAL(polysec->special, 4) == 12) + if (UNLIKELY(GETSECSPECIAL(polysec->special, 4) == 12)) { // Camera noclip polyobj. plink = (polymaplink_t *)(plink->link.next); continue; @@ -3637,7 +3637,7 @@ static boolean P_CheckNoclipCameraPosition(player_t *player, camera_t *thiscam, for (rover = newsubsec->sector->ffloors; rover; rover = rover->next) { fixed_t topheight, bottomheight; - if ((rover->flags & FF_BLOCKOTHERS) && (rover->flags & FF_RENDERALL) && (rover->flags & FF_EXISTS) && GETSECSPECIAL(rover->master->frontsector->special, 4) == 12) + if (UNLIKELY((rover->flags & FF_BLOCKOTHERS) && (rover->flags & FF_RENDERALL) && (rover->flags & FF_EXISTS) && GETSECSPECIAL(rover->master->frontsector->special, 4) == 12)) { topheight = P_CameraGetFOFTopZ(thiscam, newsubsec->sector, rover, midx, midy, NULL); bottomheight = P_CameraGetFOFBottomZ(thiscam, newsubsec->sector, rover, midx, midy, NULL);