mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-12-01 16:41:09 +00:00
Mapping error workaround
This commit is contained in:
parent
a092a03c6d
commit
449d4963ae
1 changed files with 23 additions and 3 deletions
|
@ -228,9 +228,29 @@ void RenderPolyWall::ClampHeight(TriVertex &v1, TriVertex &v2)
|
|||
FTexture *RenderPolyWall::GetTexture()
|
||||
{
|
||||
FTexture *tex = TexMan(Line->sidedef->GetTexture(Texpart), true);
|
||||
if (tex == nullptr || tex->UseType == FTexture::TEX_Null)
|
||||
{
|
||||
// Mapping error. Doom floodfills this with a plane.
|
||||
// This code doesn't do that, but at least it uses the "right" texture..
|
||||
|
||||
if (Line->linedef && Line->backsector && Line->linedef->sidedef[0] == Line->sidedef)
|
||||
{
|
||||
if (Texpart == side_t::top)
|
||||
tex = TexMan(Line->linedef->backsector->GetTexture(sector_t::ceiling), true);
|
||||
else if (Texpart == side_t::bottom)
|
||||
tex = TexMan(Line->linedef->backsector->GetTexture(sector_t::floor), true);
|
||||
}
|
||||
if (Line->linedef && Line->backsector && Line->linedef->sidedef[1] == Line->sidedef)
|
||||
{
|
||||
if (Texpart == side_t::top)
|
||||
tex = TexMan(Line->linedef->frontsector->GetTexture(sector_t::ceiling), true);
|
||||
else if (Texpart == side_t::bottom)
|
||||
tex = TexMan(Line->linedef->frontsector->GetTexture(sector_t::floor), true);
|
||||
}
|
||||
|
||||
if (tex == nullptr || tex->UseType == FTexture::TEX_Null)
|
||||
return nullptr;
|
||||
else
|
||||
}
|
||||
return tex;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue