]> git.tdb.fi Git - libs/demoscene.git/commitdiff
Use a different way of obtaining the value of pi
authorMikko Rasa <tdb@tdb.fi>
Sun, 16 Jun 2019 12:30:50 +0000 (15:30 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 16 Jun 2019 12:30:50 +0000 (15:30 +0300)
M_PI is not strictly a part of the C++ standard.

source/vignette.cpp

index e4d7de8f3a848e61c4fd31c6fce8059a550010ed..27b2dc1f156f9690d053a994662b3ab10e8acecc 100644 (file)
@@ -27,7 +27,8 @@ void Vignette::set_optical(float pupil, float aperture)
        float p_sq = pupil*pupil;
        float a_sq = aperture*aperture;
        float two_ap = 2*pupil*aperture;
-       shdata.uniform("optical", pupil, aperture, a_sq, a_sq*M_PI);
+       static const float pi = Geometry::Angle<float>::straight().radians();
+       shdata.uniform("optical", pupil, aperture, a_sq, a_sq*pi);
        shdata.uniform("optical_range", p_sq-two_ap+a_sq, p_sq+two_ap+a_sq);
 }