]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/altimeter.cxx
Merge branch 'maint2' into next
[flightgear.git] / src / Instrumentation / altimeter.cxx
index 56516da2c647adf0d84e128e083e0d10b5a47a6b..8e9fbb1c95897cc72fde13ef4f5e2d9cf80f9796 100644 (file)
 //      </altimeter>
 // Note non-default name, quantum, and tau values.
 
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
 #include <simgear/math/interpolater.hxx>
+#include <simgear/math/SGMath.hxx>
 
 #include <Main/fg_props.hxx>
 #include <Main/util.hxx>
@@ -63,10 +68,10 @@ Altimeter::update (double dt)
         double press_alt = _press_alt_node->getDoubleValue();
         // The mechanism settles slowly toward new pressure altitude:
         raw_PA = fgGetLowPass(raw_PA, _altimeter.press_alt_ft(pressure), trat);
-        _mode_c_node->setDoubleValue(100 * round(raw_PA/100));
+        _mode_c_node->setDoubleValue(100 * SGMiscd::round(raw_PA/100));
         _kollsman = fgGetLowPass(_kollsman, _altimeter.kollsman_ft(setting), trat);
         if (_quantum)
-            press_alt = _quantum*round(raw_PA/_quantum);
+            press_alt = _quantum * SGMiscd::round(raw_PA/_quantum);
         else
             press_alt = raw_PA;
         _press_alt_node->setDoubleValue(press_alt);