- moved the code in gl_data.cpp to better fitting places

* the MAPINFO options now get handled in g_mapinfo.cpp and g_level.cpp, just like the rest of them as members of level_info_t and FLevelLocals.
* RecalcVertexHeights has been made a member of vertex_t and been moved to p_sectors.cpp.
* the dumpgeometry CCMD has been moved to p_setup.cpp
This commit is contained in:
Christoph Oelckers 2018-04-01 18:45:27 +02:00
commit 65e7b6dfaa
22 changed files with 249 additions and 390 deletions

View file

@ -53,8 +53,6 @@ CUSTOM_CVAR(Bool, gl_enhanced_nightvision, true, CVAR_ARCHIVE|CVAR_NOINITCALL)
GLRenderer->mShaderManager->ResetFixedColormap();
}
}
CVAR(Bool, gl_brightfog, false, CVAR_ARCHIVE);
CVAR(Bool, gl_lightadditivesurfaces, false, CVAR_ARCHIVE);
@ -97,14 +95,6 @@ CUSTOM_CVAR(Int,gl_fogmode,1,CVAR_ARCHIVE|CVAR_NOINITCALL)
if (self<0) self=0;
}
CUSTOM_CVAR(Int, gl_lightmode, 3 ,CVAR_ARCHIVE|CVAR_NOINITCALL)
{
int newself = self;
if (newself > 4) newself=8; // use 8 for software lighting to avoid conflicts with the bit mask
if (newself < 0) newself=0;
if (self != newself) self = newself;
glset.lightmode = newself;
}
@ -172,7 +162,7 @@ int gl_CalcLightLevel(int lightlevel, int rellight, bool weapon)
if (lightlevel == 0) return 0;
if ((glset.lightmode & 2) && lightlevel < 192 && !weapon)
if ((level.lightmode & 2) && lightlevel < 192 && !weapon)
{
if (lightlevel > 100)
{
@ -210,7 +200,7 @@ static PalEntry gl_CalcLightColor(int light, PalEntry pe, int blendfactor)
{
int r,g,b;
if (glset.lightmode == 8)
if (level.lightmode == 8)
{
return pe;
}
@ -276,7 +266,7 @@ float gl_GetFogDensity(int lightlevel, PalEntry fogcolor, int sectorfogdensity)
{
float density;
if (glset.lightmode & 4)
if (level.lightmode & 4)
{
// uses approximations of Legacy's default settings.
density = level.fogdensity ? level.fogdensity : 18;
@ -289,9 +279,9 @@ float gl_GetFogDensity(int lightlevel, PalEntry fogcolor, int sectorfogdensity)
else if ((fogcolor.d & 0xffffff) == 0)
{
// case 2: black fog
if (glset.lightmode != 8 && !(level.flags3 & LEVEL3_NOLIGHTFADE))
if (level.lightmode != 8 && !(level.flags3 & LEVEL3_NOLIGHTFADE))
{
density = distfogtable[glset.lightmode != 0][gl_ClampLight(lightlevel)];
density = distfogtable[level.lightmode != 0][gl_ClampLight(lightlevel)];
}
else
{
@ -350,7 +340,7 @@ bool gl_CheckFog(sector_t *frontsector, sector_t *backsector)
else if (level.outsidefogdensity != 0 && APART(level.info->outsidefog) != 0xff && (fogcolor.d & 0xffffff) == (level.info->outsidefog & 0xffffff))
{
}
else if (level.fogdensity!=0 || (glset.lightmode & 4))
else if (level.fogdensity!=0 || (level.lightmode & 4))
{
// case 3: level has fog density set
}
@ -369,7 +359,7 @@ bool gl_CheckFog(sector_t *frontsector, sector_t *backsector)
{
return false;
}
else if (level.fogdensity!=0 || (glset.lightmode & 4))
else if (level.fogdensity!=0 || (level.lightmode & 4))
{
// case 3: level has fog density set
return false;
@ -459,7 +449,7 @@ void gl_SetFog(int lightlevel, int rellight, bool fullbright, const FColormap *c
}
else
{
if (glset.lightmode == 2 && fogcolor == 0)
if (level.lightmode == 2 && fogcolor == 0)
{
float light = gl_CalcLightLevel(lightlevel, rellight, false);
gl_SetShaderLight(light, lightlevel);
@ -480,7 +470,7 @@ void gl_SetFog(int lightlevel, int rellight, bool fullbright, const FColormap *c
gl_RenderState.SetFog(fogcolor, fogdensity);
// Korshun: fullbright fog like in software renderer.
if (glset.lightmode == 8 && glset.brightfog && fogdensity != 0 && fogcolor != 0)
if (level.lightmode == 8 && level.brightfog && fogdensity != 0 && fogcolor != 0)
{
gl_RenderState.SetSoftLightLevel(255);
}