From 8b01a88b76f815833f77b3b7a7fcc47159d471e0 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 4 Sep 2016 12:45:09 +0200 Subject: [PATCH] - removed gl_lights_size and gl_lights_intensity. Both of these were inherited from ZDoomGL and in terms of light design in maps it makes absolutely no sense to have them user configurable. They should have been removed 11 years ago. --- src/gl/compatibility/gl_20.cpp | 8 ++++---- src/gl/dynlights/a_dynlight.cpp | 3 +-- src/gl/dynlights/gl_dynlight.cpp | 4 +--- src/gl/dynlights/gl_dynlight1.cpp | 10 ++++------ src/gl/scene/gl_spritelight.cpp | 8 ++++---- src/gl/scene/gl_walls_draw.cpp | 2 +- src/gl/system/gl_cvars.h | 2 -- wadsrc/static/menudef.z | 2 -- 8 files changed, 15 insertions(+), 24 deletions(-) diff --git a/src/gl/compatibility/gl_20.cpp b/src/gl/compatibility/gl_20.cpp index 60dd9ecdb9..e192b213e1 100644 --- a/src/gl/compatibility/gl_20.cpp +++ b/src/gl/compatibility/gl_20.cpp @@ -386,7 +386,7 @@ bool gl_SetupLight(int group, Plane & p, ADynamicLight * light, Vector & nearPt, DVector3 lpos = light->PosRelative(group); float dist = fabsf(p.DistToPoint(lpos.X, lpos.Z, lpos.Y)); - float radius = (light->GetRadius() * gl_lights_size); + float radius = light->GetRadius(); if (radius <= 0.f) return false; if (dist > radius) return false; @@ -417,9 +417,9 @@ bool gl_SetupLight(int group, Plane & p, ADynamicLight * light, Vector & nearPt, float cs = 1.0f - (dist / radius); if (additive) cs *= 0.2f; // otherwise the light gets too strong. - float r = light->GetRed() / 255.0f * cs * gl_lights_intensity; - float g = light->GetGreen() / 255.0f * cs * gl_lights_intensity; - float b = light->GetBlue() / 255.0f * cs * gl_lights_intensity; + float r = light->GetRed() / 255.0f * cs; + float g = light->GetGreen() / 255.0f * cs; + float b = light->GetBlue() / 255.0f * cs; if (light->IsSubtractive()) { diff --git a/src/gl/dynlights/a_dynlight.cpp b/src/gl/dynlights/a_dynlight.cpp index e90bbdc809..ac929e7c00 100644 --- a/src/gl/dynlights/a_dynlight.cpp +++ b/src/gl/dynlights/a_dynlight.cpp @@ -57,7 +57,6 @@ #include "gl/utility/gl_convert.h" #include "gl/utility/gl_templates.h" -EXTERN_CVAR (Float, gl_lights_size); EXTERN_CVAR(Int, vid_renderer) @@ -378,7 +377,7 @@ void ADynamicLight::UpdateLocation() { intensity = m_currentRadius; } - radius = intensity * 2.0f * gl_lights_size; + radius = intensity * 2.0f; if (X() != oldx || Y() != oldy || radius != oldradius) { diff --git a/src/gl/dynlights/gl_dynlight.cpp b/src/gl/dynlights/gl_dynlight.cpp index e7d876b2af..b12290ab6d 100644 --- a/src/gl/dynlights/gl_dynlight.cpp +++ b/src/gl/dynlights/gl_dynlight.cpp @@ -61,8 +61,6 @@ #include "gl/utility/gl_clock.h" #include "gl/utility/gl_convert.h" -EXTERN_CVAR (Float, gl_lights_intensity); -EXTERN_CVAR (Float, gl_lights_size); int ScriptDepth; void gl_InitGlow(FScanner &sc); void gl_ParseBrightmap(FScanner &sc, int); @@ -175,7 +173,7 @@ void FLightDefaults::ApplyProperties(ADynamicLight * light) const light->Angles.Yaw.Degrees = m_Param; light->SetOffset(m_Pos); light->halo = m_halo; - for (int a = 0; a < 3; a++) light->args[a] = clamp((int)(m_Args[a] * gl_lights_intensity), 0, 255); + for (int a = 0; a < 3; a++) light->args[a] = clamp((int)(m_Args[a]), 0, 255); light->m_Radius[0] = int(m_Args[LIGHT_INTENSITY]); light->m_Radius[1] = int(m_Args[LIGHT_SECONDARY_INTENSITY]); light->flags4 &= ~(MF4_ADDITIVE | MF4_SUBTRACTIVE | MF4_DONTLIGHTSELF); diff --git a/src/gl/dynlights/gl_dynlight1.cpp b/src/gl/dynlights/gl_dynlight1.cpp index eb3c45f9c6..89cdd1ecb8 100644 --- a/src/gl/dynlights/gl_dynlight1.cpp +++ b/src/gl/dynlights/gl_dynlight1.cpp @@ -70,8 +70,6 @@ CUSTOM_CVAR (Bool, gl_lights, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOIN CVAR (Bool, gl_attachedlights, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG); CVAR (Bool, gl_lights_checkside, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG); -CVAR (Float, gl_lights_intensity, 1.0f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG); -CVAR (Float, gl_lights_size, 1.0f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG); CVAR (Bool, gl_light_sprites, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG); CVAR (Bool, gl_light_particles, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG); @@ -87,7 +85,7 @@ bool gl_GetLight(int group, Plane & p, ADynamicLight * light, bool checkside, FD DVector3 pos = light->PosRelative(group); float dist = fabsf(p.DistToPoint(pos.X, pos.Z, pos.Y)); - float radius = (light->GetRadius() * gl_lights_size); + float radius = (light->GetRadius()); if (radius <= 0.f) return false; if (dist > radius) return false; @@ -108,9 +106,9 @@ bool gl_GetLight(int group, Plane & p, ADynamicLight * light, bool checkside, FD cs = 1.0f; } - float r = light->GetRed() / 255.0f * cs * gl_lights_intensity; - float g = light->GetGreen() / 255.0f * cs * gl_lights_intensity; - float b = light->GetBlue() / 255.0f * cs * gl_lights_intensity; + float r = light->GetRed() / 255.0f * cs; + float g = light->GetGreen() / 255.0f * cs; + float b = light->GetBlue() / 255.0f * cs; if (light->IsSubtractive()) { diff --git a/src/gl/scene/gl_spritelight.cpp b/src/gl/scene/gl_spritelight.cpp index b25fc30f0b..329459bd1e 100644 --- a/src/gl/scene/gl_spritelight.cpp +++ b/src/gl/scene/gl_spritelight.cpp @@ -96,7 +96,7 @@ void gl_SetDynSpriteLight(AActor *self, float x, float y, float z, subsector_t * dist = FVector3(x - light->X(), y - light->Y(), z - light->Z()).LengthSquared(); } - radius = light->GetRadius() * gl_lights_size; + radius = light->GetRadius(); if (dist < radius * radius) { @@ -106,9 +106,9 @@ void gl_SetDynSpriteLight(AActor *self, float x, float y, float z, subsector_t * if (frac > 0) { - lr = light->GetRed() / 255.0f * gl_lights_intensity; - lg = light->GetGreen() / 255.0f * gl_lights_intensity; - lb = light->GetBlue() / 255.0f * gl_lights_intensity; + lr = light->GetRed() / 255.0f; + lg = light->GetGreen() / 255.0f; + lb = light->GetBlue() / 255.0f; if (light->IsSubtractive()) { float bright = FVector3(lr, lg, lb).Length(); diff --git a/src/gl/scene/gl_walls_draw.cpp b/src/gl/scene/gl_walls_draw.cpp index 9599b8fa3c..9f521ad11d 100644 --- a/src/gl/scene/gl_walls_draw.cpp +++ b/src/gl/scene/gl_walls_draw.cpp @@ -124,7 +124,7 @@ void GLWall::SetupLights() float y = node->lightsource->Y(); float z = node->lightsource->Z(); float dist = fabsf(p.DistToPoint(x, z, y)); - float radius = (node->lightsource->GetRadius() * gl_lights_size); + float radius = node->lightsource->GetRadius(); float scale = 1.0f / ((2.f * radius) - dist); if (radius > 0.f && dist < radius) diff --git a/src/gl/system/gl_cvars.h b/src/gl/system/gl_cvars.h index da1febe3ca..4cda3657de 100644 --- a/src/gl/system/gl_cvars.h +++ b/src/gl/system/gl_cvars.h @@ -24,8 +24,6 @@ EXTERN_CVAR(Int, gl_weaponlight) EXTERN_CVAR (Bool, gl_lights); EXTERN_CVAR (Bool, gl_attachedlights); EXTERN_CVAR (Bool, gl_lights_checkside); -EXTERN_CVAR (Float, gl_lights_intensity); -EXTERN_CVAR (Float, gl_lights_size); EXTERN_CVAR (Bool, gl_light_sprites); EXTERN_CVAR (Bool, gl_light_particles); diff --git a/wadsrc/static/menudef.z b/wadsrc/static/menudef.z index abc7cfacc4..8879d6170e 100644 --- a/wadsrc/static/menudef.z +++ b/wadsrc/static/menudef.z @@ -198,8 +198,6 @@ OptionMenu "GLLightOptions" Option "$GLLIGHTMNU_CLIPLIGHTS", gl_lights_checkside, "YesNo" Option "$GLLIGHTMNU_LIGHTSPRITES", gl_light_sprites, "YesNo" Option "$GLLIGHTMNU_LIGHTPARTICLES", gl_light_particles, "YesNo" - Slider "$GLLIGHTMNU_LIGHTINTENSITY", gl_lights_intensity, 0.0, 1.0, 0.1 - Slider "$GLLIGHTMNU_LIGHTSIZE", gl_lights_size, 0.0, 2.0, 0.1 } OptionMenu "GLPrefOptions"