diff --git a/src/hwrenderer/scene/hw_walls.cpp b/src/hwrenderer/scene/hw_walls.cpp index 4910b56b6..8c5e90d87 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; }