- made application of dynamic lights to additively blended surfaces a MAPINFO option. In most cases this is not wanted but sometimes this can be used to good effect so it should be there as an option.

This commit is contained in:
Christoph Oelckers 2016-12-06 12:58:45 +01:00
commit 17698467d7
6 changed files with 33 additions and 10 deletions

View file

@ -57,6 +57,7 @@ long gl_frameCount;
EXTERN_CVAR(Int, gl_lightmode)
EXTERN_CVAR(Bool, gl_brightfog)
EXTERN_CVAR(Bool, gl_lightadditivesurfaces)
CUSTOM_CVAR(Float, maxviewpitch, 90.f, CVAR_ARCHIVE|CVAR_SERVERINFO)
{
@ -203,6 +204,7 @@ struct FGLROptions : public FOptionalMapinfoData
skyrotatevector = FVector3(0,0,1);
skyrotatevector2 = FVector3(0,0,1);
pixelstretch = 1.2f;
lightadditivesurfaces = false;
}
virtual FOptionalMapinfoData *Clone() const
{
@ -217,6 +219,7 @@ struct FGLROptions : public FOptionalMapinfoData
newopt->skyrotatevector = skyrotatevector;
newopt->skyrotatevector2 = skyrotatevector2;
newopt->pixelstretch = pixelstretch;
newopt->lightadditivesurfaces = lightadditivesurfaces;
return newopt;
}
int fogdensity;
@ -224,8 +227,9 @@ struct FGLROptions : public FOptionalMapinfoData
int skyfog;
int lightmode;
int brightfog;
SBYTE nocoloredspritelighting;
SBYTE notexturefill;
int8_t lightadditivesurfaces;
int8_t nocoloredspritelighting;
int8_t notexturefill;
FVector3 skyrotatevector;
FVector3 skyrotatevector2;
float pixelstretch;
@ -299,6 +303,20 @@ DEFINE_MAP_OPTION(notexturefill, false)
}
}
DEFINE_MAP_OPTION(lightadditivesurfaces, false)
{
FGLROptions *opt = info->GetOptData<FGLROptions>("gl_renderer");
if (parse.CheckAssign())
{
parse.sc.MustGetNumber();
opt->lightadditivesurfaces = !!parse.sc.Number;
}
else
{
opt->lightadditivesurfaces = true;
}
}
DEFINE_MAP_OPTION(skyrotate, false)
{
FGLROptions *opt = info->GetOptData<FGLROptions>("gl_renderer");
@ -353,6 +371,7 @@ void InitGLRMapinfoData()
{
gl_SetFogParams(opt->fogdensity, level.info->outsidefog, opt->outsidefogdensity, opt->skyfog);
glset.map_lightmode = opt->lightmode;
glset.map_lightadditivesurfaces = opt->lightadditivesurfaces;
glset.map_brightfog = opt->brightfog;
glset.map_nocoloredspritelighting = opt->nocoloredspritelighting;
glset.map_notexturefill = opt->notexturefill;
@ -364,6 +383,7 @@ void InitGLRMapinfoData()
{
gl_SetFogParams(0, level.info->outsidefog, 0, 0);
glset.map_lightmode = -1;
glset.map_lightadditivesurfaces = -1;
glset.map_brightfog = -1;
glset.map_nocoloredspritelighting = -1;
glset.map_notexturefill = -1;
@ -380,6 +400,8 @@ void InitGLRMapinfoData()
else glset.notexturefill = !!glset.map_notexturefill;
if (glset.map_brightfog == -1) glset.brightfog = gl_brightfog;
else glset.brightfog = !!glset.map_brightfog;
if (glset.map_lightadditivesurfaces == -1) glset.brightfog = gl_brightfog;
else glset.lightadditivesurfaces = !!glset.map_lightadditivesurfaces;
}
CCMD(gl_resetmap)