- 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=sec->floorplane;
dest->ceilingplane.FlipVert(); dest->ceilingplane.FlipVert();
dest->planes[sector_t::ceiling].TexZ = dest->planes[sector_t::floor].TexZ; 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; return dest;
} }
} }

View file

@ -524,11 +524,18 @@ void GLFlat::ProcessSector(sector_t * frontsector)
lightlevel = gl_ClampLight(frontsector->GetFloorLight()); lightlevel = gl_ClampLight(frontsector->GetFloorLight());
Colormap=frontsector->ColorMap; Colormap=frontsector->ColorMap;
if ((stack = (frontsector->portals[sector_t::floor] != NULL))) if ((stack = (frontsector->portals[sector_t::floor] != NULL)))
{
if (!frontsector->PortalBlocksView(sector_t::floor))
{ {
gl_drawinfo->AddFloorStack(sector); gl_drawinfo->AddFloorStack(sector);
alpha = frontsector->GetAlpha(sector_t::floor) / 65536.0f; alpha = frontsector->GetAlpha(sector_t::floor) / 65536.0f;
} }
else else
{
alpha = 1.f;
}
}
else
{ {
alpha = 1.0f-frontsector->GetReflect(sector_t::floor); alpha = 1.0f-frontsector->GetReflect(sector_t::floor);
} }
@ -575,11 +582,18 @@ void GLFlat::ProcessSector(sector_t * frontsector)
lightlevel = gl_ClampLight(frontsector->GetCeilingLight()); lightlevel = gl_ClampLight(frontsector->GetCeilingLight());
Colormap=frontsector->ColorMap; Colormap=frontsector->ColorMap;
if ((stack = (frontsector->portals[sector_t::ceiling] != NULL))) if ((stack = (frontsector->portals[sector_t::ceiling] != NULL)))
{
if (!frontsector->PortalBlocksView(sector_t::ceiling))
{ {
gl_drawinfo->AddCeilingStack(sector); gl_drawinfo->AddCeilingStack(sector);
alpha = frontsector->GetAlpha(sector_t::ceiling) / 65536.0f; alpha = frontsector->GetAlpha(sector_t::ceiling) / 65536.0f;
} }
else else
{
alpha = 1.f;
}
}
else
{ {
alpha = 1.0f-frontsector->GetReflect(sector_t::ceiling); alpha = 1.0f-frontsector->GetReflect(sector_t::ceiling);
} }

View file

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

View file

@ -175,7 +175,7 @@ void GLWall::PutPortal(int ptype)
portal = GLPortal::FindPortal(skybox); portal = GLPortal::FindPortal(skybox);
if (!portal) 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); if (skybox->special1 != SKYBOX_MAP) portal = new GLEEHorizonPortal(skybox);
else portal = new GLSkyboxPortal(skybox); else portal = new GLSkyboxPortal(skybox);
} }