From b9230d44250128ae6e277e1feb05fcd817a087c4 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Wed, 29 May 2019 06:42:02 +0200 Subject: [PATCH] - fix negative uLightLevel being applied --- src/rendering/polyrenderer/drawers/poly_triangle.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/rendering/polyrenderer/drawers/poly_triangle.cpp b/src/rendering/polyrenderer/drawers/poly_triangle.cpp index 0dd087a04..7ca3628cc 100644 --- a/src/rendering/polyrenderer/drawers/poly_triangle.cpp +++ b/src/rendering/polyrenderer/drawers/poly_triangle.cpp @@ -300,7 +300,14 @@ void PolyTriangleThreadData::PushStreamData(const StreamData &data, const PolyPu FColormap cm; cm.Clear(); - drawargs.SetLight(GetColorTable(cm), (int)(constants.uLightLevel * 255.0f), mainVertexShader.Viewpoint->mGlobVis * 32.0f, false); + if (constants.uLightLevel >= 0.0f) + { + drawargs.SetLight(GetColorTable(cm), (int)(constants.uLightLevel * 255.0f), mainVertexShader.Viewpoint->mGlobVis * 32.0f, false); + } + else + { + drawargs.SetLight(GetColorTable(cm), 255, mainVertexShader.Viewpoint->mGlobVis * 32.0f, true); + } if (SpecialEffect != EFF_NONE) {