diff --git a/src/gl/data/gl_data.cpp b/src/gl/data/gl_data.cpp index bb73ad3ae..bd185f76f 100644 --- a/src/gl/data/gl_data.cpp +++ b/src/gl/data/gl_data.cpp @@ -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("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("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(); } diff --git a/src/gl/data/gl_data.h b/src/gl/data/gl_data.h index d5bdeb46a..cf79fe138 100644 --- a/src/gl/data/gl_data.h +++ b/src/gl/data/gl_data.h @@ -10,6 +10,7 @@ struct GLRenderSettings SBYTE lightmode; bool nocoloredspritelighting; + bool nolightfade; bool notexturefill; bool brightfog; bool lightadditivesurfaces; diff --git a/src/gl/renderer/gl_lightdata.cpp b/src/gl/renderer/gl_lightdata.cpp index b4912f825..c017453bd 100644 --- a/src/gl/renderer/gl_lightdata.cpp +++ b/src/gl/renderer/gl_lightdata.cpp @@ -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)]; }