Skip to content

Commit

Permalink
Fixed applying of Doom 64 lighting to horizon portals
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-lysiuk committed Dec 28, 2017
1 parent fbb931b commit 8ca3427
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/gl/scene/gl_portal.cpp
Expand Up @@ -1180,6 +1180,7 @@ void GLHorizonPortal::DrawContents()


gl_RenderState.SetMaterial(gltexture, CLAMP_NONE, 0, -1, false);
gl_RenderState.SetObjectColor(origin->specialcolor);

gl_SetPlaneTextureRotation(sp, gltexture);
gl_RenderState.AlphaFunc(GL_GEQUAL, 0.f);
Expand Down Expand Up @@ -1237,6 +1238,7 @@ void GLEEHorizonPortal::DrawContents()
horz.plane.GetFromSector(sector, sector_t::ceiling);
horz.lightlevel = gl_ClampLight(sector->GetCeilingLight());
horz.colormap = sector->Colormap;
horz.specialcolor = 0xffffffff;
if (portal->mType == PORTS_PLANE)
{
horz.plane.Texheight = r_viewpoint.Pos.Z + fabs(horz.plane.Texheight);
Expand All @@ -1250,6 +1252,7 @@ void GLEEHorizonPortal::DrawContents()
horz.plane.GetFromSector(sector, sector_t::floor);
horz.lightlevel = gl_ClampLight(sector->GetFloorLight());
horz.colormap = sector->Colormap;
horz.specialcolor = 0xffffffff;
if (portal->mType == PORTS_PLANE)
{
horz.plane.Texheight = r_viewpoint.Pos.Z - fabs(horz.plane.Texheight);
Expand Down
1 change: 1 addition & 0 deletions src/gl/scene/gl_portal.h
Expand Up @@ -48,6 +48,7 @@ struct GLHorizonInfo
GLSectorPlane plane;
int lightlevel;
FColormap colormap;
PalEntry specialcolor;
};

struct GLSkyInfo
Expand Down
2 changes: 2 additions & 0 deletions src/gl/scene/gl_walls.cpp
Expand Up @@ -441,6 +441,7 @@ bool GLWall::DoHorizon(seg_t * seg,sector_t * fs, vertex_t * v1,vertex_t * v2)
hi.plane.GetFromSector(fs, sector_t::ceiling);
hi.lightlevel = gl_ClampLight(fs->GetCeilingLight());
hi.colormap = fs->Colormap;
hi.specialcolor = fs->SpecialColors[sector_t::ceiling];

if (fs->e->XFloor.ffloors.Size())
{
Expand Down Expand Up @@ -469,6 +470,7 @@ bool GLWall::DoHorizon(seg_t * seg,sector_t * fs, vertex_t * v1,vertex_t * v2)
hi.plane.GetFromSector(fs, sector_t::floor);
hi.lightlevel = gl_ClampLight(fs->GetFloorLight());
hi.colormap = fs->Colormap;
hi.specialcolor = fs->SpecialColors[sector_t::floor];

if (fs->e->XFloor.ffloors.Size())
{
Expand Down

0 comments on commit 8ca3427

Please sign in to comment.