- copied over some stuff from the abandoned portals branch.

This commit is contained in:
Christoph Oelckers 2016-02-15 13:11:31 +01:00
parent b60069bb26
commit 9608252873
4 changed files with 33 additions and 13 deletions

View file

@ -212,6 +212,8 @@ sector_t * gl_FakeFlat(sector_t * sec, sector_t * dest, area_t in_area, bool bac
dest->ceilingplane=sec->floorplane;
dest->ceilingplane.FlipVert();
dest->planes[sector_t::ceiling].TexZ = dest->planes[sector_t::floor].TexZ;
dest->portals[sector_t::ceiling] = NULL;
dest->portals[sector_t::floor] = NULL;
return dest;
}
}

View file

@ -525,8 +525,15 @@ void GLFlat::ProcessSector(sector_t * frontsector)
Colormap=frontsector->ColorMap;
if ((stack = (frontsector->portals[sector_t::floor] != NULL)))
{
gl_drawinfo->AddFloorStack(sector);
alpha = frontsector->GetAlpha(sector_t::floor)/65536.0f;
if (!frontsector->PortalBlocksView(sector_t::floor))
{
gl_drawinfo->AddFloorStack(sector);
alpha = frontsector->GetAlpha(sector_t::floor) / 65536.0f;
}
else
{
alpha = 1.f;
}
}
else
{
@ -576,8 +583,15 @@ void GLFlat::ProcessSector(sector_t * frontsector)
Colormap=frontsector->ColorMap;
if ((stack = (frontsector->portals[sector_t::ceiling] != NULL)))
{
gl_drawinfo->AddCeilingStack(sector);
alpha = frontsector->GetAlpha(sector_t::ceiling)/65536.0f;
if (!frontsector->PortalBlocksView(sector_t::ceiling))
{
gl_drawinfo->AddCeilingStack(sector);
alpha = frontsector->GetAlpha(sector_t::ceiling) / 65536.0f;
}
else
{
alpha = 1.f;
}
}
else
{

View file

@ -142,6 +142,8 @@ void GLWall::SkyPlane(sector_t *sector, int plane, bool allowreflect)
FPortal *portal = sector->portals[plane];
if (portal != NULL)
{
if (sector->PortalBlocksView(plane)) return;
if (GLPortal::instack[1 - plane]) return;
ptype = PORTALTYPE_SECTORSTACK;
this->portal = portal;
@ -302,8 +304,6 @@ void GLWall::SkyTop(seg_t * seg,sector_t * fs,sector_t * bs,vertex_t * v1,vertex
}
else
{
FPortal *pfront = fs->portals[sector_t::ceiling];
FPortal *pback = bs->portals[sector_t::ceiling];
float frontreflect = fs->GetReflect(sector_t::ceiling);
if (frontreflect > 0)
{
@ -314,9 +314,12 @@ void GLWall::SkyTop(seg_t * seg,sector_t * fs,sector_t * bs,vertex_t * v1,vertex
return;
}
}
else if (pfront == NULL || pfront == pback)
else
{
return;
FPortal *pfront = fs->portals[sector_t::ceiling];
FPortal *pback = bs->portals[sector_t::ceiling];
if (pfront == NULL || fs->PortalBlocksView(sector_t::ceiling)) return;
if (pfront == pback && !bs->PortalBlocksView(sector_t::ceiling)) return;
}
// stacked sectors
@ -378,8 +381,6 @@ void GLWall::SkyBottom(seg_t * seg,sector_t * fs,sector_t * bs,vertex_t * v1,ver
}
else
{
FPortal *pfront = fs->portals[sector_t::floor];
FPortal *pback = bs->portals[sector_t::floor];
float frontreflect = fs->GetReflect(sector_t::floor);
if (frontreflect > 0)
{
@ -390,9 +391,12 @@ void GLWall::SkyBottom(seg_t * seg,sector_t * fs,sector_t * bs,vertex_t * v1,ver
return;
}
}
else if (pfront == NULL || pfront == pback)
else
{
return;
FPortal *pfront = fs->portals[sector_t::floor];
FPortal *pback = bs->portals[sector_t::floor];
if (pfront == NULL || fs->PortalBlocksView(sector_t::floor)) return;
if (pfront == pback && !bs->PortalBlocksView(sector_t::floor)) return;
}
// stacked sectors

View file

@ -175,7 +175,7 @@ void GLWall::PutPortal(int ptype)
portal = GLPortal::FindPortal(skybox);
if (!portal)
{
// either a regulat skybox or an Eternity-style horizon
// either a regular skybox or an Eternity-style horizon
if (skybox->special1 != SKYBOX_MAP) portal = new GLEEHorizonPortal(skybox);
else portal = new GLSkyboxPortal(skybox);
}