From 8e0b80aa369df7d1142053f077df928106c6ce8c Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Wed, 4 Apr 2018 07:42:40 +0200 Subject: Fix last performance-type-promotion-in-math-fn problems --- src/sky.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'src/sky.cpp') diff --git a/src/sky.cpp b/src/sky.cpp index 02e882592..03afc4464 100644 --- a/src/sky.cpp +++ b/src/sky.cpp @@ -1,3 +1,22 @@ +/* +Minetest +Copyright (C) 2010-2013 celeron55, Perttu Ahola + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + #include "sky.h" #include "IVideoDriver.h" #include "ISceneManager.h" @@ -243,7 +262,7 @@ void Sky::render() { float mid1 = 0.25; float mid = wicked_time_of_day < 0.5 ? mid1 : (1.0 - mid1); - float a_ = 1.0 - fabs(wicked_time_of_day - mid) * 35.0; + float a_ = 1.0f - std::fabs(wicked_time_of_day - mid) * 35.0f; float a = easeCurve(MYMAX(0, MYMIN(1, a_))); //std::cerr<<"a_="<