]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/daynightratio.h
Turn off verbose info message introduced accidentally with ae9b1aa
[dragonfireclient.git] / src / daynightratio.h
index 96c6729ebf88c1420845016d50af8702e2d47b7c..f959cdf6caeef80f0b4faa20223d5ba917e06ba3 100644 (file)
@@ -1,6 +1,6 @@
 /*
-Minetest-c55
-Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
+Minetest
+Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
 
 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
@@ -17,8 +17,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
-#ifndef DAYNIGHTRATIO_HEADER
-#define DAYNIGHTRATIO_HEADER
+#pragma once
 
 inline u32 time_to_daynight_ratio(float time_of_day, bool smooth)
 {
@@ -51,19 +50,17 @@ inline u32 time_to_daynight_ratio(float time_of_day, bool smooth)
                        return values[i][1];
                }
                return 1000;
-       } else {
-               for(u32 i=0; i<sizeof(values)/sizeof(*values); i++){
-                       if(values[i][0] <= t)
+       }
+
+       for (u32 i=0; i < sizeof(values) / sizeof(*values); i++) {
+                       if (values[i][0] <= t)
                                continue;
-                       if(i == 0)
+                       if (i == 0)
                                return values[i][1];
                        float td0 = values[i][0] - values[i-1][0];
                        float f = (t - values[i-1][0]) / td0;
                        return f * values[i][1] + (1.0 - f) * values[i-1][1];
                }
                return 1000;
-       }
-}
-
-#endif
 
+}