From 8ba3f8855355c19fe499c383369e28bac3cbf177 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sat, 6 Oct 2018 23:37:27 -0400 Subject: [PATCH] Don't need thissec --- src/hardware/hw_main.c | 6 ++---- src/r_bsp.c | 5 ++--- src/r_segs.c | 6 ++---- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 774ff8c1..2e4c733b 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -2690,8 +2690,6 @@ static void HWR_AddLine(seg_t * line) // SoM: Backsector needs to be run through R_FakeFlat static sector_t tempsec; - sector_t *thissec = R_PointInSubsector(viewx, viewy)->sector; - if (line->polyseg && !(line->polyseg->flags & POF_RENDERSIDES)) return; @@ -2813,7 +2811,7 @@ static void HWR_AddLine(seg_t * line) SLOPEPARAMS( gr_backsector->c_slope, backc1, backc2, gr_backsector->ceilingheight) #undef SLOPEPARAMS - if (thissec != gr_backsector && thissec != gr_frontsector) + if (viewsector != gr_backsector && viewsector != gr_frontsector) { // Closed door. if ((backc1 <= frontf1 && backc2 <= frontf2) @@ -2833,7 +2831,7 @@ static void HWR_AddLine(seg_t * line) else #endif { - if (thissec != gr_backsector && thissec != gr_frontsector) + if (viewsector != gr_backsector && viewsector != gr_frontsector) { // Closed door. if (gr_backsector->ceilingheight <= gr_frontsector->floorheight || diff --git a/src/r_bsp.c b/src/r_bsp.c index da9ad665..0c48ae8b 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -374,7 +374,6 @@ static void R_AddLine(seg_t *line) INT32 x1, x2; angle_t angle1, angle2, span, tspan; static sector_t tempsec; // ceiling/water hack - sector_t *thissec = R_PointInSubsector(viewx, viewy)->sector; if (line->polyseg && !(line->polyseg->flags & POF_RENDERSIDES)) return; @@ -479,7 +478,7 @@ static void R_AddLine(seg_t *line) SLOPEPARAMS( backsector->f_slope, backf1, backf2, backsector->floorheight) SLOPEPARAMS( backsector->c_slope, backc1, backc2, backsector->ceilingheight) #undef SLOPEPARAMS - if (thissec != backsector && thissec != frontsector) + if (viewsector != backsector && viewsector != frontsector) { if ((backc1 <= frontf1 && backc2 <= frontf2) || (backf1 >= frontc1 && backf2 >= frontc2)) @@ -507,7 +506,7 @@ static void R_AddLine(seg_t *line) else #endif { - if (thissec != backsector && thissec != frontsector) + if (viewsector != backsector && viewsector != frontsector) { if (backsector->ceilingheight <= frontsector->floorheight || backsector->floorheight >= frontsector->ceilingheight) diff --git a/src/r_segs.c b/src/r_segs.c index 84bb119f..231a84f7 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -1365,7 +1365,7 @@ static void R_RenderSegLoop (void) if (bottom >= floorclip[rw_x]) bottom = floorclip[rw_x]-1; - if (top <= bottom) + if (top <= bottom && ceilingplane) { ceilingplane->top[rw_x] = (INT16)top; ceilingplane->bottom[rw_x] = (INT16)bottom; @@ -2020,8 +2020,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) { // two sided line - sector_t *thissec = R_PointInSubsector(viewx, viewy)->sector; - #ifdef ESLOPE if (backsector->c_slope) { worldhigh = P_GetZAt(backsector->c_slope, segleft.x, segleft.y) - viewz; @@ -2115,7 +2113,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) // ds_p->sprtopclip = screenheightarray; } - if (thissec != frontsector && thissec != backsector) + if (viewsector != frontsector && viewsector != backsector) { #ifdef ESLOPE if (worldhigh <= worldbottom && worldhighslope <= worldbottomslope)