From be99670a39ec936ce07fdc55ebdea67d3a2673e9 Mon Sep 17 00:00:00 2001 From: Hannu Hanhi Date: Sat, 25 Apr 2020 21:43:20 +0300 Subject: [PATCH] More HWR_ProcessSeg sky code from master --- src/hardware/hw_main.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 5d503fb17..7f640553f 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -1183,8 +1183,10 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom if (gr_backsector) { - INT32 gr_toptexture, gr_bottomtexture; + INT32 gr_toptexture = 0, gr_bottomtexture = 0; // two sided line + boolean bothceilingssky = false; // turned on if both back and front ceilings are sky + boolean bothfloorssky = false; // likewise, but for floors #ifdef ESLOPE SLOPEPARAMS(gr_backsector->c_slope, worldhigh, worldhighslope, gr_backsector->ceilingheight) @@ -1197,17 +1199,23 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom // hack to allow height changes in outdoor areas // This is what gets rid of the upper textures if there should be sky - if (gr_frontsector->ceilingpic == skyflatnum && - gr_backsector->ceilingpic == skyflatnum) + if (gr_frontsector->ceilingpic == skyflatnum + && gr_backsector->ceilingpic == skyflatnum) { - worldtop = worldhigh; -#ifdef ESLOPE - worldtopslope = worldhighslope; -#endif + bothceilingssky = true; } - gr_toptexture = R_GetTextureNum(gr_sidedef->toptexture); - gr_bottomtexture = R_GetTextureNum(gr_sidedef->bottomtexture); + // likewise, but for floors and upper textures + if (gr_frontsector->floorpic == skyflatnum + && gr_backsector->floorpic == skyflatnum) + { + bothfloorssky = true; + } + + if (!bothceilingssky) + gr_toptexture = R_GetTextureNum(gr_sidedef->toptexture); + if (!bothfloorssky) + gr_bottomtexture = R_GetTextureNum(gr_sidedef->bottomtexture); // check TOP TEXTURE if ((