From 8ca3427850c585e4befaab028737498702b5fbc5 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Thu, 28 Dec 2017 18:32:26 +0200 Subject: [PATCH] Fixed applying of Doom 64 lighting to horizon portals https://forum.zdoom.org/viewtopic.php?t=58878 --- src/gl/scene/gl_portal.cpp | 3 +++ src/gl/scene/gl_portal.h | 1 + src/gl/scene/gl_walls.cpp | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/gl/scene/gl_portal.cpp b/src/gl/scene/gl_portal.cpp index 2e5df1da9d..ed38127662 100644 --- a/src/gl/scene/gl_portal.cpp +++ b/src/gl/scene/gl_portal.cpp @@ -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); @@ -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); @@ -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); diff --git a/src/gl/scene/gl_portal.h b/src/gl/scene/gl_portal.h index 9ef8cf5f72..010472c977 100644 --- a/src/gl/scene/gl_portal.h +++ b/src/gl/scene/gl_portal.h @@ -48,6 +48,7 @@ struct GLHorizonInfo GLSectorPlane plane; int lightlevel; FColormap colormap; + PalEntry specialcolor; }; struct GLSkyInfo diff --git a/src/gl/scene/gl_walls.cpp b/src/gl/scene/gl_walls.cpp index 018f8ab678..529d46bb56 100644 --- a/src/gl/scene/gl_walls.cpp +++ b/src/gl/scene/gl_walls.cpp @@ -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()) { @@ -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()) {