From 9cc9b73021b6c6a20b17ee81b4b8129089550281 Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 2 Apr 2023 22:17:01 -0700 Subject: [PATCH 1/4] Convert r_segs.c to r_segs.cpp --- src/CMakeLists.txt | 2 +- src/{r_segs.c => r_segs.cpp} | 60 ++++++++++++++++++++---------------- 2 files changed, 34 insertions(+), 28 deletions(-) rename src/{r_segs.c => r_segs.cpp} (97%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 53a506b25..21ef13ce9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -71,7 +71,7 @@ add_executable(SRB2SDL2 MACOSX_BUNDLE WIN32 r_fps.c r_main.c r_plane.c - r_segs.c + r_segs.cpp r_skins.c r_sky.c r_splats.c diff --git a/src/r_segs.c b/src/r_segs.cpp similarity index 97% rename from src/r_segs.c rename to src/r_segs.cpp index 74800fb21..99e4c842e 100644 --- a/src/r_segs.c +++ b/src/r_segs.cpp @@ -138,7 +138,7 @@ transnum_t R_GetLinedefTransTable(fixed_t alpha) { if (alpha >= FRACUNIT) { - return 0; + return static_cast(0); } else if (alpha <= 0) { @@ -146,7 +146,7 @@ transnum_t R_GetLinedefTransTable(fixed_t alpha) } else { - return (20*(FRACUNIT - alpha - 1) + FRACUNIT) >> (FRACBITS+1); + return static_cast((20*(FRACUNIT - alpha - 1) + FRACUNIT) >> (FRACBITS+1)); } } @@ -177,7 +177,7 @@ static void R_RenderMaskedSegLoop(drawseg_t *ds, INT32 x1, INT32 x2, INT32 texnu ldef = curline->linedef; tripwire = P_IsLineTripWire(ldef); - range = max(ds->x2-ds->x1, 1); + range = std::max(ds->x2-ds->x1, 1); // Setup lighting based on the presence/lack-of 3D floors. dc_numlights = 0; @@ -187,7 +187,9 @@ static void R_RenderMaskedSegLoop(drawseg_t *ds, INT32 x1, INT32 x2, INT32 texnu if (dc_numlights >= dc_maxlights) { dc_maxlights = dc_numlights; - dc_lightlist = Z_Realloc(dc_lightlist, sizeof (*dc_lightlist) * dc_maxlights, PU_STATIC, NULL); + dc_lightlist = static_cast( + Z_Realloc(dc_lightlist, sizeof (*dc_lightlist) * dc_maxlights, PU_STATIC, NULL) + ); } for (i = 0; i < dc_numlights; i++) @@ -209,7 +211,7 @@ static void R_RenderMaskedSegLoop(drawseg_t *ds, INT32 x1, INT32 x2, INT32 texnu rlight->startheight = rlight->height; // keep starting value here to reset for each repeat rlight->lightlevel = *light->lightlevel; rlight->extra_colormap = *light->extra_colormap; - rlight->flags = light->flags; + rlight->flags = static_cast(light->flags); if ((R_CheckColumnFunc(COLDRAWFUNC_FUZZY) == false) || (rlight->flags & FOF_FOG) @@ -561,7 +563,7 @@ static INT32 R_GetTwoSidedMidTexture(seg_t *line) static boolean R_CheckBlendMode(const line_t *ldef, INT32 bmnum) { transnum_t transtable = NUMTRANSMAPS; - patchalphastyle_t blendmode = 0; + patchalphastyle_t blendmode = AST_COPY; transtable = R_GetLinedefTransTable(ldef->alpha); if (transtable == NUMTRANSMAPS) @@ -570,11 +572,11 @@ static boolean R_CheckBlendMode(const line_t *ldef, INT32 bmnum) return false; } - blendmode = ldef->blendmode; + blendmode = static_cast(ldef->blendmode); if (blendmode == AST_MODULATE || blendmode == AST_FOG) { // These blend modes don't use translucency - transtable = 0; + transtable = static_cast(0); } if (blendmode == AST_FOG) @@ -790,7 +792,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) R_SetColumnFunc(COLDRAWFUNC_FOG, bmnum != 0); } - range = max(ds->x2-ds->x1, 1); + range = std::max(ds->x2-ds->x1, 1); //SoM: Moved these up here so they are available for my lightlist calculations rw_scalestep = ds->scalestep; spryscale = ds->scale1 + (x1 - ds->x1)*rw_scalestep; @@ -802,7 +804,9 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) if (dc_numlights > dc_maxlights) { dc_maxlights = dc_numlights; - dc_lightlist = Z_Realloc(dc_lightlist, sizeof (*dc_lightlist) * dc_maxlights, PU_STATIC, NULL); + dc_lightlist = static_cast( + Z_Realloc(dc_lightlist, sizeof (*dc_lightlist) * dc_maxlights, PU_STATIC, NULL) + ); } for (i = p = 0; i < dc_numlights; i++) @@ -849,7 +853,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) else if (overflow_test > (INT64)CLAMPMIN) rlight->heightstep = (fixed_t)overflow_test; else rlight->heightstep = CLAMPMIN; rlight->heightstep = (rlight->heightstep-rlight->height)/(range); - rlight->flags = light->flags; + rlight->flags = static_cast(light->flags); if (light->flags & FOF_CUTLEVEL) { SLOPEPARAMS(*light->caster->b_slope, leftheight, rightheight, *light->caster->bottomheight) @@ -1674,8 +1678,8 @@ static void R_RenderSegLoop (void) if (maskedtextureheight != NULL) { maskedtextureheight[rw_x] = (curline->linedef->flags & ML_MIDPEG) ? - max(rw_midtexturemid, rw_midtextureback) : - min(rw_midtexturemid, rw_midtextureback); + std::max(rw_midtexturemid, rw_midtextureback) : + std::min(rw_midtexturemid, rw_midtextureback); } } @@ -1766,7 +1770,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) size_t newmax = maxdrawsegs ? maxdrawsegs*2 : 128; if (firstseg) firstseg = (drawseg_t *)(firstseg - drawsegs); - drawsegs = Z_Realloc(drawsegs, newmax*sizeof (*drawsegs), PU_STATIC, NULL); + drawsegs = static_cast(Z_Realloc(drawsegs, newmax*sizeof (*drawsegs), PU_STATIC, NULL)); ds_p = drawsegs + pos; maxdrawsegs = newmax; curdrawsegs = drawsegs + curpos; @@ -1813,7 +1817,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) do maxopenings = maxopenings ? maxopenings*2 : 16384; while (need > maxopenings); - openings = Z_Realloc(openings, maxopenings * sizeof (*openings), PU_STATIC, NULL); + openings = static_cast(Z_Realloc(openings, maxopenings * sizeof (*openings), PU_STATIC, NULL)); lastopening = openings + pos; // borrowed fix from *cough* zdoom *cough* @@ -2294,10 +2298,10 @@ void R_StoreWallRange(INT32 start, INT32 stop) ds_p->thicksidecol = maskedtexturecol = lastopening - rw_x; lastopening += rw_stopx - rw_x; - lowcut = max(worldbottom, worldlow) + viewz; - highcut = min(worldtop, worldhigh) + viewz; - lowcutslope = max(worldbottomslope, worldlowslope) + viewz; - highcutslope = min(worldtopslope, worldhighslope) + viewz; + lowcut = std::max(worldbottom, worldlow) + viewz; + highcut = std::min(worldtop, worldhigh) + viewz; + lowcutslope = std::max(worldbottomslope, worldlowslope) + viewz; + highcutslope = std::min(worldtopslope, worldhighslope) + viewz; if (frontsector->ffloors && backsector->ffloors) { @@ -2487,9 +2491,9 @@ void R_StoreWallRange(INT32 start, INT32 stop) { // use REAL front and back floors please, so midtexture rendering isn't mucked up rw_midtextureslide = rw_midtexturebackslide = 0; if (linedef->flags & ML_MIDPEG) - rw_midtexturemid = rw_midtextureback = max(curline->frontsector->floorheight, curline->backsector->floorheight) - viewz; + rw_midtexturemid = rw_midtextureback = std::max(curline->frontsector->floorheight, curline->backsector->floorheight) - viewz; else - rw_midtexturemid = rw_midtextureback = min(curline->frontsector->ceilingheight, curline->backsector->ceilingheight) - viewz; + rw_midtexturemid = rw_midtextureback = std::min(curline->frontsector->ceilingheight, curline->backsector->ceilingheight) - viewz; } else { @@ -2498,9 +2502,9 @@ void R_StoreWallRange(INT32 start, INT32 stop) { // Ignore slopes when texturing rw_midtextureslide = rw_midtexturebackslide = 0; if (linedef->flags & ML_MIDPEG) - rw_midtexturemid = rw_midtextureback = max(frontsector->floorheight, backsector->floorheight) - viewz; + rw_midtexturemid = rw_midtextureback = std::max(frontsector->floorheight, backsector->floorheight) - viewz; else - rw_midtexturemid = rw_midtextureback = min(frontsector->ceilingheight, backsector->ceilingheight) - viewz; + rw_midtexturemid = rw_midtextureback = std::min(frontsector->ceilingheight, backsector->ceilingheight) - viewz; } else if (linedef->flags & ML_MIDPEG) @@ -2642,7 +2646,9 @@ void R_StoreWallRange(INT32 start, INT32 stop) if (dc_numlights >= dc_maxlights) { dc_maxlights = dc_numlights; - dc_lightlist = Z_Realloc(dc_lightlist, sizeof (*dc_lightlist) * dc_maxlights, PU_STATIC, NULL); + dc_lightlist = static_cast( + Z_Realloc(dc_lightlist, sizeof (*dc_lightlist) * dc_maxlights, PU_STATIC, NULL) + ); } for (i = p = 0; i < dc_numlights; i++) @@ -2677,7 +2683,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) rlight->height = (centeryfrac>>4) - FixedMul(leftheight, rw_scale); rlight->heightstep = (centeryfrac>>4) - FixedMul(rightheight, ds_p->scale2); rlight->heightstep = (rlight->heightstep-rlight->height)/(range); - rlight->flags = light->flags; + rlight->flags = static_cast(light->flags); if (light->caster && light->caster->fofflags & FOF_CUTSOLIDS) { @@ -2743,7 +2749,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) pixhighstep = (topfracend-pixhigh)/(range); // If the lowest part of a ceiling stretching down covers the entire screen - if (min(pixhigh, topfracend)>>HEIGHTBITS >= viewheight-1) + if (std::min(pixhigh, topfracend)>>HEIGHTBITS >= viewheight-1) g_walloffscreen = true; } @@ -2755,7 +2761,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) pixlowstep = (bottomfracend-pixlow)/(range); // If the highest part of a floor stretching up covers the entire screen - if ((max(pixlow, bottomfracend)+HEIGHTUNIT-1)>>HEIGHTBITS <= 0) + if ((std::max(pixlow, bottomfracend)+HEIGHTUNIT-1)>>HEIGHTBITS <= 0) g_walloffscreen = true; } From fc865f9aadb6c2fce70e32e949e7dd82c447cb35 Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 2 Apr 2023 22:44:34 -0700 Subject: [PATCH 2/4] R_RenderSegLoop: move column drawing code to generic R_DrawWallColumn function --- src/r_segs.cpp | 54 ++++++++++++++------------------------------------ 1 file changed, 15 insertions(+), 39 deletions(-) diff --git a/src/r_segs.cpp b/src/r_segs.cpp index 99e4c842e..6f6fb37a9 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -1279,6 +1279,18 @@ UINT32 nombre = 100000; #endif //profile stuff --------------------------------------------------------- +static void R_DrawWallColumn(INT32 yl, INT32 yh, fixed_t mid, fixed_t texturecolumn, INT32 texture, INT32 brightmap) +{ + dc_yl = yl; + dc_yh = yh; + dc_texturemid = mid; + dc_source = R_GetColumn(texture, texturecolumn); + dc_brightmap = (brightmap ? R_GetColumn(brightmap, texturecolumn) : NULL); + dc_texheight = textureheight[texture] >> FRACBITS; + R_SetColumnFunc(colfunctype, dc_brightmap != NULL); + colfunc(); +} + static void R_RenderSegLoop (void) { angle_t angle; @@ -1551,29 +1563,7 @@ static void R_RenderSegLoop (void) // single sided line if (yl <= yh && yh >= 0 && yl < viewheight) { - dc_yl = yl; - dc_yh = yh; - dc_texturemid = rw_midtexturemid; - dc_source = R_GetColumn(midtexture,texturecolumn); - dc_brightmap = (midbrightmap ? R_GetColumn(midbrightmap, texturecolumn) : NULL); - dc_texheight = textureheight[midtexture]>>FRACBITS; - - R_SetColumnFunc(colfunctype, dc_brightmap != NULL); - - //profile stuff --------------------------------------------------------- -#ifdef TIMING - ProfZeroTimer(); -#endif - colfunc(); -#ifdef TIMING - RDMSR(0x10,&mycount); - mytotal += mycount; //64bit add - - if (nombre--==0) - I_Error("R_DrawColumn CPU Spy reports: 0x%d %d\n", *((INT32 *)&mytotal+1), - (INT32)mytotal); -#endif - //profile stuff --------------------------------------------------------- + R_DrawWallColumn(yl, yh, rw_midtexturemid, texturecolumn, midtexture, midbrightmap); // dont draw anything more for this column, since // a midtexture blocks the view @@ -1612,14 +1602,7 @@ static void R_RenderSegLoop (void) } else if (mid >= 0) // safe to draw top texture { - dc_yl = yl; - dc_yh = mid; - dc_texturemid = rw_toptexturemid; - dc_source = R_GetColumn(toptexture,texturecolumn); - dc_brightmap = (topbrightmap ? R_GetColumn(topbrightmap, texturecolumn) : NULL); - dc_texheight = textureheight[toptexture]>>FRACBITS; - R_SetColumnFunc(colfunctype, dc_brightmap != NULL); - colfunc(); + R_DrawWallColumn(yl, mid, rw_toptexturemid, texturecolumn, toptexture, topbrightmap); ceilingclip[rw_x] = (INT16)mid; } else if (!rw_ceilingmarked) // entirely off top of screen @@ -1650,14 +1633,7 @@ static void R_RenderSegLoop (void) } else if (mid < viewheight) // safe to draw bottom texture { - dc_yl = mid; - dc_yh = yh; - dc_texturemid = rw_bottomtexturemid; - dc_source = R_GetColumn(bottomtexture,texturecolumn); - dc_brightmap = (bottombrightmap ? R_GetColumn(bottombrightmap, texturecolumn) : NULL); - dc_texheight = textureheight[bottomtexture]>>FRACBITS; - R_SetColumnFunc(colfunctype, dc_brightmap != NULL); - colfunc(); + R_DrawWallColumn(mid, yh, rw_bottomtexturemid, texturecolumn, bottomtexture, bottombrightmap); floorclip[rw_x] = (INT16)mid; } else if (!rw_floormarked) // entirely off bottom of screen From a68615e2f9dfa76b70516e23e1bf834812fddc55 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sat, 6 Oct 2018 15:13:57 -0400 Subject: [PATCH 3/4] Remove R_DoorClosed This function has caused me, so much unexpected pain because of just how out of the way it is, and NOTHING else uses it --- src/r_bsp.cpp | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/src/r_bsp.cpp b/src/r_bsp.cpp index ddafbb014..87b880c27 100644 --- a/src/r_bsp.cpp +++ b/src/r_bsp.cpp @@ -246,26 +246,6 @@ void R_PortalClearClipSegs(INT32 start, INT32 end) newend = solidsegs + 2; } -// R_DoorClosed -// -// This function is used to fix the automap bug which -// showed lines behind closed doors simply because the door had a dropoff. -// -// It assumes that Doom has already ruled out a door being closed because -// of front-back closure (e.g. front floor is taller than back ceiling). -static INT32 R_DoorClosed(void) -{ - return - - // if door is closed because back is shut: - backsector->ceilingheight <= backsector->floorheight - - // preserve a kind of transparent door/lift special effect: - && (backsector->ceilingheight >= frontsector->ceilingheight || curline->sidedef->toptexture) - - && (backsector->floorheight <= frontsector->floorheight || curline->sidedef->bottomtexture); -} - // // If player's view height is underneath fake floor, lower the // drawn ceiling to be just under the floor height, and replace @@ -625,7 +605,19 @@ static void R_AddLine(seg_t *line) } // Check for automap fix. Store in doorclosed for r_segs.c - doorclosed = R_DoorClosed(); + // + // This is used to fix the automap bug which + // showed lines behind closed doors simply because the door had a dropoff. + // + // It assumes that Doom has already ruled out a door being closed because + // of front-back closure (e.g. front floor is taller than back ceiling). + // + // if door is closed because back is shut: + doorclosed = backsector->ceilingheight <= backsector->floorheight + // preserve a kind of transparent door/lift special effect: + && (backsector->ceilingheight >= frontsector->ceilingheight || curline->sidedef->toptexture) + && (backsector->floorheight <= frontsector->floorheight || curline->sidedef->bottomtexture); + if (doorclosed) goto clipsolid; } From 9c80d53f542d960c16077e809ac180a951747bd7 Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 3 Apr 2023 19:13:17 -0700 Subject: [PATCH 4/4] R_StoreWallRange: remove duplicated closed door checks --- src/r_bsp.cpp | 30 ++++++++------------- src/r_segs.cpp | 71 ++++++++------------------------------------------ 2 files changed, 22 insertions(+), 79 deletions(-) diff --git a/src/r_bsp.cpp b/src/r_bsp.cpp index 87b880c27..74b78397d 100644 --- a/src/r_bsp.cpp +++ b/src/r_bsp.cpp @@ -569,16 +569,12 @@ static void R_AddLine(seg_t *line) // same for floors if (!bothceilingssky && !bothfloorssky) { - if ((backc1 <= frontf1 && backc2 <= frontf2) - || (backf1 >= frontc1 && backf2 >= frontc2)) - { - goto clipsolid; - } - + doorclosed = (backc1 <= frontf1 && backc2 <= frontf2) + || (backf1 >= frontc1 && backf2 >= frontc2) // Check for automap fix. Store in doorclosed for r_segs.c - doorclosed = (backc1 <= backf1 && backc2 <= backf2 - && ((backc1 >= frontc1 && backc2 >= frontc2) || curline->sidedef->toptexture) - && ((backf1 <= frontf1 && backf2 >= frontf2) || curline->sidedef->bottomtexture)); + || (backc1 <= backf1 && backc2 <= backf2 + && ((backc1 >= frontc1 && backc2 >= frontc2) || curline->sidedef->toptexture) + && ((backf1 <= frontf1 && backf2 >= frontf2) || curline->sidedef->bottomtexture)); if (doorclosed) goto clipsolid; @@ -598,12 +594,8 @@ static void R_AddLine(seg_t *line) // same for floors if (!bothceilingssky && !bothfloorssky) { - if (backsector->ceilingheight <= frontsector->floorheight - || backsector->floorheight >= frontsector->ceilingheight) - { - goto clipsolid; - } - + doorclosed = backsector->ceilingheight <= frontsector->floorheight + || backsector->floorheight >= frontsector->ceilingheight // Check for automap fix. Store in doorclosed for r_segs.c // // This is used to fix the automap bug which @@ -613,10 +605,10 @@ static void R_AddLine(seg_t *line) // of front-back closure (e.g. front floor is taller than back ceiling). // // if door is closed because back is shut: - doorclosed = backsector->ceilingheight <= backsector->floorheight - // preserve a kind of transparent door/lift special effect: - && (backsector->ceilingheight >= frontsector->ceilingheight || curline->sidedef->toptexture) - && (backsector->floorheight <= frontsector->floorheight || curline->sidedef->bottomtexture); + || (backsector->ceilingheight <= backsector->floorheight + // preserve a kind of transparent door/lift special effect: + && (backsector->ceilingheight >= frontsector->ceilingheight || curline->sidedef->toptexture) + && (backsector->floorheight <= frontsector->floorheight || curline->sidedef->bottomtexture)); if (doorclosed) goto clipsolid; diff --git a/src/r_segs.cpp b/src/r_segs.cpp index 6f6fb37a9..d5d66a04d 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -2061,59 +2061,18 @@ void R_StoreWallRange(INT32 start, INT32 stop) } } - if (!bothceilingssky && !bothfloorssky) - { - if (worldhigh <= worldbottom && worldhighslope <= worldbottomslope) - { - ds_p->sprbottomclip = negonearray; - ds_p->bsilheight = INT32_MAX; - ds_p->silhouette |= SIL_BOTTOM; - } - - if (worldlow >= worldtop && worldlowslope >= worldtopslope) - { - ds_p->sprtopclip = screenheightarray; - ds_p->tsilheight = INT32_MIN; - ds_p->silhouette |= SIL_TOP; - } - } - //SoM: 3/25/2000: This code fixes an automap bug that didn't check // frontsector->ceiling and backsector->floor to see if a door was closed. // Without the following code, sprites get displayed behind closed doors. - if (!bothceilingssky && !bothfloorssky) + if (doorclosed) { - if (doorclosed || (worldhigh <= worldbottom && worldhighslope <= worldbottomslope)) - { - ds_p->sprbottomclip = negonearray; - ds_p->bsilheight = INT32_MAX; - ds_p->silhouette |= SIL_BOTTOM; - } + ds_p->sprbottomclip = negonearray; + ds_p->bsilheight = INT32_MAX; + ds_p->silhouette |= SIL_BOTTOM; - if (doorclosed || (worldlow >= worldtop && worldlowslope >= worldtopslope)) - { // killough 1/17/98, 2/8/98 - ds_p->sprtopclip = screenheightarray; - ds_p->tsilheight = INT32_MIN; - ds_p->silhouette |= SIL_TOP; - } - - //SoM: 3/25/2000: This code fixes an automap bug that didn't check - // frontsector->ceiling and backsector->floor to see if a door was closed. - // Without the following code, sprites get displayed behind closed doors. - { - if (doorclosed || (worldhigh <= worldbottom && worldhighslope <= worldbottomslope)) - { - ds_p->sprbottomclip = negonearray; - ds_p->bsilheight = INT32_MAX; - ds_p->silhouette |= SIL_BOTTOM; - } - if (doorclosed || (worldlow >= worldtop && worldlowslope >= worldtopslope)) - { // killough 1/17/98, 2/8/98 - ds_p->sprtopclip = screenheightarray; - ds_p->tsilheight = INT32_MIN; - ds_p->silhouette |= SIL_TOP; - } - } + ds_p->sprtopclip = screenheightarray; + ds_p->tsilheight = INT32_MIN; + ds_p->silhouette |= SIL_TOP; } if (bothfloorssky) @@ -2122,7 +2081,8 @@ void R_StoreWallRange(INT32 start, INT32 stop) // this is the same but for upside down thok barriers where the floor is sky and the ceiling is normal markfloor = false; } - else if (worldlow != worldbottom + else if (doorclosed + || worldlow != worldbottom || worldlowslope != worldbottomslope || backsector->f_slope != frontsector->f_slope || backsector->floorpic != frontsector->floorpic @@ -2157,7 +2117,8 @@ void R_StoreWallRange(INT32 start, INT32 stop) // so we can see the floor of thok barriers always regardless of sector properties markceiling = false; } - else if (worldhigh != worldtop + else if (doorclosed + || worldhigh != worldtop || worldhighslope != worldtopslope || backsector->c_slope != frontsector->c_slope || backsector->ceilingpic != frontsector->ceilingpic @@ -2185,16 +2146,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) markceiling = false; } - if (!bothceilingssky && !bothfloorssky) - { - if ((worldhigh <= worldbottom && worldhighslope <= worldbottomslope) - || (worldlow >= worldtop && worldlowslope >= worldtopslope)) - { - // closed door - markceiling = markfloor = true; - } - } - // check TOP TEXTURE if (!bothceilingssky // never draw the top texture if on && (worldhigh < worldtop || worldhighslope < worldtopslope))