mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-29 07:22:05 +00:00
- added the flat dispatcher for textured lighting.
This commit is contained in:
parent
ec7b4b1ba4
commit
4412f99b38
3 changed files with 32 additions and 0 deletions
|
@ -500,6 +500,33 @@ bool GLWall::PutWallCompat(int passflag)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//==========================================================================
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//==========================================================================
|
||||||
|
|
||||||
|
bool GLFlat::PutFlatCompat(bool fog)
|
||||||
|
{
|
||||||
|
// are lights possible?
|
||||||
|
if (gl_fixedcolormap != CM_DEFAULT || !gl_lights || !gltexture || renderstyle != STYLE_Translucent || alpha < 1.f - FLT_EPSILON || sector->lighthead == NULL) return false;
|
||||||
|
|
||||||
|
static int list_indices[2][2] =
|
||||||
|
{ { GLLDL_FLATS_PLAIN, GLLDL_FLATS_FOG },{ GLLDL_FLATS_MASKED, GLLDL_FLATS_FOGMASKED } };
|
||||||
|
|
||||||
|
bool masked = gltexture->isMasked() && ((renderflags&SSRF_RENDER3DPLANES) || stack);
|
||||||
|
bool foggy = gl_CheckFog(&Colormap, lightlevel) || level.flags&LEVEL_HASFADETABLE;
|
||||||
|
|
||||||
|
|
||||||
|
int list = list_indices[masked][foggy];
|
||||||
|
if (list == GLLDL_FLATS_PLAIN)
|
||||||
|
{
|
||||||
|
if (gltexture->tex->gl_info.Brightmap && gl.glslversion >= 0.f) list = GLLDL_FLATS_BRIGHT;
|
||||||
|
}
|
||||||
|
gl_drawinfo->dldrawlists[list].AddFlat(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
// Fog boundary without any shader support
|
// Fog boundary without any shader support
|
||||||
|
|
|
@ -463,6 +463,10 @@ inline void GLFlat::PutFlat(bool fog)
|
||||||
{
|
{
|
||||||
Colormap.Clear();
|
Colormap.Clear();
|
||||||
}
|
}
|
||||||
|
if (gl.lightmethod == LM_SOFTWARE)
|
||||||
|
{
|
||||||
|
if (PutFlatCompat(fog)) return;
|
||||||
|
}
|
||||||
if (renderstyle!=STYLE_Translucent || alpha < 1.f - FLT_EPSILON || fog || gltexture == NULL)
|
if (renderstyle!=STYLE_Translucent || alpha < 1.f - FLT_EPSILON || fog || gltexture == NULL)
|
||||||
{
|
{
|
||||||
// translucent 3D floors go into the regular translucent list, translucent portals go into the translucent border list.
|
// translucent 3D floors go into the regular translucent list, translucent portals go into the translucent border list.
|
||||||
|
|
|
@ -304,6 +304,7 @@ public:
|
||||||
void ProcessLights(bool istrans);
|
void ProcessLights(bool istrans);
|
||||||
|
|
||||||
void PutFlat(bool fog = false);
|
void PutFlat(bool fog = false);
|
||||||
|
bool PutFlatCompat(bool fog);
|
||||||
void Process(sector_t * model, int whichplane, bool notexture);
|
void Process(sector_t * model, int whichplane, bool notexture);
|
||||||
void SetFrom3DFloor(F3DFloor *rover, bool top, bool underside);
|
void SetFrom3DFloor(F3DFloor *rover, bool top, bool underside);
|
||||||
void ProcessSector(sector_t * frontsector);
|
void ProcessSector(sector_t * frontsector);
|
||||||
|
|
Loading…
Reference in a new issue