Fix for MSVC float conversion
authorJeroen Bakker <j.bakker@atmind.nl>
Thu, 17 May 2012 13:25:41 +0000 (13:25 +0000)
committerJeroen Bakker <j.bakker@atmind.nl>
Thu, 17 May 2012 13:25:41 +0000 (13:25 +0000)
source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp

index 4a4ac6c68330e4b5f8d54ac4e785a44a541da0cf..87ef015384d68087e8a2fcdc9d691cb1433de061 100644 (file)
@@ -93,7 +93,7 @@ void ScreenLensDistortionOperation::executePixel(float* outputColor, int x, int
                {
                        // RG
                        const int dx = ln[2] - ln[0], dy = ln[3] - ln[1];
-                       const float dsf = sqrtf(dx*dx + dy*dy) + 1.f;
+                       const float dsf = sqrtf((float)dx*dx + dy*dy) + 1.f;
                        const int ds = (int)(jit ? ((dsf < 4.f) ? 2.f : sqrtf(dsf)) : dsf);
                        const float sd = 1.f/(float)ds;
 
@@ -111,7 +111,7 @@ void ScreenLensDistortionOperation::executePixel(float* outputColor, int x, int
                {
                        // GB
                        const int dx = ln[4] - ln[2], dy = ln[5] - ln[3];
-                       const float dsf = sqrtf(dx*dx + dy*dy) + 1.f;
+                       const float dsf = sqrtf((float)dx*dx + dy*dy) + 1.f;
                        const int ds = (int)(jit ? ((dsf < 4.f) ? 2.f : sqrtf(dsf)) : dsf);
                        const float sd = 1.f/(float)ds;