mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-25 13:41:05 +00:00
- added a 'nolightfade' MAPINFO option which disables light diminishing in OpenGL. Note that this only works for light modes 0-3. Modes 4 and 8 use special light math that would not work if such a setting was forced.
This commit is contained in:
parent
1a63450fe2
commit
cb758f6dab
3 changed files with 21 additions and 1 deletions
|
@ -212,6 +212,7 @@ struct FGLROptions : public FOptionalMapinfoData
|
|||
lightmode = -1;
|
||||
attenuate = -1;
|
||||
nocoloredspritelighting = -1;
|
||||
nolightfade = false;
|
||||
notexturefill = -1;
|
||||
skyrotatevector = FVector3(0,0,1);
|
||||
skyrotatevector2 = FVector3(0,0,1);
|
||||
|
@ -228,6 +229,7 @@ struct FGLROptions : public FOptionalMapinfoData
|
|||
newopt->lightmode = lightmode;
|
||||
newopt->attenuate = attenuate;
|
||||
newopt->nocoloredspritelighting = nocoloredspritelighting;
|
||||
newopt->nolightfade = nolightfade;
|
||||
newopt->notexturefill = notexturefill;
|
||||
newopt->skyrotatevector = skyrotatevector;
|
||||
newopt->skyrotatevector2 = skyrotatevector2;
|
||||
|
@ -244,6 +246,7 @@ struct FGLROptions : public FOptionalMapinfoData
|
|||
int8_t lightadditivesurfaces;
|
||||
int8_t nocoloredspritelighting;
|
||||
int8_t notexturefill;
|
||||
bool nolightfade;
|
||||
FVector3 skyrotatevector;
|
||||
FVector3 skyrotatevector2;
|
||||
float pixelstretch;
|
||||
|
@ -303,6 +306,20 @@ DEFINE_MAP_OPTION(nocoloredspritelighting, false)
|
|||
}
|
||||
}
|
||||
|
||||
DEFINE_MAP_OPTION(nolightfade, false)
|
||||
{
|
||||
FGLROptions *opt = info->GetOptData<FGLROptions>("gl_renderer");
|
||||
if (parse.CheckAssign())
|
||||
{
|
||||
parse.sc.MustGetNumber();
|
||||
opt->nolightfade = !!parse.sc.Number;
|
||||
}
|
||||
else
|
||||
{
|
||||
opt->nolightfade = true;
|
||||
}
|
||||
}
|
||||
|
||||
DEFINE_MAP_OPTION(notexturefill, false)
|
||||
{
|
||||
FGLROptions *opt = info->GetOptData<FGLROptions>("gl_renderer");
|
||||
|
@ -423,6 +440,7 @@ void InitGLRMapinfoData()
|
|||
glset.skyrotatevector = opt->skyrotatevector;
|
||||
glset.skyrotatevector2 = opt->skyrotatevector2;
|
||||
glset.pixelstretch = opt->pixelstretch;
|
||||
glset.nolightfade = opt->nolightfade;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -436,6 +454,7 @@ void InitGLRMapinfoData()
|
|||
glset.skyrotatevector = FVector3(0, 0, 1);
|
||||
glset.skyrotatevector2 = FVector3(0, 0, 1);
|
||||
glset.pixelstretch = 1.2f;
|
||||
glset.nolightfade = false;
|
||||
}
|
||||
ResetOpts();
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ struct GLRenderSettings
|
|||
|
||||
SBYTE lightmode;
|
||||
bool nocoloredspritelighting;
|
||||
bool nolightfade;
|
||||
bool notexturefill;
|
||||
bool brightfog;
|
||||
bool lightadditivesurfaces;
|
||||
|
|
|
@ -312,7 +312,7 @@ float gl_GetFogDensity(int lightlevel, PalEntry fogcolor, int sectorfogdensity)
|
|||
else if ((fogcolor.d & 0xffffff) == 0)
|
||||
{
|
||||
// case 2: black fog
|
||||
if (glset.lightmode != 8)
|
||||
if (glset.lightmode != 8 && !glset.nolightfade)
|
||||
{
|
||||
density = distfogtable[glset.lightmode != 0][gl_ClampLight(lightlevel)];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue