From 455b2b3a913f5fbbc463750dcb125396526de288 Mon Sep 17 00:00:00 2001 From: ehofman Date: Fri, 27 Jun 2003 21:29:48 +0000 Subject: [PATCH] Use sqrt(x) and x*x instead of pow(x, 0.5) and pow(x, 2.0) --- src/Time/light.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Time/light.cxx b/src/Time/light.cxx index a55127ca0..145df3926 100644 --- a/src/Time/light.cxx +++ b/src/Time/light.cxx @@ -165,7 +165,7 @@ void fgLIGHT::Update( void ) { // adjust the cloud colors for sunrise/sunset effects (darken them) if (sun_angle > 1.0) { - float sun2 = pow(sun_angle, 0.5); + float sun2 = sqrt(sun_angle); cloud_color[0] /= sun2; cloud_color[1] /= sun2; cloud_color[2] /= sun2; @@ -225,8 +225,8 @@ void fgLIGHT::UpdateAdjFog( void ) { // Calculate the fog color in the direction of the sun for // sunrise/sunset effects. // - float s_red = (fog_color[0] + 2 * pow(sun_color[0], 2)) / 3; - float s_green = (fog_color[1] + 2 * pow(sun_color[1], 2)) / 3; + float s_red = (fog_color[0] + 2 * sun_color[0]*sun_color[0]) / 3; + float s_green = (fog_color[1] + 2 * sun_color[1]*sun_color[1]) / 3; float s_blue = (fog_color[2] + 2 * sun_color[2]) / 3; // interpolate beween the sunrise/sunset color and the color -- 2.39.5