- restored portal code that shouldn't have been deleted.

This commit is contained in:
Christoph Oelckers 2018-11-08 20:39:44 +01:00
parent cdd60b1431
commit f6af50fc74
4 changed files with 35 additions and 18 deletions

View file

@ -702,6 +702,21 @@ void HWDrawInfo::DoSubsector(subsector_t * sub)
ss_renderflags[sub->Index()] =
(sub->numlines > 2) ? SSRF_PROCESSED|SSRF_RENDERALL : SSRF_PROCESSED;
if (sub->hacked & 1) AddHackedSubsector(sub);
// This is for portal coverage.
FSectorPortalGroup *portal;
portal = fakesector->GetPortalGroup(sector_t::ceiling);
if (portal != nullptr)
{
AddSubsectorToPortal(portal, sub);
}
portal = fakesector->GetPortalGroup(sector_t::floor);
if (portal != nullptr)
{
AddSubsectorToPortal(portal, sub);
}
}
}
}

View file

@ -655,3 +655,22 @@ void HWDrawInfo::ProcessScene(bool toscreen, const std::function<void(HWDrawInfo
DrawScene(this, toscreen ? DM_MAINVIEW : DM_OFFSCREEN);
}
//==========================================================================
//
//
//
//==========================================================================
void HWDrawInfo::AddSubsectorToPortal(FSectorPortalGroup *ptg, subsector_t *sub)
{
auto portal = FindPortal(ptg);
if (!portal)
{
portal = new HWScenePortal(screen->mPortalState, new HWSectorStackPortal(ptg));
Portals.Push(portal);
}
auto ptl = static_cast<HWSectorStackPortal*>(static_cast<HWScenePortal*>(portal)->mScene);
ptl->AddSubsector(sub);
}

View file

@ -300,6 +300,7 @@ public:
void DrawPlayerSprites(bool hudModelStep, FRenderState &state);
void ProcessLowerMinisegs(TArray<seg_t *> &lowersegs);
void AddSubsectorToPortal(FSectorPortalGroup *portal, subsector_t *sub);
void AddWall(GLWall *w);
void AddMirrorSurface(GLWall *w);

View file

@ -1393,22 +1393,4 @@ void HWDrawInfo::ProcessSectorStacks(area_t in_area)
CeilingStacks.Clear();
}
//==========================================================================
//
//
//
//==========================================================================
void HWDrawInfo::AddSubsectorToPortal(FSectorPortalGroup *ptg, subsector_t *sub)
{
auto portal = FindPortal(ptg);
if (!portal)
{
portal = new HWScenePortal(screen->mPortalState, new HWSectorStackPortal(ptg));
Portals.Push(portal);
}
auto ptl = static_cast<HWSectorStackPortal*>(static_cast<HWScenePortal*>(portal)->mScene);
ptl->AddSubsector(sub);
}
#endif