diff --git a/src/emitters/sun.cpp b/src/emitters/sun.cpp index c257131d..f21a9705 100644 --- a/src/emitters/sun.cpp +++ b/src/emitters/sun.cpp @@ -192,7 +192,7 @@ public: std::min(std::max(0, (int) (sphCoords.azimuth * factor.x)), bitmap->getWidth()-1), std::min(std::max(0, (int) (sphCoords.elevation * factor.y)), bitmap->getHeight()-1)); - target[pos.x + pos.y * bitmap->getWidth()] += value / std::max(1e-3f, sinTheta); + target[pos.x + pos.y * bitmap->getWidth()] += value / std::max((Float) 1e-3f, sinTheta); } /* Instantiate a nested envmap plugin */ diff --git a/src/emitters/sunsky.cpp b/src/emitters/sunsky.cpp index bde9c5fb..3c56914f 100644 --- a/src/emitters/sunsky.cpp +++ b/src/emitters/sunsky.cpp @@ -191,7 +191,7 @@ public: std::min(std::max(0, (int) (sphCoords.azimuth * factor.x)), bitmap->getWidth()-1), std::min(std::max(0, (int) (sphCoords.elevation * factor.y)), bitmap->getHeight()-1)); - data[pos.x + pos.y * bitmap->getWidth()] += value / std::max(1e-3f, sinTheta); + data[pos.x + pos.y * bitmap->getWidth()] += value / std::max((Float) 1e-3f, sinTheta); } Log(EDebug, "Done (took %i ms)", timer->getMilliseconds());