From ccc7382ab969fa69e4fe66a84b22705ae17c7eaf Mon Sep 17 00:00:00 2001 From: Peter Wortmann Date: Sun, 15 Mar 2015 22:41:58 +0100 Subject: [PATCH] Another eta, this time for the fade cross check This was behind the rare "white dots" issues. Boy, floating point numbers are fiddly to work with - corner cases everywhere. --- src/landscape/fow/C4FoWLightSection.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/landscape/fow/C4FoWLightSection.cpp b/src/landscape/fow/C4FoWLightSection.cpp index ec9e16f62..898e7b299 100644 --- a/src/landscape/fow/C4FoWLightSection.cpp +++ b/src/landscape/fow/C4FoWLightSection.cpp @@ -781,8 +781,9 @@ std::list C4FoWLightSection::CalculateTriangles(C4FoWRegion * tri.fadeRY = tri.fanRY + d * dy; // Do the fades cross? + const double fadeCrossEta = 0.01 if ((tri.fadeRX - lightRX) / (tri.fadeRY - lightRY) - < (tri.fadeLX - lightRX) / (tri.fadeLY - lightRY)) + < (tri.fadeLX - lightRX) / (tri.fadeLY - lightRY) + fadeCrossEta) { // Average it tri.fadeLX = tri.fadeRX = (tri.fadeLX + tri.fadeRX) / 2;