From 23aff98e90b71598f832213067a60c2021a330ec Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 1 Nov 2018 08:02:11 +0100 Subject: [PATCH] - fixed handling of wrapped midtextures to be actually useful when used in sky sectors. --- src/hwrenderer/scene/hw_walls.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/hwrenderer/scene/hw_walls.cpp b/src/hwrenderer/scene/hw_walls.cpp index 4910b56b61..8c5e90d875 100644 --- a/src/hwrenderer/scene/hw_walls.cpp +++ b/src/hwrenderer/scene/hw_walls.cpp @@ -1124,6 +1124,7 @@ void GLWall::DoMidTexture(HWDrawInfo *di, seg_t * seg, bool drawfogboundary, float texturetop, texturebottom; bool wrap = (seg->linedef->flags&ML_WRAP_MIDTEX) || (seg->sidedef->Flags&WALLF_WRAP_MIDTEX); bool mirrory = false; + float rowoffset = 0; // // @@ -1142,7 +1143,7 @@ void GLWall::DoMidTexture(HWDrawInfo *di, seg_t * seg, bool drawfogboundary, tci.mRenderHeight = -tci.mRenderHeight; tci.mScale.Y = -tci.mScale.Y; } - float rowoffset = tci.RowOffset(seg->sidedef->GetTextureYOffset(side_t::mid)); + rowoffset = tci.RowOffset(seg->sidedef->GetTextureYOffset(side_t::mid)); if ((seg->linedef->flags & ML_DONTPEGBOTTOM) >0) { texturebottom = MAX(realfront->GetPlaneTexZ(sector_t::floor), realback->GetPlaneTexZ(sector_t::floor)) + rowoffset; @@ -1173,10 +1174,10 @@ void GLWall::DoMidTexture(HWDrawInfo *di, seg_t * seg, bool drawfogboundary, if (!tex || tex->UseType==ETextureType::Null) { if (front->GetTexture(sector_t::ceiling) == skyflatnum && - back->GetTexture(sector_t::ceiling) == skyflatnum) + back->GetTexture(sector_t::ceiling) == skyflatnum && !wrap) { - // intra-sky lines do not clip the texture at all if there's no upper texture - topleft = topright = wrap ? 1e16f : texturetop; + // intra-sky lines do not clip the texture at all if there's no upper texture. + topleft = topright = texturetop; } else { @@ -1789,7 +1790,7 @@ void GLWall::Process(HWDrawInfo *di, seg_t *seg, sector_t * frontsector, sector_ sector_t * segback; #ifdef _DEBUG - if (seg->linedef->Index() == 3407) + if (seg->linedef->Index() == 14454) { int a = 0; }