Fixed applying of Doom 64 lighting to horizon portals

https://forum.zdoom.org/viewtopic.php?t=58878
This commit is contained in:
alexey.lysiuk 2017-12-28 18:32:26 +02:00
parent fbb931b759
commit 8ca3427850
3 changed files with 6 additions and 0 deletions

View file

@ -1180,6 +1180,7 @@ void GLHorizonPortal::DrawContents()
gl_RenderState.SetMaterial(gltexture, CLAMP_NONE, 0, -1, false); gl_RenderState.SetMaterial(gltexture, CLAMP_NONE, 0, -1, false);
gl_RenderState.SetObjectColor(origin->specialcolor);
gl_SetPlaneTextureRotation(sp, gltexture); gl_SetPlaneTextureRotation(sp, gltexture);
gl_RenderState.AlphaFunc(GL_GEQUAL, 0.f); gl_RenderState.AlphaFunc(GL_GEQUAL, 0.f);
@ -1237,6 +1238,7 @@ void GLEEHorizonPortal::DrawContents()
horz.plane.GetFromSector(sector, sector_t::ceiling); horz.plane.GetFromSector(sector, sector_t::ceiling);
horz.lightlevel = gl_ClampLight(sector->GetCeilingLight()); horz.lightlevel = gl_ClampLight(sector->GetCeilingLight());
horz.colormap = sector->Colormap; horz.colormap = sector->Colormap;
horz.specialcolor = 0xffffffff;
if (portal->mType == PORTS_PLANE) if (portal->mType == PORTS_PLANE)
{ {
horz.plane.Texheight = r_viewpoint.Pos.Z + fabs(horz.plane.Texheight); 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.plane.GetFromSector(sector, sector_t::floor);
horz.lightlevel = gl_ClampLight(sector->GetFloorLight()); horz.lightlevel = gl_ClampLight(sector->GetFloorLight());
horz.colormap = sector->Colormap; horz.colormap = sector->Colormap;
horz.specialcolor = 0xffffffff;
if (portal->mType == PORTS_PLANE) if (portal->mType == PORTS_PLANE)
{ {
horz.plane.Texheight = r_viewpoint.Pos.Z - fabs(horz.plane.Texheight); horz.plane.Texheight = r_viewpoint.Pos.Z - fabs(horz.plane.Texheight);

View file

@ -48,6 +48,7 @@ struct GLHorizonInfo
GLSectorPlane plane; GLSectorPlane plane;
int lightlevel; int lightlevel;
FColormap colormap; FColormap colormap;
PalEntry specialcolor;
}; };
struct GLSkyInfo struct GLSkyInfo

View file

@ -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.plane.GetFromSector(fs, sector_t::ceiling);
hi.lightlevel = gl_ClampLight(fs->GetCeilingLight()); hi.lightlevel = gl_ClampLight(fs->GetCeilingLight());
hi.colormap = fs->Colormap; hi.colormap = fs->Colormap;
hi.specialcolor = fs->SpecialColors[sector_t::ceiling];
if (fs->e->XFloor.ffloors.Size()) 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.plane.GetFromSector(fs, sector_t::floor);
hi.lightlevel = gl_ClampLight(fs->GetFloorLight()); hi.lightlevel = gl_ClampLight(fs->GetFloorLight());
hi.colormap = fs->Colormap; hi.colormap = fs->Colormap;
hi.specialcolor = fs->SpecialColors[sector_t::floor];
if (fs->e->XFloor.ffloors.Size()) if (fs->e->XFloor.ffloors.Size())
{ {