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.
stable-6.1
Peter Wortmann 2015-03-15 22:41:58 +01:00 committed by Maikel de Vries
parent 5d505a5751
commit ccc7382ab9
1 changed files with 2 additions and 1 deletions

View File

@ -781,8 +781,9 @@ std::list<C4FoWBeamTriangle> 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;