From 977d5988c5e6a3671bee53286b9721eb26794cde Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 31 May 2017 09:27:50 +0200 Subject: [PATCH] - fixed weapon sprite light calculation for low light levels. --- src/gl/scene/gl_weapon.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gl/scene/gl_weapon.cpp b/src/gl/scene/gl_weapon.cpp index 23610fb01..dcdf260ef 100644 --- a/src/gl/scene/gl_weapon.cpp +++ b/src/gl/scene/gl_weapon.cpp @@ -244,7 +244,7 @@ void GLSceneDrawer::DrawPlayerSprites(sector_t * viewsector, bool hudModelStep) } else { - fakesec = gl_FakeFlat(viewsector, &fs, in_area, false); + fakesec = gl_FakeFlat(viewsector, &fs, in_area, false); // calculate light level for weapon sprites lightlevel = gl_ClampLight(fakesec->lightlevel); @@ -282,7 +282,7 @@ void GLSceneDrawer::DrawPlayerSprites(sector_t * viewsector, bool hudModelStep) lightlevel = gl_CalcLightLevel(lightlevel, getExtraLight(), true); - if (glset.lightmode == 8) + if (glset.lightmode == 8 || lightlevel < 92) { // Korshun: the way based on max possible light level for sector like in software renderer. float min_L = 36.0 / 31.0 - ((lightlevel / 255.0) * (63.0 / 31.0)); // Lightlevel in range 0-63