- fixed handling of wrapped midtextures to be actually useful when used in sky sectors.

This commit is contained in:
Christoph Oelckers 2018-11-01 08:02:11 +01:00
parent 77c5c1eb19
commit 23aff98e90

View file

@ -1124,6 +1124,7 @@ void GLWall::DoMidTexture(HWDrawInfo *di, seg_t * seg, bool drawfogboundary,
float texturetop, texturebottom; float texturetop, texturebottom;
bool wrap = (seg->linedef->flags&ML_WRAP_MIDTEX) || (seg->sidedef->Flags&WALLF_WRAP_MIDTEX); bool wrap = (seg->linedef->flags&ML_WRAP_MIDTEX) || (seg->sidedef->Flags&WALLF_WRAP_MIDTEX);
bool mirrory = false; 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.mRenderHeight = -tci.mRenderHeight;
tci.mScale.Y = -tci.mScale.Y; 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) if ((seg->linedef->flags & ML_DONTPEGBOTTOM) >0)
{ {
texturebottom = MAX(realfront->GetPlaneTexZ(sector_t::floor), realback->GetPlaneTexZ(sector_t::floor)) + rowoffset; 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 (!tex || tex->UseType==ETextureType::Null)
{ {
if (front->GetTexture(sector_t::ceiling) == skyflatnum && 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 // intra-sky lines do not clip the texture at all if there's no upper texture.
topleft = topright = wrap ? 1e16f : texturetop; topleft = topright = texturetop;
} }
else else
{ {
@ -1789,7 +1790,7 @@ void GLWall::Process(HWDrawInfo *di, seg_t *seg, sector_t * frontsector, sector_
sector_t * segback; sector_t * segback;
#ifdef _DEBUG #ifdef _DEBUG
if (seg->linedef->Index() == 3407) if (seg->linedef->Index() == 14454)
{ {
int a = 0; int a = 0;
} }